I'm working with an Ackermann car-like robot. I have an issue with the tf in RVIZ because to make an Ackermann steering you have to make a virtual link due to ROS2 doesn't allow yet 2 dof in a joint. So I have two virtual cylinder for z axis move, inside the front wheels, and the front wheel link for the spin, y axis.

My robot works in Gazebo and move good but when I see the tf in RVIZ the front wheels links don't move but the the virtual cylinders do. I have seen the tf tree and is well done but I don't know why the front wheel tf don't work properly.

In the official supported page for Ackermann controller, section 1.3 says:

If you want rviz to show states of robot's actual joint interfaces' tf through joint_state_controller and robot_state_publisher, you need to convert the two interfaces of ackermann_steering_controller to your robot's specific ones via RobotHW or RobotHWSim (generally used for GAZEBO). This is because the controller only update it's basic interfaces mentioned in the previous section.

Does anyone know what is the RobotHW or RobotHWSim and how to use it in ROS2. I just want it for simulation purpose.

My view_frame here:

enter image description here


1 Answer 1


Be aware that the cited ackermann controller is for ROS 1, and not applicable to ROS 2.

You mean the TF tree is complete, i.e. there are no "white unconnected" boxes in rviz2?

I suggest introspect the joint_states topic. You have to add state interfaces to the ros2_control tag, so that the joint_states topic includes positions of every joint in the kinematic chain. But normally robot_state_publisher would not create a complete TF tree is something is missing..

  • $\begingroup$ Hi Christoph, I know the ackermann controller documentation is for ROS1. I can't find the official Ackermann documentation for ROS2. I just want to know if there's something else I need to add in this version other than from the controller itself. I have just updated the post explaining it is view_frame what I meant, not TF tree. Sorry for the confusion. In addition, I don't know what you mean with white unconnected boxes in rviz2. Could you explain it? thanks. $\endgroup$ Feb 11 at 17:04
  • $\begingroup$ You haven't written which type of controller you are using. This one(ros2_control) or this gazebo plugin? $\endgroup$ Feb 11 at 19:00
  • $\begingroup$ If you load a robot model into rviz, and the tf tree is not present or not complete you will see the links as white boxes in the middle of the origin. If this would be the case you would immediately know what I mean. $\endgroup$ Feb 11 at 19:00
  • $\begingroup$ have you had a look on the joint_states topic? $\endgroup$ Feb 11 at 19:01
  • 1
    $\begingroup$ If the position is always zero, then you have found why the robot_state_publisher can't update the TF tree. Now you have to check the settings of your gazebo plugins (for which I don't have any experience though). But maybe you want to share the relevant part of your URDF/SDF. $\endgroup$ Feb 14 at 9:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.