Joint order in JointGroupVelocityController 'command' topic
I'm working now with UR5. When I echo the states of joints I get this
galf@galf:~/Desktop/ur5/catkin_ws$ rostopic echo /ur5/joint_states -n1
header:
seq: 9465
stamp:
secs: 94
nsecs: 662000000
frame_id: ''
name: [elbow_joint, shoulder_lift_joint, shoulder_pan_joint, wrist_1_joint, wrist_2_joint,
wrist_3_joint]
position: [-3.1415916305807485, 0.30983008014827096, 1.9488655889645834, 3.1415983918040062, 1.845209559572325, -3.141592812638949]
velocity: [3.621569639258467e-06, -9.772236883207112e-06, 0.00011501897260136615, -2.0719156311055294e-07, 0.06444979561546602, -6.340667138213241e-08]
effort: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
Are the positions match the joints in the same order as they appear in the names? I'm asking this because when I retrieve the info for the command topic, I get
galf@galf:~/Desktop/ur5/catkin_ws$ rostopic pub /ur5/joints_group_velocity_controller/command std_msgs/Float64MultiArray "layout:
dim:
- label: ''
size: 0
stride: 0
data_offset: 0
data:
- 0"
So to command the joints, I need fill out data as data: [0,0,0,0,0,0]
but I don't know the order of joints. How this works in ROS? Does data[0] represent elbow_joint
?
The tree appears as shoulder_pan_joint > shoulder_lift_joint > elbow_joint > wrist_1_joint > wrist_2_joint > wrist_3_joint
. I don't know why ROS puts them in alphabetical order.
I've updated the title to better reflect your question. "topic command" is too ambiguous.