Rosanswers logo

Hi I am following this tutorial to set the odom to my truck_robot xacro

Unfortunately, I was not able to see the \odom or \demo_odom topic published in my terminal. After issue "ros2 topic list" I just get:


I am unsure if the libgazebo_ros_ackermann_drive I used is still unavailable to ROS2 (I think this might not be the issue).

For the simple wheeled robot configured in the tutorial, the odom was published (it used the differential plugin instead).

Can someone figure out the issue and assist me in getting the odometry topic published? My xacro is correct and opened on rviz and the gazebo. My launch_file

Originally posted by Vini71 on ROS Answers with karma: 266 on 2023-03-28

Post score: 1

Original comments

Comment by stevemacenski on 2023-03-30:
This doesn't seem directly related to Nav2, but instead your control / simulation plugins. You might want to change the question's name.


2 Answers 2


Rosanswers logo

I've resolved the issue, and it turned out to be simpler than I initially thought. The problem was due to incorrect joint name nomenclature and not calling the tags before the plugin declaration. By correcting the joint names and properly including the tags, the truck now moves as expected using the Ackermann plugin

The fixed snippet of code:


    <plugin name="gazebo_ros_ackermann_drive" filename="libgazebo_ros_ackermann_drive.so">
        <parameter name="cmd_vel_topic" value="cmd_demo"/>
        <parameter name="odom_topic" value="odom_demo"/>
        <parameter name="distance_topic" value="distance_demo"/>


      <!-- wheels -->

      <!-- steering joints -->

      <!-- Other parameters remain the same -->

      <!-- PID tuning -->
      <left_steering_pid_gain>1500 0 1</left_steering_pid_gain>
      <left_steering_i_range>0 0</left_steering_i_range>
      <right_steering_pid_gain>1500 0 1</right_steering_pid_gain>
      <right_steering_i_range>0 0</right_steering_i_range>
      <linear_velocity_pid_gain>1000 0 1</linear_velocity_pid_gain>
      <linear_velocity_i_range>0 0</linear_velocity_i_range>

      <!-- output -->


image description

The result: https://youtu.be/Wf3rhqRSTKw

Originally posted by Vini71 with karma: 266 on 2023-04-03

This answer was ACCEPTED on the original site

Post score: 2


Thank you for this well-explained example.

I've tried your code though, and it all worked except for the ackermann plugin.

When i compare it with the libgazebo_ros_ackermann_drive documentation

it seems like your code is missing the


Do you know which joint in your shared urdf that might be?

Or, if anyone know which joint is the "steering joint" in general that would be great.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.