ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
774 stars 772 forks source link

gazebo_plugins: diff_drive plugin transform coupled to odom publishing #589

Open tcassell94 opened 7 years ago

tcassell94 commented 7 years ago

The source code for the gazebo_ros_diff_drive.cpp shows that it is impossible to publish an odometry message without also publishing a transform. There are two related parameters that are defined in the XML plugin specification: publishTf and publishWheelTF. The publishTf parameter is meant to allow odom topic publishing whilst the publishWheelTF parameter is meant to allow transform sending. However, the function that sends the odom topic message also sends a transform, irrespective of the value of publishWheelTF. If both parameters are true, twice as many transforms are sent. The fix is simple: remove lines 458 - 461 and the parameters will work as designed.

j-rivero commented 7 years ago

Thanks for the comment. Would you mind please sending a pull request with the code change?

bhazza commented 7 years ago

I think I disagree with OP - the publishTf parameter is not meant to publish odom topic, it is meant to publish the world/odom pose transform, i.e. the current behaviour. The publishWheelTF parameters publishes a wheel transform, which is not the same.

On a related issue - and the one that lead me to this post - setting publishTf to false also stops the odometry from being published, which I don't think is the intended behaviour.

chapulina commented 6 years ago

So as I understand it, the current behaviour is:

My plan while migrating to ROS 2 is to clean this up as follows:

Please speak up if you see a problem with this.