Simple cylinder

alt text

Goals:

In this tutorial you will:

  • Create a basic geometry component
  • Modify its visual
  • Add a collision and mass

New component

Let's start by creating a new component in the Library page. If you don't know how to do it, please take a look to Creating a new component.

Modify visual

First, let's expand everything in the tree until the geometry is visible, as in the above picture, then right-click it to get the available options. Next, click on cylinder in order to update the geometry.

alt text

Now that we have our cylinder, let's change its properties.

alt text

Select length element and then click on the value property, located at the bottom.

alt text

A pop-up will be shown. Change the length to 2 and click OK.

alt text

You can see the result on the following picture.

alt text

Finally, let's also change the color. For that, we need to include a new child to the visual element. Right-click it, and then click on material element.

alt text

Now, expand the material element and click on color. At the bottom, click on the value property to modify it.

alt text

Pick the color you prefer and click OK once you are ready. In this example we have used R: 139, G: 13, B: 242.

Note

The color selector design is different in every browser. This example image is from Firefox.

alt text

The cylinder's color is now updated!

alt text

Adding a collision

At this point we have the visual part ready, which specifies how the component is going to be shown to the user. However, we also need to describe the component to the physics engine so it can interact with other components.

In order to add a collision, right click on the base_link element and pick collision.

alt text

Next, expand everything inside collision, and you will see a geometry element again. Let's change it to cylinder and set the length to the same value as above.

alt text

Adding mass

In order to allow the component to be affected by gravity, we need to include an inertial element to the base_link. It includes properties such as the body mass, inertia and its centre of gravity.

To add this element, right-click the base_link in the tree and pick intertial.

alt text

By adding a inertial element, a mass of 1kg will be set by default. Let's click on the Value field, at the bottom to change it.

alt text

A modal will be shown. Change the mass to 0.5, for example, and click OK.

alt text

Your cylinder is now finished! Let's take a screenshot of your newest component and save it.

alt text

You can now add it to a library and start playing around. You can see an example below:

alt text

Tip

Wow, this is huge! What about if you change the cylinder to make it more compact? Then, you can add it to a product-entry and test it with some conveyors.