A123S / ua-ros-pkg

Automatically exported from code.google.com/p/ua-ros-pkg
0 stars 0 forks source link

Fix frame_ids in DiffDrivePlugin (erratic_gazebo_plugins) are problematic in multi-robot simulations #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

when I try to simulate more than one robot using the DiffDrivePlugin there 
arise problems with tf. The plugin is publishing the tf Transform "/odom" -> 
"/base_footprint" for all robots in the simulation. As far as I can see, there 
is no opportunity to set a kind of tf prefix to send e.g. the transforms 
"/robot1/odom" -> "/robot1/base_footprint" and "/robot2/odom" -> 
"/robot2/base_footprint"

This is because of the fix frame_ids set in the function 
DiffDrivePlugin::publish_odometry() in lines 319-322.

There is a similar problem with the odom message (sent in the same function).

As a workaround, I added a parameter "tfPrefix" and I use the corresponding 
variable "my_tf_prefix_" when sending the transform:

transform_broadcaster_->sendTransform(tf::StampedTransform(base_footprint_to_odo
m,                                                            current_time_,    

tf::resolve(my_tf_prefix_, "odom"),                                             
               tf::resolve(my_tf_prefix_, "base_footprint")));

Any other suggestions for better solution?

Regards,
Sabrina

Original issue reported on code.google.com by s...@innok.de on 10 Nov 2011 at 9:07

GoogleCodeExporter commented 8 years ago
Sabrina, I think I fixed it. Can you check out the latest version of 
erratic_robot stack and test it out? I added example launch files on how to 
launch two erratics in the same world, just run "roslaunch erratic_description 
two_erratics_empty_world.launch". Let me know if that works.

Original comment by areb...@gmail.com on 10 Nov 2011 at 7:36

GoogleCodeExporter commented 8 years ago
Hi, yes it works great now. Thank you!

Original comment by s...@innok.de on 11 Nov 2011 at 9:10

GoogleCodeExporter commented 8 years ago

Original comment by areb...@gmail.com on 11 Nov 2011 at 2:37