ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Nav2 odometry for Ackermann plugin

asked 2023-03-28 16:12:42 -0600

Vini71 gravatar image

updated 2023-03-28 16:16:01 -0600

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

edit retag flag offensive close merge delete


This doesn't seem directly related to Nav2, but instead your control / simulation plugins. You might want to change the question's name.

stevemacenski gravatar image stevemacenski  ( 2023-03-30 10:16:09 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-04-03 00:08:35 -0600

Vini71 gravatar image

updated 2023-04-03 00:09:15 -0600

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 <gazebo> tags before the plugin declaration. By correcting the joint names and properly including the <gazebo> tags, the truck now moves as expected using the Ackermann plugin

The fixed snippet of code:


    <plugin name="gazebo_ros_ackermann_drive" filename="">
        <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:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2023-03-28 16:12:42 -0600

Seen: 134 times

Last updated: Apr 03