I am in the process of developing a custom two-wheeled mobile robot with differential control, and I want to integrate it with the ROS 2 ecosystem, specifically leveraging ros2_control. I understand that ros2_control provides a framework to connect any hardware to ROS 2, but I am having some challenges with where and how to start for specific/custom robot configuration.

Robot Details:

  • Two drive wheels with individual motor controllers.
  • The robot uses differential control for maneuvering.
  • Velocity control mechanism for each wheel.
  • Encoders on each wheel for feedback.


  1. What are the fundamental steps to create a custom hardware interface for a differential-controlled robot to use with ros2_control?

  2. How can I expose the readings from the wheel encoders to the joint_states topic within the ROS 2 ecosystem?

I've already gone through the official ros2_control documentation, and understood that I need to use ros2_control tags in my robot's URDF to set up the hardware interfaces and that I need to write YAML file to configure controllers. I'd greatly appreciate insights or experiences from those who have tackled the creation of the hardware interface, especially in the context of wheeled robots and encoder data integration.

Thank you in advance for your guidance!


1 Answer 1


Have a look at the diff_drive example, this should answer question 2.

About how to write a hardware_component this video could help you with the first steps, or have a look at this step-by-step guide.


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.