How does Gazebo build sensor_msgs/Joint_State messages?

asked 2017-01-02 06:42:31 -0600

Lyndwyrm gravatar image

Hi,

I'm currently trying to figure out how to handle multiple robots in Gazebo and I ran into this bug(?):

header: 
  seq: 12209
  stamp: 
    secs: 330
    nsecs: 109000000
  frame_id: ''
name: ['kuka_lwr_joint_1', 'kuka_lwr_joint_2', 'kuka_lwr_joint_3', 'kuka_lwr_joint_4', 'kuka_lwr_joint_5', 'kuka_lwr_joint_6', 'kuka_lwr_joint_7', 'omnirob_base_joint_theta', 'omnirob_base_joint_x', 'omnirob_base_joint_y', 'powercube_joint_pan', 'powercube_joint_tilt', 'schunk_pg70_joint_left_jaw', 'schunk_pg70_joint_right_jaw']

position: [-1.0253947033689315e-05, 2.3522499048134193e-05, -2.2689813867771136e-05, 2.3136640944443343e-05, -1.0738741315741152e-05, -2.483711961254187e-05, -5.4067762246035045e-05, -5.224777055445884e-09, -2.7112045384056236e-12, 1.0643540367097492e-13, 8.826312682153059e-05, 7.902852640739866e-06, -2.807751732313897e-09, 4.075292461219283e-09]

velocity: [-4.178236861677637e-06, 0.0033800355546081623, 0.0001795040668656702, -0.0010695986716272555, -3.479691430856919e-05, -0.0013532377287914495, 1.842815311281211e-05, 5.6265612727336565e-06, 9.567045326563722e-08, -2.767842212481839e-08, 7.332785746463743e-05, 0.004272763884220085, 2.2936775146593057e-05, -2.2746741801888933e-05]

effort: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
header: 
  seq: 2452
  stamp: 
    secs: 330
    nsecs: 121000000
  frame_id: ''
name: ['omnirob_base_joint_x', 'omnirob_base_joint_y', 'omnirob_base_joint_theta', 'kuka_lwr_joint_1', 'kuka_lwr_joint_2', 'kuka_lwr_joint_3', 'kuka_lwr_joint_4', 'kuka_lwr_joint_5', 'kuka_lwr_joint_6', 'kuka_lwr_joint_7', 'schunk_pg70_joint_right_jaw', 'schunk_pg70_joint_left_jaw', 'powercube_joint_pan', 'powercube_joint_tilt']
position: []
velocity: []
effort: []

This first message is composed by Gazebo, the second by the joint_state_publisher. Now if I run my simulation for the single robot setup(which does not include support for ROS_NAMESPACE), the messages look like this:

header: 
  seq: 1
  stamp: 
    secs: 205
    nsecs: 728000000
  frame_id: ''
name: ['omnirob_base_joint_x', 'omnirob_base_joint_y', 'omnirob_base_joint_theta', 'kuka_lwr_joint_1', 'kuka_lwr_joint_2', 'kuka_lwr_joint_3', 'kuka_lwr_joint_4', 'kuka_lwr_joint_5', 'kuka_lwr_joint_6', 'kuka_lwr_joint_7', 'schunk_pg70_joint_right_jaw', 'schunk_pg70_joint_left_jaw', 'powercube_joint_pan', 'powercube_joint_tilt']
position: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
velocity: []
effort: []
---
header: 
  seq: 2
  stamp: 
    secs: 205
    nsecs: 828000000
  frame_id: ''
name: ['omnirob_base_joint_x', 'omnirob_base_joint_y', 'omnirob_base_joint_theta', 'kuka_lwr_joint_1', 'kuka_lwr_joint_2', 'kuka_lwr_joint_3', 'kuka_lwr_joint_4', 'kuka_lwr_joint_5', 'kuka_lwr_joint_6', 'kuka_lwr_joint_7', 'schunk_pg70_joint_right_jaw', 'schunk_pg70_joint_left_jaw', 'powercube_joint_pan', 'powercube_joint_tilt']
position: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
velocity: []
effort: []

As you can see the difference between those message is the order of the joints and the missing positions in the message from the joint_state_publisher.

Gazebo itself is started outside the namespace.

Why does Gazebo change the order of the names when I export a ROS_NAMESPACE? And does this affect the joint_state_publisher?

edit retag flag offensive close merge delete