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

Revision history [back]

click to hide/show revision 1
initial version

Hi @ridwan,

The answer for your question is a bit long.

What you want is to generate a custom robot_description that can be used in the Gazebo simulator. For this you will need to start learning about what a robot_description is and how to generate one that can be used in simulation. For this first step you can start learning about the URDF, "Unified Robot Description Format" that is basically a specific format to describe how your robot looks like. With respect this topic, you should know that Gazebo works with its own description format, that is SDF and that the URDF can be translatable to the native Gazebo format. With the URDF you will be able to genereate all the links corresponding to your robot body and all the joints that will help you to control it and define how each link is joined and behaves. There is a nice tutorial about using URDF in Gazebo here and a huge set of ROS tutorials that works on this here.

Furthermore, when dealing with URDF you will realise that there is too much code and your description can be a mess, for this issue, ROS has a handy XML format named Xacro that allows you to generate a URDF description from a set of macros. For instance, if you have four wheels, instead of using 4 URDF wheels descriptors, you can use only one Xacro macro defining a wheel and instantiate 4 times the wheel to keep the code clean and organized. There is another nice tutorial about this topic here.

Once you have your robot_description you will need to decide how to control your simulated robot. There are several approachs, here I comment two:

  1. You can use a Model plugin. Since you mentioned your robot has 4 wheels, you can implement your own plugin with the proper kinematics or use the Skid Steering Drive plugin from Gazebo that is already implemented.
  2. Another approach is based on using ROS control. For which you will need to set up proper transmissions and PID gains for effort/speed/position controllers. You can check this tutorial about Gazebo interactions with ROS control here.

So there you have it, hope this can help you with your tasks.

Regards.