Creating a Simulation of Arena with Gazebo (Part Two of Three)

In the last part of this tutorial, we learned how to transfer into URDF file that can be used in simulation software like gazebo. In this part of tutorial, I will teach you how to define joints when transfer from a Solidwork design into the URDF file. Unlike the course base, a robot design is not a single piece, it is made up by several parts that can be moved in relation to each other. In robot control, we simplified the structure into links and joints. The following schematic of robot arm is an example of how joints and links are defined.

For demonstration, we will use a simple robot with differential drive and another simple mechanism. A full MRDC robot is certainly too complicated for this demonstration. What robot is much simpler? Oh, I got an idea, Let’s use a combot! The following combot was made with two wheels and a Horizontal spinner.

That was a simple combot I made in Solidwork. For the transfer to the URDF file, there needs to be a coordinate system for every component that need to be set. To add new coordinate system, go to “Reference” and select “Coordinate system” form the Drop down menu. Select the center of one wheel as the origin and add it.

The Wheels and the spinner are all rotational links, therefore, an axis of rotation needs to be defined. To do this, go to “Reference” and select “axis” form the Drop down menu. Select the axis of the wheel by click on the outer ring.

When finished all three, it should look like this. Make sure all coordinate systems are set up the same way, for this one, I have x-axis point forward and y axis point into the page and y-axis pointed up.

But wait a second, combot has no sensor to tell where it is. So, let’s add a Lidar to it. (Read the bonus part for it)

Now, as what we learned from the last part, we are going to export the design into an URDF file. When you click on file – export to URDF, this side bar while pops up. First, you need to define the body as the base link.

We have two wheels, one spinner and one LIDAR. Therefore, there will 4 children links. Put it down here.

Now click on the first empty_link. Name the link as “Wheel1_link” and don’t forget to name the joint as “Wheel1_joint”. Select the corresponding coordinate system and axis that we defined as its reference coordinate and axis.

Do the same for adding coordinate system and axis for all other components.

When you finished all parts, check the tree.

Now, after you checked everything click on preview and export.

Export window will come up, you need to enter the rotation limit of the wheel and spinner, because it makes full revolutions, there will be no limit. Put in “180” and “-180”. And then click on Next.
And finish the next steps as we learned in the previous part. The you will have the URDF file generated in your selected directory.