Package Summary

Tags No category tags.
Version 0.0.0
License BSD
Build type CATKIN

Repository Summary

Checkout URI
VCS Type git
VCS Version master
Last Updated 2020-11-25
CI status No Continuous Integration
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

The examples package

Additional Links

No additional links.


  • Jason Peng


No additional authors.

1. multi_xarm5 (controlled separately)

This package might give you a hint about how to launch and control two or more xArms (same model), while avoiding name clashes. Here xArm5 is used as an example, you can edit the launch files to control xarm6 or xarm7.

(1) For a simulation, run:

$ roslaunch examples two_sim_xarm5.launch ns:=/uf

As an example, this command will bring up 2 xArm5 simulation models in 2 separate Moveit-RViz application windows. You can see in 'rqt_graph' that they come with 2 namespaces, one is '/uf' and the other is '/uf_2', and they can be controlled independently.

(2) Or if two real xArm5 are available, try:

$ roslaunch examples two_real_xarm5.launch ns_1:=/left robot_ip_1:= ns_2:=/right robot_ip_2:=

The IP addresses are just for examples here, if properly launched, you can control 2 real xarm5 in two separate Moveit-RViz windows independently.

2. Servo_Cartesian (streamed Cartesian trajectory)

PLEASE NOTE: If you are already using Moveit to control the real robot arm, move_servoj and move_servo_cart can not be used concurrently, since they use the same mode(1) to control and may interfere with each other!

Now with xArm controller Firmware Version >= 1.4.1, user can send streamed Cartesian poses to continuously control the xArm, through ros service, this is a wrap of the same xarm sdk(api) function. The actual speed depends on the sending frequency and step distance. Users are encouraged to send the path points in a fixed frequency(20Hz~100Hz) and step distance(MUST <10mm).
(1) To start, bring up the xarm server. [use xArm 7 as example]

$  roslaunch xarm_bringup xarm7_server.launch robot_ip:=

(2) In another terminal, do initial configurations, servo cartesian has to operate in Mode 1:

$ rosservice call /xarm/motion_ctrl 8 1
$ rosservice call /xarm/set_mode 1
$ rosservice call /xarm/set_state 0

(3) Call the servo_cartesian service. Please note:
(1) the Cartesian pose representation is the same with xarm SDK here. which is [X(mm), Y(mm), Z(mm), Roll(rad), Pitch(rad), Yaw(rad)]
(2) the path must start from current tool center point(TCP) position and the command can not be too far away, or the execution will fail or act strange. PLEASE CHECK the correctness of command before sending it.
(3) service argument format is like: "pose: [214, 0, 121, 3.1416, 0, 0] mvvelo: 0.0 mvacc: 0.0 mvtime: 0.0 mvradii: 0.0"
(4) For Base Coordinate motion, the arguments mvvelo, mvacc, mvtime, and mvradii are not effective now, so just give them all 0.

Suppose current TCP position is at [206, 0, 121, 3.1416, 0, 0]

$ rosservice call /xarm/move_servo_cart [210,0,121,3.1416,0,0] 0.0 0.0 0.0 0.0

Now please check the current TCP position, it will execute this target immediately if success. If you want continuous motion alone X axis, you can give the following pose like:

$ rosservice call /xarm/move_servo_cart [214,0,121,3.1416,0,0] 0.0 0.0 0.0 0.0

And you can program this service calling procedure in a loop with proper intervals inbetween, the final execution will become smooth.

Notice: Servo_cartisian in TOOL coordinate: Please update the controller Firmware to version >= 1.5.0. If servo_cartesian in Tool Coordinate is needed, put 1 to the previous "mvtime" argument, the resulted motion will base on current Tool coordinate. For example:

$ rosservice call /xarm/move_servo_cart [0,0,2,0,0,0] 0.0 0.0 1 0.0

This will make tool to move 2 mm immediately along +Z Axis in TOOL Coordinate.
There is also example code implementing continuous servo_cartesian() in tool coordinate: c++ version and python version.

3. Servo_Joint (streamed joint-space trajectory)

There is also a similar service called "/xarm/move_servoj", you can use this service to control joint motion in the same mode (1) with Servo_Cartesian. It receives absolute joint positions as command. Before calling it, please check the current joint position in "/xarm/joint_states" topic, and increase the target joint position little by little just like calling /xarm/move_servo_cart.

For example, if /xarm/joint_state says current joint positions are: [0.25,-0.47,0.0,-0.28,0.0,0.76,0.24], you can call:

$ rosservice call /xarm/move_servoj [0.25,-0.47,0.0,-0.28,0.0,0.76,0.25] 0.0 0.0 0.0 0.0

Which will move joint7 by 0.01 rad immediately. Keep calling it and increase the joint positions a small step each time, it will move smoothly. Be careful not to give a target too far away in one single update.

4. Dual xArm6 controlled with one moveGroup node:

Unlike example 1, This example will bring up only one Rviz and move_group node to control 2 xArm6 arms, which can be used for a dual-arm application.
To launch the application, run the following with your correct xArm controller IP addresses:

$ roslaunch dual_xarm6_moveit_config realMove_exec.launch

DUAL_CONFIG If successfully launched, you will see two xArm6 separated by 1 meter, their relative position to each other can be re-configured in /xarm_description/urdf/dual_xarm6_robot.urdf.xacro, just edit the "xyz" and "rpy" values. You may also add your base to hold the two arms.

For example, to make the two arms stand face-to-face:

  1. After Modification to the correct configuration, please run moveit_setup_assistant again to update the collision matrix.
$ roslaunch moveit_setup_assistant setup_assistant.launch 

  1. Click "Edit Existing Moveit Configuration Package" and browse to navigate to the location of "dual_xarm6_moveit_config" package:

  2. Then click "Load Files". You can see the robot location has already been changed face-to-face.

  3. Go to first tag "Self-Collisions" and click on "Generate Collision Matrix" to update the Self-collision information.

  4. Then Skip the rest and go straight to the last tag "Configuration files", since other settings are already taken care of and can not be over-written. Watch out for the choices! ONLY leave the "config/","config/xarm6.srdf", "launch/" and ".setup_assistant" checked, and others unchecked! Such that only the collision matrix will be updated this time. If other files checked and overwritten by setup assistant, driving of the real arms may be affected. SETUP4

  5. Make sure the above step is correct and click "Generate Package" and "OK" if asked for confirmation. Then the reconfiguration of your own dual-arm is done. SETUP5

  6. You can first check in simulation by:

$ roslaunch dual_xarm6_moveit_config demo.launch


  1. If everything looks OK, you can move on to control the real dual-arm:
$ roslaunch dual_xarm6_moveit_config realMove_exec.launch


Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Package Dependencies

Deps Name
1 catkin

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files


No message files found.


No service files found


No plugins found.

Recent questions tagged examples at