Ask Your Question


asked 2020-07-07 12:44:21 -0500

ridwan gravatar image

it's a simple and straightforward query, how can i make a custom robot in gazebo simulation? for example all i will have is 4 wheel and a camera, no other sensors, maybe Bluetooth for joypad control.

I wanted to know the process, if anyone can guide me though any direction.

ps: i'm new to ros gazebo

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-07-08 09:22:20 -0500

Weasfas gravatar image

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.


edit flag offensive delete link more


Thanks a lot for giving me response. I will start working on it( studying it). I will update it here when i make progress

ridwan gravatar image ridwan  ( 2020-07-08 11:47:03 -0500 )edit

hi @Weasfas, I made the model using xacro, now i want to control it using my own set of controls, like i want to control wheels with different value, with Skid Steering Drive, can i do it?

ridwan gravatar image ridwan  ( 2020-07-12 04:07:36 -0500 )edit

Hi @ridwan,

Of course, you jut need to include the plugin like this in your xacro, And when launched Gazebo will start the plugin.

Weasfas gravatar image Weasfas  ( 2020-07-12 04:58:48 -0500 )edit

@Weasfas, I plugin this: <gazebo>

  <plugin name="skid_steer_drive_controller" filename="">



then i can use cmd_vel topic to send linear and angular velocity, and it works like magic thanks to you.

What meant was, how can i control each wheel differently? for example front and back left wheel velocity .5, and right wheel velocity .2

ridwan gravatar image ridwan  ( 2020-07-12 05:22:14 -0500 )edit

Ah, sure,

To control each wheel independently you will need to implement your own model plugin with 4 different topics to control each wheel, or you can try the ROS control approach I mentioned giving 4 transmision to each wheel with velocity controllers.

Weasfas gravatar image Weasfas  ( 2020-07-12 09:10:04 -0500 )edit

do u have any examples of transmission, doesn't matter if it is in two wheel? I tired use it but failed to do so.

ridwan gravatar image ridwan  ( 2020-07-12 16:40:56 -0500 )edit


For instance you can check how this is done in the Summit XL robot that I think it is a similar platform. The robot_description is in here and the wheel/transmission definition here. Then all ROS control things are here,

Weasfas gravatar image Weasfas  ( 2020-07-13 04:12:18 -0500 )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

1 follower


Asked: 2020-07-07 12:44:21 -0500

Seen: 276 times

Last updated: Jul 08 '20