![]() |
crane_x7_examples package from crane_x7 repocrane_x7 crane_x7_control crane_x7_examples crane_x7_gazebo crane_x7_moveit_config |
|
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
Additional Links
Maintainers
- RT Corporation
Authors
- Shota Aoki
- Atsushi Kuwagata
crane_x7_examples
このパッケージはCRANE-X7 ROS 2パッケージのサンプルコード集です。
- crane_x7_examples
準備(実機を使う場合)
1. CRANE-X7本体をPCに接続する
CRANE-X7本体をPCに接続します。 接続方法は製品マニュアルを参照してください。
※CRANE-X7本体が接触しないように、十分なスペースを確保してください。
2. USB通信ポートの接続を確認する
USB通信ポートの設定についてはcrane_x7_control
の
README
を参照してください。
正しく設定できていない場合、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を使う場合)
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
pose_groupstate
group_stateを使うコード例です。
SRDFファイルcrane_x7_moveit_config/config/crane_x7.srdf
に記載されているhome
とvertical
の姿勢に移行します。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='pose_groupstate'
Videos
joint_values
アームのジョイント角度を1つずつ変更させるコード例です。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='joint_values'
Videos
cartesian_path
Cartesian Path を生成し、手先で円を描くコード例です。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='cartesian_path'
Videos
pick_and_place
モノを掴む・持ち上げる・運ぶ・置くコード例です。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='pick_and_place'
実機を使う場合
CRANE-X7から20cm離れた位置にピッキング対象を設置します。
サンプルで使用しているこのオレンジ色のソフトボールはRT ROBOT SHOPのこちらのページから入手することができます。
Videos
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_id
はtarget_0
になります。掴む対象はtarget_0
に設定されています。マーカ認識にはOpenCVを使用しています。
次のコマンドを実行します
ros2 launch crane_x7_examples camera_example.launch.py example:='aruco_detection'
Videos
point_cloud_detection
点群から物体位置を認識して掴むコード例です。
認識された物体位置はtfのフレームとして配信されます。
tfのframe_id
は認識された順にtarget_0
、target_1
、target_2
…に設定されます。掴む対象はtarget_0
に設定されています。
物体認識にはPoint Cloud Libraryを使用しています。
次のコマンドを実行します
ros2 launch crane_x7_examples camera_example.launch.py example:='point_cloud_detection'
Videos
Wiki Tutorials
Source Tutorials
Package Dependencies
Deps | Name | |
---|---|---|
1 | ament_cmake | |
1 | ament_lint_auto | |
1 | ament_lint_common | |
1 | angles | |
1 | crane_x7_control | |
0 | crane_x7_description | |
1 | crane_x7_moveit_config | |
3 | cv_bridge | |
2 | geometry_msgs | |
3 | moveit_ros_planning_interface | |
1 | pcl_ros | |
1 | rclcpp | |
0 | realsense2_camera | |
3 | tf2_geometry_msgs |
System Dependencies
Name |
---|
libopencv-dev |
Dependant Packages
Name | Repo | Deps |
---|---|---|
crane_x7 | github-rt-net-crane_x7_ros |
Launch files
Messages
Services
Plugins
Recent questions tagged crane_x7_examples at answers.ros.org
![]() |
crane_x7_examples package from crane_x7 repocrane_x7 crane_x7_control crane_x7_examples crane_x7_gazebo crane_x7_moveit_config |
|
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
Additional Links
Maintainers
- RT Corporation
Authors
- Shota Aoki
- Atsushi Kuwagata
crane_x7_examples
このパッケージはCRANE-X7 ROS 2パッケージのサンプルコード集です。
-
crane_x7_examples
- 準備(実機を使う場合)
- 1. CRANE-X7本体をPCに接続する
- 2. USB通信ポートの接続を確認する
- 3. move_groupとcontrollerを起動する
- 準備 (Gazeboを使う場合)
- 1. move_groupとGazeboを起動する
- サンプルプログラムを実行する
- Gazeboでサンプルプログラムを実行する場合
- Examples
- gripper_control
- pose_groupstate
- joint_values
- cartesian_path
- pick_and_place
- Camera Examples
- aruco_detection
- point_cloud_detection
準備(実機を使う場合)
1. CRANE-X7本体をPCに接続する
CRANE-X7本体をPCに接続します。 接続方法は製品マニュアルを参照してください。
※CRANE-X7本体が接触しないように、十分なスペースを確保してください。
2. USB通信ポートの接続を確認する
USB通信ポートの設定についてはcrane_x7_control
の
README
を参照してください。
正しく設定できていない場合、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を使う場合)
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
pose_groupstate
group_stateを使うコード例です。
SRDFファイルcrane_x7_moveit_config/config/crane_x7.srdf
に記載されているhome
とvertical
の姿勢に移行します。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='pose_groupstate'
Videos
joint_values
アームのジョイント角度を1つずつ変更させるコード例です。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='joint_values'
Videos
cartesian_path
Cartesian Path を生成し、手先で円を描くコード例です。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='cartesian_path'
Videos
pick_and_place
モノを掴む・持ち上げる・運ぶ・置くコード例です。
次のコマンドを実行します。
ros2 launch crane_x7_examples example.launch.py example:='pick_and_place'
実機を使う場合
CRANE-X7から20cm離れた位置にピッキング対象を設置します。
サンプルで使用しているこのオレンジ色のソフトボールはRT ROBOT SHOPのこちらのページから入手することができます。
Videos
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_id
はtarget_0
になります。掴む対象はtarget_0
に設定されています。マーカ認識にはOpenCVを使用しています。
次のコマンドを実行します
ros2 launch crane_x7_examples camera_example.launch.py example:='aruco_detection'
Videos
point_cloud_detection
点群から物体位置を認識して掴むコード例です。
認識された物体位置はtfのフレームとして配信されます。
tfのframe_id
は認識された順にtarget_0
、target_1
、target_2
…に設定されます。掴む対象はtarget_0
に設定されています。
物体認識にはPoint Cloud Libraryを使用しています。
次のコマンドを実行します
ros2 launch crane_x7_examples camera_example.launch.py example:='point_cloud_detection'
Videos
Wiki Tutorials
Source Tutorials
Package Dependencies
Deps | Name | |
---|---|---|
1 | ament_cmake | |
1 | ament_lint_auto | |
1 | ament_lint_common | |
1 | angles | |
1 | crane_x7_control | |
0 | crane_x7_description | |
1 | crane_x7_moveit_config | |
3 | cv_bridge | |
2 | geometry_msgs | |
3 | moveit_ros_planning_interface | |
1 | pcl_ros | |
1 | rclcpp | |
0 | realsense2_camera | |
3 | tf2_geometry_msgs |
System Dependencies
Name |
---|
libopencv-dev |
Dependant Packages
Name | Repo | Deps |
---|---|---|
crane_x7 | github-rt-net-crane_x7_ros |
Launch files
Messages
Services
Plugins
Recent questions tagged crane_x7_examples at answers.ros.org
![]() |
crane_x7_examples package from crane_x7 repocrane_x7 crane_x7_bringup crane_x7_control crane_x7_examples crane_x7_gazebo crane_x7_moveit_config crane_x7_msgs |
|
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
Additional Links
Maintainers
- RT Corporation
Authors
- Daisuke Sato
- Hiroyuki Nomura
crane_x7_examples
This package includes examples to control CRANE-X7 using crane_x7_ros
.
How to launch CRANE-X7 base packages
- Connect a communication cable from CRANE-X7 to a PC.
- Open terminal and launch
demo.launch
ofcrane_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
- pose_groupstate_example
- joint_values_example
- cartesian_path_example
- crane_x7_pick_and_place_demo
- preset_pid_gain_example
- teaching_example
- joystick_example
- obstacle_avoidance_example
- servo_info_example
- pick_and_place_in_gazebo_example
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
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
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
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
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
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
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
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
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.
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.
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
Wiki Tutorials
Source Tutorials
Package Dependencies
Deps | Name | |
---|---|---|
1 | crane_x7_moveit_config | |
2 | std_msgs | |
2 | geometry_msgs | |
1 | message_generation | |
1 | catkin | |
3 | moveit_commander | |
1 | message_runtime | |
2 | joy |
System Dependencies
Dependant Packages
Name | Repo | Deps |
---|---|---|
crane_x7 | github-rt-net-crane_x7_ros |
Launch files
- launch/obstacle_avoidance_example.launch
- launch/teaching_example.launch
- launch/preset_pid_gain_example.launch
- launch/joystick_example.launch
-
- joydev [default: /dev/input/js0]
- sim [default: false]
Messages
Services
Plugins
Recent questions tagged crane_x7_examples at answers.ros.org
![]() |
crane_x7_examples package from crane_x7 repocrane_x7 crane_x7_bringup crane_x7_control crane_x7_examples crane_x7_gazebo crane_x7_moveit_config crane_x7_msgs |
|
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
Additional Links
Maintainers
- RT Corporation
Authors
- Daisuke Sato
- Hiroyuki Nomura
crane_x7_examples
This package includes examples to control CRANE-X7 using crane_x7_ros
.
How to launch CRANE-X7 base packages
- Connect a communication cable from CRANE-X7 to a PC.
- Open terminal and launch
demo.launch
ofcrane_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
- pose_groupstate_example
- joint_values_example
- cartesian_path_example
- crane_x7_pick_and_place_demo
- preset_pid_gain_example
- teaching_example
- joystick_example
- obstacle_avoidance_example
- servo_info_example
- pick_and_place_in_gazebo_example
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
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
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
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
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
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
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
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
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.
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.
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
Wiki Tutorials
Source Tutorials
Package Dependencies
Deps | Name | |
---|---|---|
1 | crane_x7_moveit_config | |
2 | std_msgs | |
2 | geometry_msgs | |
1 | message_generation | |
1 | catkin | |
3 | moveit_commander | |
1 | message_runtime | |
2 | joy |
System Dependencies
Dependant Packages
Name | Repo | Deps |
---|---|---|
crane_x7 | github-rt-net-crane_x7_ros |
Launch files
- launch/obstacle_avoidance_example.launch
- launch/teaching_example.launch
- launch/preset_pid_gain_example.launch
- launch/joystick_example.launch
-
- joydev [default: /dev/input/js0]
- sim [default: false]
Messages
Services
Plugins
Recent questions tagged crane_x7_examples at answers.ros.org
![]() |
crane_x7_examples package from crane_x7 repocrane_x7 crane_x7_bringup crane_x7_control crane_x7_examples crane_x7_gazebo crane_x7_moveit_config crane_x7_msgs |
|
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
Additional Links
Maintainers
- RT Corporation
Authors
- Daisuke Sato
- Hiroyuki Nomura
crane_x7_examples
This package includes examples to control CRANE-X7 using crane_x7_ros
.
How to launch CRANE-X7 base packages
- Connect a communication cable from CRANE-X7 to a PC.
- Open terminal and launch
demo.launch
ofcrane_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
- pose_groupstate_example
- joint_values_example
- cartesian_path_example
- crane_x7_pick_and_place_demo
- preset_pid_gain_example
- teaching_example
- joystick_example
- obstacle_avoidance_example
- servo_info_example
- pick_and_place_in_gazebo_example
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
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
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
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
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
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
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
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
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.
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.
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
Wiki Tutorials
Source Tutorials
Package Dependencies
Deps | Name | |
---|---|---|
1 | crane_x7_moveit_config | |
2 | std_msgs | |
2 | geometry_msgs | |
1 | message_generation | |
1 | catkin | |
3 | moveit_commander | |
1 | message_runtime | |
2 | joy |
System Dependencies
Dependant Packages
Name | Repo | Deps |
---|---|---|
crane_x7 | github-rt-net-crane_x7_ros |
Launch files
- launch/obstacle_avoidance_example.launch
- launch/teaching_example.launch
- launch/preset_pid_gain_example.launch
- launch/joystick_example.launch
-
- joydev [default: /dev/input/js0]
- sim [default: false]