Open tcassell94 opened 7 years ago
Thanks for the comment. Would you mind please sending a pull request with the code change?
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.
So as I understand it, the current behaviour is:
<publishTf>
nav_msgs::Odometry
on /odom
and publish itpublishOdomTf
are true, send base-to-world transforms<publishWheelTF>
<publishOdomTF>
publishTf
are true, send base-to-world transformsMy plan while migrating to ROS 2 is to clean this up as follows:
<publish_odom>
nav_msgs::Odometry
on /odom
and publish it<publish_wheel_tf>
<publish_odom_tf>
Please speak up if you see a problem with this.
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.