# Tutorial 2: Simple cylinder

## 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.

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

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

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

You can see the result on the following picture.

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.

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

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.

The cylinder's color is now updated!

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.

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.

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.

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.

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