Package Summary

Tags No category tags.
Version 3.3.0
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/rt-net/crane_x7_ros.git
VCS Type git
VCS Version foxy-devel
Last Updated 2023-02-21
Dev Status MAINTAINED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

CRANE-X7 examples package

Additional Links

No additional links.

Maintainers

  • RT Corporation

Authors

  • Shota Aoki
  • Atsushi Kuwagata

crane_x7_examples

このパッケージはCRANE-X7 ROS 2パッケージのサンプルコード集です。

準備(実機を使う場合)

crane_x7

1. CRANE-X7本体をPCに接続する

CRANE-X7本体をPCに接続します。 接続方法は製品マニュアルを参照してください。

※CRANE-X7本体が接触しないように、十分なスペースを確保してください。

2. USB通信ポートの接続を確認する

USB通信ポートの設定についてはcrane_x7_controlREADME を参照してください。

正しく設定できていない場合、CRANE-X7が動作しないので注意してください

3. move_groupとcontrollerを起動する

標準のCRANE-X7を使用する場合

次のコマンドでmove_group (crane_x7_moveit_config)と controller (crane_x7_control)を起動します。

ros2 launch crane_x7_examples demo.launch.py port_name:=/dev/ttyUSB0

RealSense D435マウンタ搭載モデルを使用する場合

RealSense D435マウンタを搭載している場合は次のコマンドを実行します。RealSense D435が起動し、camera_linkがロボットモデルに追加されます。

ros2 launch crane_x7_examples demo.launch.py port_name:=/dev/ttyUSB0 use_d435:=true

準備 (Gazeboを使う場合)

crane_x7_gazebo

1. move_groupとGazeboを起動する

次のコマンドでmove_group (crane_x7_moveit_config)と Gazeboを起動します。

ros2 launch crane_x7_gazebo crane_x7_with_table.launch.py

サンプルプログラムを実行する

準備ができたらサンプルプログラムを実行します。 例えばグリッパを開閉するサンプルは次のコマンドで実行できます。

ros2 launch crane_x7_examples example.launch.py example:='gripper_control'

終了するときはCtrl+cを入力します。

Examples

demo.launchを実行している状態で各サンプルを実行できます。

実行できるサンプルの一覧は、example.launch.pyにオプション-sを付けて実行することで表示できます。

$ ros2 launch crane_x7_examples example.launch.py -s
Arguments (pass arguments as '<name>:=<value>'):

    'example':
        Set an example executable name: [gripper_control, pose_groupstate, joint_values,pick_and_place, cartesian_path]
        (default: 'pose_groupstate')


gripper_control

ハンドを開閉させるコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='gripper_control'

Videos

crane_x7_gripper_control_demo

back to example list


pose_groupstate

group_stateを使うコード例です。

SRDFファイルcrane_x7_moveit_config/config/crane_x7.srdf に記載されているhomeverticalの姿勢に移行します。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='pose_groupstate'

Videos

crane_x7_pose_groupstate_demo

back to example list


joint_values

アームのジョイント角度を1つずつ変更させるコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='joint_values'

Videos

crane_x7_joint_values_demo

back to example list


cartesian_path

Cartesian Path を生成し、手先で円を描くコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='cartesian_path'

Videos

crane_x7_cartesian_path_demo

back to example list


pick_and_place

モノを掴む・持ち上げる・運ぶ・置くコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='pick_and_place'

実機を使う場合

CRANE-X7から20cm離れた位置にピッキング対象を設置します。

サンプルで使用しているこのオレンジ色のソフトボールはRT ROBOT SHOPのこちらのページから入手することができます。

Videos

crane_x7_pick_and_place_demo

back to example list

Camera Examples

RealSense D435マウンタ搭載モデルのカメラを使用したサンプルコードです。

「RealSense D435マウンタ搭載モデルを使用する場合」の手順に従ってdemo.launchを実行している状態で各サンプルを実行できます。

実行できるサンプルの一覧は、camera_example.launch.pyにオプション-sを付けて実行することで表示できます。

$ ros2 launch crane_x7_examples camera_example.launch.py -s
Arguments (pass arguments as '<name>:=<value>'):

    'example':
        Set an example executable name: [aruco_detection, point_cloud_detection]
        (default: 'aruco_detection')

aruco_detection

モノに取り付けたArUcoマーカをカメラで認識し、マーカ位置に合わせて掴むコード例です。 マーカはaruco_markers.pdfをA4紙に印刷し、一辺50mmの立方体に取り付けて使用します。

認識されたマーカの位置姿勢はtfのフレームとして配信されます。 tfのframe_idはマーカIDごとに異なりID0のマーカのframe_idtarget_0になります。掴む対象はtarget_0に設定されています。マーカ認識にはOpenCVを使用しています。

次のコマンドを実行します

ros2 launch crane_x7_examples camera_example.launch.py example:='aruco_detection'

Videos

crane_x7_aruco_detection_demo

back to camera example list


point_cloud_detection

点群から物体位置を認識して掴むコード例です。

認識された物体位置はtfのフレームとして配信されます。 tfのframe_idは認識された順にtarget_0target_1target_2…に設定されます。掴む対象はtarget_0に設定されています。 物体認識にはPoint Cloud Libraryを使用しています。

次のコマンドを実行します

ros2 launch crane_x7_examples camera_example.launch.py example:='point_cloud_detection'

Videos

crane_x7_point_cloud_detection_demo

back to camera example list

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged crane_x7_examples at answers.ros.org

Package Summary

Tags No category tags.
Version 4.2.0
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/rt-net/crane_x7_ros.git
VCS Type git
VCS Version humble-devel
Last Updated 2023-02-21
Dev Status MAINTAINED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

CRANE-X7 examples package

Additional Links

No additional links.

Maintainers

  • RT Corporation

Authors

  • Shota Aoki
  • Atsushi Kuwagata

crane_x7_examples

このパッケージはCRANE-X7 ROS 2パッケージのサンプルコード集です。

準備(実機を使う場合)

crane_x7

1. CRANE-X7本体をPCに接続する

CRANE-X7本体をPCに接続します。 接続方法は製品マニュアルを参照してください。

※CRANE-X7本体が接触しないように、十分なスペースを確保してください。

2. USB通信ポートの接続を確認する

USB通信ポートの設定についてはcrane_x7_controlREADME を参照してください。

正しく設定できていない場合、CRANE-X7が動作しないので注意してください

3. move_groupとcontrollerを起動する

標準のCRANE-X7を使用する場合

次のコマンドでmove_group (crane_x7_moveit_config)と controller (crane_x7_control)を起動します。

ros2 launch crane_x7_examples demo.launch.py port_name:=/dev/ttyUSB0

RealSense D435マウンタ搭載モデルを使用する場合

RealSense D435マウンタを搭載している場合は次のコマンドを実行します。RealSense D435が起動し、camera_linkがロボットモデルに追加されます。

ros2 launch crane_x7_examples demo.launch.py port_name:=/dev/ttyUSB0 use_d435:=true

準備 (Gazeboを使う場合)

crane_x7_gazebo

1. move_groupとGazeboを起動する

次のコマンドでmove_group (crane_x7_moveit_config)と Gazeboを起動します。

ros2 launch crane_x7_gazebo crane_x7_with_table.launch.py

サンプルプログラムを実行する

準備ができたらサンプルプログラムを実行します。 例えばグリッパを開閉するサンプルは次のコマンドで実行できます。

ros2 launch crane_x7_examples example.launch.py example:='gripper_control'

終了するときはCtrl+cを入力します。

Gazeboでサンプルプログラムを実行する場合

Gazeboでサンプルプログラムを実行する場合はuse_sim_timeオプションを付けます。

ros2 launch crane_x7_examples example.launch.py example:='gripper_control' use_sim_time:='true'

Examples

demo.launchを実行している状態で各サンプルを実行できます。

実行できるサンプルの一覧は、example.launch.pyにオプション-sを付けて実行することで表示できます。

$ ros2 launch crane_x7_examples example.launch.py -s
Arguments (pass arguments as '<name>:=<value>'):

    'example':
        Set an example executable name: [gripper_control, pose_groupstate, joint_values,pick_and_place, cartesian_path]
        (default: 'pose_groupstate')


gripper_control

ハンドを開閉させるコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='gripper_control'

Videos

crane_x7_gripper_control_demo

back to example list


pose_groupstate

group_stateを使うコード例です。

SRDFファイルcrane_x7_moveit_config/config/crane_x7.srdf に記載されているhomeverticalの姿勢に移行します。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='pose_groupstate'

Videos

crane_x7_pose_groupstate_demo

back to example list


joint_values

アームのジョイント角度を1つずつ変更させるコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='joint_values'

Videos

crane_x7_joint_values_demo

back to example list


cartesian_path

Cartesian Path を生成し、手先で円を描くコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='cartesian_path'

Videos

crane_x7_cartesian_path_demo

back to example list


pick_and_place

モノを掴む・持ち上げる・運ぶ・置くコード例です。

次のコマンドを実行します。

ros2 launch crane_x7_examples example.launch.py example:='pick_and_place'

実機を使う場合

CRANE-X7から20cm離れた位置にピッキング対象を設置します。

サンプルで使用しているこのオレンジ色のソフトボールはRT ROBOT SHOPのこちらのページから入手することができます。

Videos

crane_x7_pick_and_place_demo

back to example list

Camera Examples

RealSense D435マウンタ搭載モデルのカメラを使用したサンプルコードです。

「RealSense D435マウンタ搭載モデルを使用する場合」の手順に従ってdemo.launchを実行している状態で各サンプルを実行できます。

実行できるサンプルの一覧は、camera_example.launch.pyにオプション-sを付けて実行することで表示できます。

$ ros2 launch crane_x7_examples camera_example.launch.py -s
Arguments (pass arguments as '<name>:=<value>'):

    'example':
        Set an example executable name: [aruco_detection, point_cloud_detection]
        (default: 'aruco_detection')

aruco_detection

モノに取り付けたArUcoマーカをカメラで認識し、マーカ位置に合わせて掴むコード例です。 マーカはaruco_markers.pdfをA4紙に印刷し、一辺50mmの立方体に取り付けて使用します。

認識されたマーカの位置姿勢はtfのフレームとして配信されます。 tfのframe_idはマーカIDごとに異なりID0のマーカのframe_idtarget_0になります。掴む対象はtarget_0に設定されています。マーカ認識にはOpenCVを使用しています。

次のコマンドを実行します

ros2 launch crane_x7_examples camera_example.launch.py example:='aruco_detection'

Videos

crane_x7_aruco_detection_demo

back to camera example list


point_cloud_detection

点群から物体位置を認識して掴むコード例です。

認識された物体位置はtfのフレームとして配信されます。 tfのframe_idは認識された順にtarget_0target_1target_2…に設定されます。掴む対象はtarget_0に設定されています。 物体認識にはPoint Cloud Libraryを使用しています。

次のコマンドを実行します

ros2 launch crane_x7_examples camera_example.launch.py example:='point_cloud_detection'

Videos

crane_x7_point_cloud_detection_demo

back to camera example list

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged crane_x7_examples at answers.ros.org

No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 2.0.0
License Apache License 2.0
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/rt-net/crane_x7_ros.git
VCS Type git
VCS Version master
Last Updated 2023-02-21
Dev Status MAINTAINED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

examples of CRANE-X7 ROS package

Additional Links

No additional links.

Maintainers

  • RT Corporation

Authors

  • Daisuke Sato
  • Hiroyuki Nomura

English | 日本語

crane_x7_examples

This package includes examples to control CRANE-X7 using crane_x7_ros.

How to launch CRANE-X7 base packages

  1. Connect a communication cable from CRANE-X7 to a PC.
  2. Open terminal and launch demo.launch of crane_x7_bringup package.

This launch file has an argument to select CRANE-X7 or virtual CRANE-X7:

  • fake_execution (default: true)

Using virtual CRANE-X7

Launch virtual CRANE-X7 base packages with the following command:

roslaunch crane_x7_bringup demo.launch fake_execution:=true

Using real CRANE-X7

Launch the base packages with the following command:

roslaunch crane_x7_bringup demo.launch fake_execution:=false

Default serial port name is /dev/ttyUSB0. To change port name (e.g. /dev/ttyUSB1), launch the packages with arguments:

roslaunch crane_x7_bringup demo.launch fake_execution:=false port:=/dev/ttyUSB1

Using Gazebo simulator

Launch the packages with the following command:

roslaunch crane_x7_gazebo crane_x7_with_table.launch

Run Examples

Following examples will be executable after launch CRANE-X7 base packages.


gripper_action_example

This is an example to open/close the gripper.

Run a node with the following command:

rosrun crane_x7_examples gripper_action_example.py

back to example list


pose_groupstate_example

This is an example using group_state of SRDF.

CRANE-X7 changes its posture to home and vertical listed in SRDF file crane_x7_moveit_config/config/crane_x7.srdf.

Run a node with the following command:

rosrun crane_x7_examples pose_groupstate_example.py

back to example list


joint_values_example

This is an example to change each joint values of arm one by one using moveit_commander.

Run a node with the following command:

rosrun crane_x7_examples joint_values_example.py

back to example list


cartesian_path_example

This is an example to plan a circular path that the hand follows using moveit_commander and Cartesian Path.

Run a node with the following command:

rosrun crane_x7_examples cartesian_path_example.py

Videos

back to example list


crane_x7_pick_and_place_demo

This is an example to grasp, pick up, carry and place an small object.

Run a node with the following command:

rosrun crane_x7_examples crane_x7_pick_and_place_demo.py

Real environment setup

Place the small object at a distance of 20 cm from CRANE-X7.

This orange ball can be purchased at this page in RT ROBOT SHOP.

Videos

crane_x7_pick_and_place_demo

back to example list


preset_pid_gain_example

This is an example to change PID gains of servo motors in bulk using preset_reconfigure of crane_x7_control.

Lists of PID gain preset values can be edited in crane_x7_control/scripts/preset_reconfigure.py.

Launch nodes preset_reconfigure.py and preset_pid_gain_example.py with the following command:

roslaunch crane_x7_examples preset_pid_gain_example.launch

Videos

preset_pid_gain_example

back to example list


teaching_example

This is an example to generate an motion trajectory with direct teaching.

User can operate CRANE-X7 directly because the PID gains of servo motors will be small values.

Launch nodes with the following command:

roslaunch crane_x7_examples teaching_example.launch

Please see below for keyboard operation.

Teaching Mode

This is a mode at startup and the PID gains will be small values.

Key Function
s / S Save current posture
d / D Delete all posture data
m / M Transition to Action **Mode
q / Q Quit application

Action Mode

This is a mode transitioned from Teaching Mode and the PID gains will return to normal values.

Key Function
p / P Playback a posture data
a / A Playback all posture data consecutively
l / L Toggle loop playback (ON/OFF)
m / M Transition to Teaching **Mode
q / Q Quit application

Videos

teaching_example

back to example list


joystick_example

This is an example to use joystick controller to change the hand position and posture, or to open and close of the gripper, or to preset the PID gains or to generate a position trajectory with direct teaching.

Connect a joystick controller to a PC and check the device /dev/input/js0 existence then launch nodes with the following command:

for control CRANE-X7

roslaunch crane_x7_examples joystick_example.launch

for control virtual CRANE-X7

Please add an argument sim to avoid an error.

roslaunch crane_x7_examples joystick_example.launch sim:=true

Key configuration

This picture shows the default key configuration. The joystick controller is Logicool Wireless Gamepad F710.

Key assignments can be edited with key numbers in crane_x7_example/launch/joystick_example.launch.

 <node name="joystick_example" pkg="crane_x7_examples" type="joystick_example.py" required="true" output="screen">
    <param name="button_shutdown_1" value="8" type="int" />
    <param name="button_shutdown_2" value="9" type="int" />

    <param name="button_name_enable" value="7" type="int" />
    <param name="button_name_home"  value="8" type="int" />

    <param name="button_preset_enable" value="7" type="int" />
    <param name="button_preset_no1" value="9" type="int" />

This picture shows the default key numbers.

Please display /joy topic with the command rostopic echo /joy to check the default key numbers.

roslaunch crane_x7_examples joystick_example.launch sim:=true

# Enter the command in another terminal 
rostopic echo /joy

# Press buttons of a joystick controller
header: 
  seq: 1
  stamp: 
    secs: 1549359364
    nsecs: 214800952
  frame_id: ''
axes: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---

Videos

joystick_example

back to example list


obstacle_avoidance_example

This is an example to use rosservice to add dummy obstacles and to avoid the obstacles.

Launch nodes with the following command:

roslaunch crane_x7_examples obstacle_avoidance_example.launch

This example uses a service file including target posture of CRANE-X7 and size and posture of an obstacle.

These values can be edited in crane_x7_examples/scripts/obstacle_client.py.

The default obstacle shape is rectangular.

    # Define obstacle shape and pose
    obstacle_name = "box"
    obstacle_size = Vector3(0.28, 0.16, 0.14)
    obstacle_pose_stamped = PoseStamped()
    obstacle_pose_stamped.header.frame_id = "/base_link"
    obstacle_pose_stamped.pose.position.x = 0.35
    obstacle_pose_stamped.pose.position.z = obstacle_size.z/2.0

This example generates a dummy floor as an obstacle to move safely.

If this floor is unnecessary, please comment out some lines from crane_x7_examples/scripts/obstacle_avoidance_example.py.

    # Generate dummy floor
    floor_name = "floor"
    floor_size = (2.0, 2.0, 0.01)
    floor_pose = PoseStamped()
    floor_pose.header.frame_id = "/base_link"
    floor_pose.pose.position.z = -floor_size[2]/2.0
    scene.add_box(floor_name, floor_pose, floor_size)
    rospy.sleep(SLEEP_TIME)

If MoveIt did not generate trajectory to avoid an obstacle, CRANE-X7 will not move, the example server will return value result=False, then MoveIt will calculate a trajectory to next target position.

back to example list


servo_info_example

This is an example to subscribe the servo motor status.

Run a node with the following command:

rosrun crane_x7_examples servo_info_example.py

This example subscribes topics of gripper joint crane_x7_gripper_finger_a_joint and displays the servo motor current, position and temperature to a terminal.

 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 2.69    dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 2.69    dxl_position: 2634    temp [deg C]: 42.0
 ...

If the motor current exceed thresholds, the gripper will open/close. This function enables user to open/close the gripper by hand.

Please refere crane_x7_control/README.md for details of the topics.

back to example list


pick_and_place_in_gazebo_example

This is an example to grasp, pick up, carry and place an small object on Gazebo environments.

Launch nodes with the following command with arguments to control the gripper by EffortController.

roslaunch crane_x7_gazebo crane_x7_with_table.launch use_effort_gripper:=true

After Gazebo launch, run a node with the following command:

rosrun crane_x7_examples pick_and_place_in_gazebo_example.py

Videos

pick_and_place_in_gazebo

back to example list

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Messages

No message files found.

Plugins

No plugins found.

Recent questions tagged crane_x7_examples at answers.ros.org

Package Summary

Tags No category tags.
Version 2.0.0
License Apache License 2.0
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/rt-net/crane_x7_ros.git
VCS Type git
VCS Version master
Last Updated 2023-02-21
Dev Status MAINTAINED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

examples of CRANE-X7 ROS package

Additional Links

No additional links.

Maintainers

  • RT Corporation

Authors

  • Daisuke Sato
  • Hiroyuki Nomura

English | 日本語

crane_x7_examples

This package includes examples to control CRANE-X7 using crane_x7_ros.

How to launch CRANE-X7 base packages

  1. Connect a communication cable from CRANE-X7 to a PC.
  2. Open terminal and launch demo.launch of crane_x7_bringup package.

This launch file has an argument to select CRANE-X7 or virtual CRANE-X7:

  • fake_execution (default: true)

Using virtual CRANE-X7

Launch virtual CRANE-X7 base packages with the following command:

roslaunch crane_x7_bringup demo.launch fake_execution:=true

Using real CRANE-X7

Launch the base packages with the following command:

roslaunch crane_x7_bringup demo.launch fake_execution:=false

Default serial port name is /dev/ttyUSB0. To change port name (e.g. /dev/ttyUSB1), launch the packages with arguments:

roslaunch crane_x7_bringup demo.launch fake_execution:=false port:=/dev/ttyUSB1

Using Gazebo simulator

Launch the packages with the following command:

roslaunch crane_x7_gazebo crane_x7_with_table.launch

Run Examples

Following examples will be executable after launch CRANE-X7 base packages.


gripper_action_example

This is an example to open/close the gripper.

Run a node with the following command:

rosrun crane_x7_examples gripper_action_example.py

back to example list


pose_groupstate_example

This is an example using group_state of SRDF.

CRANE-X7 changes its posture to home and vertical listed in SRDF file crane_x7_moveit_config/config/crane_x7.srdf.

Run a node with the following command:

rosrun crane_x7_examples pose_groupstate_example.py

back to example list


joint_values_example

This is an example to change each joint values of arm one by one using moveit_commander.

Run a node with the following command:

rosrun crane_x7_examples joint_values_example.py

back to example list


cartesian_path_example

This is an example to plan a circular path that the hand follows using moveit_commander and Cartesian Path.

Run a node with the following command:

rosrun crane_x7_examples cartesian_path_example.py

Videos

back to example list


crane_x7_pick_and_place_demo

This is an example to grasp, pick up, carry and place an small object.

Run a node with the following command:

rosrun crane_x7_examples crane_x7_pick_and_place_demo.py

Real environment setup

Place the small object at a distance of 20 cm from CRANE-X7.

This orange ball can be purchased at this page in RT ROBOT SHOP.

Videos

crane_x7_pick_and_place_demo

back to example list


preset_pid_gain_example

This is an example to change PID gains of servo motors in bulk using preset_reconfigure of crane_x7_control.

Lists of PID gain preset values can be edited in crane_x7_control/scripts/preset_reconfigure.py.

Launch nodes preset_reconfigure.py and preset_pid_gain_example.py with the following command:

roslaunch crane_x7_examples preset_pid_gain_example.launch

Videos

preset_pid_gain_example

back to example list


teaching_example

This is an example to generate an motion trajectory with direct teaching.

User can operate CRANE-X7 directly because the PID gains of servo motors will be small values.

Launch nodes with the following command:

roslaunch crane_x7_examples teaching_example.launch

Please see below for keyboard operation.

Teaching Mode

This is a mode at startup and the PID gains will be small values.

Key Function
s / S Save current posture
d / D Delete all posture data
m / M Transition to Action **Mode
q / Q Quit application

Action Mode

This is a mode transitioned from Teaching Mode and the PID gains will return to normal values.

Key Function
p / P Playback a posture data
a / A Playback all posture data consecutively
l / L Toggle loop playback (ON/OFF)
m / M Transition to Teaching **Mode
q / Q Quit application

Videos

teaching_example

back to example list


joystick_example

This is an example to use joystick controller to change the hand position and posture, or to open and close of the gripper, or to preset the PID gains or to generate a position trajectory with direct teaching.

Connect a joystick controller to a PC and check the device /dev/input/js0 existence then launch nodes with the following command:

for control CRANE-X7

roslaunch crane_x7_examples joystick_example.launch

for control virtual CRANE-X7

Please add an argument sim to avoid an error.

roslaunch crane_x7_examples joystick_example.launch sim:=true

Key configuration

This picture shows the default key configuration. The joystick controller is Logicool Wireless Gamepad F710.

Key assignments can be edited with key numbers in crane_x7_example/launch/joystick_example.launch.

 <node name="joystick_example" pkg="crane_x7_examples" type="joystick_example.py" required="true" output="screen">
    <param name="button_shutdown_1" value="8" type="int" />
    <param name="button_shutdown_2" value="9" type="int" />

    <param name="button_name_enable" value="7" type="int" />
    <param name="button_name_home"  value="8" type="int" />

    <param name="button_preset_enable" value="7" type="int" />
    <param name="button_preset_no1" value="9" type="int" />

This picture shows the default key numbers.

Please display /joy topic with the command rostopic echo /joy to check the default key numbers.

roslaunch crane_x7_examples joystick_example.launch sim:=true

# Enter the command in another terminal 
rostopic echo /joy

# Press buttons of a joystick controller
header: 
  seq: 1
  stamp: 
    secs: 1549359364
    nsecs: 214800952
  frame_id: ''
axes: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---

Videos

joystick_example

back to example list


obstacle_avoidance_example

This is an example to use rosservice to add dummy obstacles and to avoid the obstacles.

Launch nodes with the following command:

roslaunch crane_x7_examples obstacle_avoidance_example.launch

This example uses a service file including target posture of CRANE-X7 and size and posture of an obstacle.

These values can be edited in crane_x7_examples/scripts/obstacle_client.py.

The default obstacle shape is rectangular.

    # Define obstacle shape and pose
    obstacle_name = "box"
    obstacle_size = Vector3(0.28, 0.16, 0.14)
    obstacle_pose_stamped = PoseStamped()
    obstacle_pose_stamped.header.frame_id = "/base_link"
    obstacle_pose_stamped.pose.position.x = 0.35
    obstacle_pose_stamped.pose.position.z = obstacle_size.z/2.0

This example generates a dummy floor as an obstacle to move safely.

If this floor is unnecessary, please comment out some lines from crane_x7_examples/scripts/obstacle_avoidance_example.py.

    # Generate dummy floor
    floor_name = "floor"
    floor_size = (2.0, 2.0, 0.01)
    floor_pose = PoseStamped()
    floor_pose.header.frame_id = "/base_link"
    floor_pose.pose.position.z = -floor_size[2]/2.0
    scene.add_box(floor_name, floor_pose, floor_size)
    rospy.sleep(SLEEP_TIME)

If MoveIt did not generate trajectory to avoid an obstacle, CRANE-X7 will not move, the example server will return value result=False, then MoveIt will calculate a trajectory to next target position.

back to example list


servo_info_example

This is an example to subscribe the servo motor status.

Run a node with the following command:

rosrun crane_x7_examples servo_info_example.py

This example subscribes topics of gripper joint crane_x7_gripper_finger_a_joint and displays the servo motor current, position and temperature to a terminal.

 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 2.69    dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 2.69    dxl_position: 2634    temp [deg C]: 42.0
 ...

If the motor current exceed thresholds, the gripper will open/close. This function enables user to open/close the gripper by hand.

Please refere crane_x7_control/README.md for details of the topics.

back to example list


pick_and_place_in_gazebo_example

This is an example to grasp, pick up, carry and place an small object on Gazebo environments.

Launch nodes with the following command with arguments to control the gripper by EffortController.

roslaunch crane_x7_gazebo crane_x7_with_table.launch use_effort_gripper:=true

After Gazebo launch, run a node with the following command:

rosrun crane_x7_examples pick_and_place_in_gazebo_example.py

Videos

pick_and_place_in_gazebo

back to example list

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Messages

No message files found.

Plugins

No plugins found.

Recent questions tagged crane_x7_examples at answers.ros.org

No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 2.0.0
License Apache License 2.0
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/rt-net/crane_x7_ros.git
VCS Type git
VCS Version master
Last Updated 2023-02-21
Dev Status MAINTAINED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

examples of CRANE-X7 ROS package

Additional Links

No additional links.

Maintainers

  • RT Corporation

Authors

  • Daisuke Sato
  • Hiroyuki Nomura

English | 日本語

crane_x7_examples

This package includes examples to control CRANE-X7 using crane_x7_ros.

How to launch CRANE-X7 base packages

  1. Connect a communication cable from CRANE-X7 to a PC.
  2. Open terminal and launch demo.launch of crane_x7_bringup package.

This launch file has an argument to select CRANE-X7 or virtual CRANE-X7:

  • fake_execution (default: true)

Using virtual CRANE-X7

Launch virtual CRANE-X7 base packages with the following command:

roslaunch crane_x7_bringup demo.launch fake_execution:=true

Using real CRANE-X7

Launch the base packages with the following command:

roslaunch crane_x7_bringup demo.launch fake_execution:=false

Default serial port name is /dev/ttyUSB0. To change port name (e.g. /dev/ttyUSB1), launch the packages with arguments:

roslaunch crane_x7_bringup demo.launch fake_execution:=false port:=/dev/ttyUSB1

Using Gazebo simulator

Launch the packages with the following command:

roslaunch crane_x7_gazebo crane_x7_with_table.launch

Run Examples

Following examples will be executable after launch CRANE-X7 base packages.


gripper_action_example

This is an example to open/close the gripper.

Run a node with the following command:

rosrun crane_x7_examples gripper_action_example.py

back to example list


pose_groupstate_example

This is an example using group_state of SRDF.

CRANE-X7 changes its posture to home and vertical listed in SRDF file crane_x7_moveit_config/config/crane_x7.srdf.

Run a node with the following command:

rosrun crane_x7_examples pose_groupstate_example.py

back to example list


joint_values_example

This is an example to change each joint values of arm one by one using moveit_commander.

Run a node with the following command:

rosrun crane_x7_examples joint_values_example.py

back to example list


cartesian_path_example

This is an example to plan a circular path that the hand follows using moveit_commander and Cartesian Path.

Run a node with the following command:

rosrun crane_x7_examples cartesian_path_example.py

Videos

back to example list


crane_x7_pick_and_place_demo

This is an example to grasp, pick up, carry and place an small object.

Run a node with the following command:

rosrun crane_x7_examples crane_x7_pick_and_place_demo.py

Real environment setup

Place the small object at a distance of 20 cm from CRANE-X7.

This orange ball can be purchased at this page in RT ROBOT SHOP.

Videos

crane_x7_pick_and_place_demo

back to example list


preset_pid_gain_example

This is an example to change PID gains of servo motors in bulk using preset_reconfigure of crane_x7_control.

Lists of PID gain preset values can be edited in crane_x7_control/scripts/preset_reconfigure.py.

Launch nodes preset_reconfigure.py and preset_pid_gain_example.py with the following command:

roslaunch crane_x7_examples preset_pid_gain_example.launch

Videos

preset_pid_gain_example

back to example list


teaching_example

This is an example to generate an motion trajectory with direct teaching.

User can operate CRANE-X7 directly because the PID gains of servo motors will be small values.

Launch nodes with the following command:

roslaunch crane_x7_examples teaching_example.launch

Please see below for keyboard operation.

Teaching Mode

This is a mode at startup and the PID gains will be small values.

Key Function
s / S Save current posture
d / D Delete all posture data
m / M Transition to Action **Mode
q / Q Quit application

Action Mode

This is a mode transitioned from Teaching Mode and the PID gains will return to normal values.

Key Function
p / P Playback a posture data
a / A Playback all posture data consecutively
l / L Toggle loop playback (ON/OFF)
m / M Transition to Teaching **Mode
q / Q Quit application

Videos

teaching_example

back to example list


joystick_example

This is an example to use joystick controller to change the hand position and posture, or to open and close of the gripper, or to preset the PID gains or to generate a position trajectory with direct teaching.

Connect a joystick controller to a PC and check the device /dev/input/js0 existence then launch nodes with the following command:

for control CRANE-X7

roslaunch crane_x7_examples joystick_example.launch

for control virtual CRANE-X7

Please add an argument sim to avoid an error.

roslaunch crane_x7_examples joystick_example.launch sim:=true

Key configuration

This picture shows the default key configuration. The joystick controller is Logicool Wireless Gamepad F710.

Key assignments can be edited with key numbers in crane_x7_example/launch/joystick_example.launch.

 <node name="joystick_example" pkg="crane_x7_examples" type="joystick_example.py" required="true" output="screen">
    <param name="button_shutdown_1" value="8" type="int" />
    <param name="button_shutdown_2" value="9" type="int" />

    <param name="button_name_enable" value="7" type="int" />
    <param name="button_name_home"  value="8" type="int" />

    <param name="button_preset_enable" value="7" type="int" />
    <param name="button_preset_no1" value="9" type="int" />

This picture shows the default key numbers.

Please display /joy topic with the command rostopic echo /joy to check the default key numbers.

roslaunch crane_x7_examples joystick_example.launch sim:=true

# Enter the command in another terminal 
rostopic echo /joy

# Press buttons of a joystick controller
header: 
  seq: 1
  stamp: 
    secs: 1549359364
    nsecs: 214800952
  frame_id: ''
axes: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---

Videos

joystick_example

back to example list


obstacle_avoidance_example

This is an example to use rosservice to add dummy obstacles and to avoid the obstacles.

Launch nodes with the following command:

roslaunch crane_x7_examples obstacle_avoidance_example.launch

This example uses a service file including target posture of CRANE-X7 and size and posture of an obstacle.

These values can be edited in crane_x7_examples/scripts/obstacle_client.py.

The default obstacle shape is rectangular.

    # Define obstacle shape and pose
    obstacle_name = "box"
    obstacle_size = Vector3(0.28, 0.16, 0.14)
    obstacle_pose_stamped = PoseStamped()
    obstacle_pose_stamped.header.frame_id = "/base_link"
    obstacle_pose_stamped.pose.position.x = 0.35
    obstacle_pose_stamped.pose.position.z = obstacle_size.z/2.0

This example generates a dummy floor as an obstacle to move safely.

If this floor is unnecessary, please comment out some lines from crane_x7_examples/scripts/obstacle_avoidance_example.py.

    # Generate dummy floor
    floor_name = "floor"
    floor_size = (2.0, 2.0, 0.01)
    floor_pose = PoseStamped()
    floor_pose.header.frame_id = "/base_link"
    floor_pose.pose.position.z = -floor_size[2]/2.0
    scene.add_box(floor_name, floor_pose, floor_size)
    rospy.sleep(SLEEP_TIME)

If MoveIt did not generate trajectory to avoid an obstacle, CRANE-X7 will not move, the example server will return value result=False, then MoveIt will calculate a trajectory to next target position.

back to example list


servo_info_example

This is an example to subscribe the servo motor status.

Run a node with the following command:

rosrun crane_x7_examples servo_info_example.py

This example subscribes topics of gripper joint crane_x7_gripper_finger_a_joint and displays the servo motor current, position and temperature to a terminal.

 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 2.69    dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 0.0     dxl_position: 2634    temp [deg C]: 42.0  
 current [mA]: 2.69    dxl_position: 2634    temp [deg C]: 42.0
 ...

If the motor current exceed thresholds, the gripper will open/close. This function enables user to open/close the gripper by hand.

Please refere crane_x7_control/README.md for details of the topics.

back to example list


pick_and_place_in_gazebo_example

This is an example to grasp, pick up, carry and place an small object on Gazebo environments.

Launch nodes with the following command with arguments to control the gripper by EffortController.

roslaunch crane_x7_gazebo crane_x7_with_table.launch use_effort_gripper:=true

After Gazebo launch, run a node with the following command:

rosrun crane_x7_examples pick_and_place_in_gazebo_example.py

Videos

pick_and_place_in_gazebo

back to example list

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Messages

No message files found.

Plugins

No plugins found.

Recent questions tagged crane_x7_examples at answers.ros.org