ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

What are the steps to implement a real robot in ROS2

asked 2022-04-20 12:08:47 -0600

niklongstone gravatar image

I am building a 4 wheels robot with a camera, an IMU and a Lidar sensor. I've got only URDF and launch files working and correctly implemented for Rviz and Gazebo.

The URDF has the following plugins:

  • libgazebo_ros_skid_steer_drive (topic /cmd_vel)
  • libgazebo_ros_ray_sensor (topic /scan)
  • libgazebo_ros_camera (topic /camera/image_raw and /camera/points)
  • libgazebo_ros_imu_sensor (topic /imu)

On the topic side I've got others and those main ones /tf /tf_static and /joint_states

I am about to wire all the hardware in order to complete the real robot. I need some help to validate the steps needed to implement the real robot.

  1. Install ros_control
  2. Create a controller package
  3. Create hardware interface for the 4 wheels. I guess I need to publish position and velocity not sure where or maybe create a driver interface to subscribe to data in order to move the wheels
  4. Create hardware interface for the camera and publish the data on image_raw and point
  5. Create hardware interface for the lidar and publish data to /scan (not sure if pointcloud is needed)
  6. Create hardware interface for the imu and publish the data to /imu
  7. Optionally configure nav2 not sure how (help appreciated)
  8. Create an action for specific task as follow a line using camera (any sample code will be useful)

Any help or resource link will be appreciated. Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-04-21 11:50:41 -0600

ljaniec gravatar image

updated 2022-04-21 16:31:42 -0600

That's a lot of questions with unknowns. I suggest you start working through your project step by step, asking separate questions for each new problem - that way you will get better/more specific answers, faster. I will give you some links to start with.

I think you can search tips on these site:, especially for ros2_control and ros2_controllers.

This blog possibly has answers to a few of your questions: (especially Nav2 setup, configuration - much information can be found in the documentation there:

edit flag offensive delete link more


The question is really one, what are the steps to follow. Is my list accurate? I've already saw those link and haven't find anything complete. Do you have any other direction or suggestion?

niklongstone gravatar image niklongstone  ( 2022-04-22 10:00:49 -0600 )edit

Well, for building YOUR robot there won't be an exact, complete recipe :^) But I think Linorobot2 is an open-source robot (HW+SW) that might could be a good checkup list for you: and

Some remarks to your points:

  • Ad 3. + 4. + 5. I think you can use microROS and PWM controllers as in the repositorty linorobot2_hardware. You should read more about the ros2_controllersto check if you really have to implement everything ( - "Commonly used and generalized controllers for ros2-control framework that are ready to use with many robots"). Try not to reinvent the wheel.

  • Ad 7. + 8. If you want to use Nav2 you can teach yourself how to implement planners/behavior plugins. Sample code is in Nav2 repository and on I strongly suggest that you the use default ones first.

ljaniec gravatar image ljaniec  ( 2022-04-22 11:34:10 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2022-04-20 12:08:47 -0600

Seen: 134 times

Last updated: Apr 21 '22