4
Lab 1 Introduction to new world Webot Duration : 45 minutes Learning outcomes : 1. This lab introduces the process of using simulator to model a robot. In the process of robot creation, student needs to understand how the machine learns from environment and working with the devices. 2. To create a new project from the wizard. This is a first step of development using Webot. 3. Able to understand the important an environment as a factor for certain robot to get the input and gives a feedback from this environment. 4. Student must be able to establish his/her environment with the wall, floor checker and some obstacles. The size of an obstacle can be in difference size and more than one. Create a new project : Using wizard to create world and controller Any new world consists of world folder and controller folder. Wizard can be used to complete these both processes. Step 1 : Create 4 point lights Open a scene tree and click to pointlight node 1. Select ambientIntensity and set a value to 0.6 and the Intensity value to 0.3. Finally, select location and enter [ 0.75 0.5 0.5 ] as values. 2. To create 4 pointlights , copy another 3 times of this node but change the location for each as following :- [ -0.5 0.5 0.35 ] in the location field.

Lab 1

  • Upload
    ho-ly

  • View
    212

  • Download
    0

Embed Size (px)

DESCRIPTION

12345

Citation preview

Page 1: Lab 1

Lab 1 Introduction to new world Webot

Duration : 45 minutes

Learning outcomes :

1. This lab introduces the process of using simulator to model a robot. In the process of robot creation, student needs to understand how the machine learns from environment and working with the devices.

2. To create a new project from the wizard. This is a first step of development using Webot.

3. Able to understand the important an environment as a factor for certain robot to get the input and gives a feedback from this environment.

4. Student must be able to establish his/her environment with the wall, floor checker and some obstacles. The size of an obstacle can be in difference size and more than one.

Create a new project : Using wizard to create world and controller

Any new world consists of world folder and controller folder. Wizard can be used to complete these both processes.

Step 1 : Create 4 point lights

Open a scene tree and click to pointlight node

1. Select ambientIntensity and set a value to 0.6 and the Intensity value to 0.3. Finally, select location and enter [ 0.75 0.5 0.5 ] as values.

2. To create 4 pointlights , copy another 3 times of this node but change the location for each as following :-

[ -0.5 0.5 0.35 ] in the location field. [ 0.45 0.5 -0.5 ] in the location field.

[ -0.5 0.5 -0.35 ] in the location field. 3. Check the View > Optional Rendering > Display Lights Positions menu item to make the

light sources visible.

Page 2: Lab 1

Step 2 : Create 4 bounding walls

1. Select the solid nodes from (def_floor) and add a new solid node.2. Name the label as ‘wall’ in its text field.3. Select the children folder and hit to add new shape. Open this nodes and add Box shape

in its geometry field using add new node button. 4. Set the size field of the Box to [ 0.01 0.1 1 ]. Select then the geometry node containing

the box of the wall and type "wall" in the DEF field located at bottom of the screen.5. Open again Shape, and now select its appearance and set its diffuseColor field and create

an Appearance node from a new node button. 6. Using same technique to set the Material node. (Try specularcolor node to check the

effect after light).7. As we want to prevent our robot from passing through the walls, we have to define the

boundingObject field of the wall. There are 2 ways to do this either to create a group node or one by one by using transform node.

8. Select the boundingObject field of the Solid wall, insert shape node in children there. 9. To set the geometry of this Shape, select the geometry field, hit Add New and select the

(previously defined) ‘wall’ in the USE list. 10. Finally set the translation field of the Solid node named "wall" to [ 0.495 0.05 0 ].

11. Now, copy and paste the first wall 3 times to create another 3 walls . Name it as ‘wall1’ ‘wall2’ and ‘wall 3’.Change the translation for each as the following:

wall 1 : translation : 0.495 0.05 0 rotation : 0 1 0 0

wall 2 : translation :-0.495 0.05 0 rotation : 0 1 0 0

wall 3 : translation : 0 0.05 -0.495 rotation : 0 1 0 1.57

wall 4 : translation : 0 0.05 0.495 rotation : 0 1 0 1.57

Step 3 : Create some obstacles

1. Select the last Solid node in the scene tree window (which is the wall) and click on the Add New button.

2. Choose a Solid node.

3. Open this newly created Solid node with a double-click and type "green box" in its name field.

4. Using the same technique as for the walls, add first a Shape, then an Appearance and a Material. For the color, let us make it green with a lighter green for the illuminated parts.

5. Now create a Box node in the geometry field of the Shape and set its size to [ 0.23 0.1 0.1 ]. Set the DEF name of this geometry to box0.

Page 3: Lab 1

6. To create the boundingObject of this object, create a Shape node and reuse the previous DEF for the geometry. Also, create an Appearance and a Material node and set the two colors to white, like we did for the wall.

7. Finally set the translation field to [ -0.05 0.05 -0.25 ], but leave its rotation field at the default value.

8. Now repeat these steps to create the three remaining obstacles. First create one called "blue box" which has a geometry (called box1) of [ 0.1 0.1 0.1 ], a translation of [ 0.2 0.05 0.27 ] and a rotation of [ 0 1 0 0.31 ].

9. Then create one called "yellow box" which has a geometry (calledbox2) of [ 0.05 0.1 0.3 ], a translation of [ -0.2 0.05 0.15 ] and a rotation of [ 0 1 0 0.4 ].

10. Finally create one called "red box" which has a geometry (called box3) of [ 0.15 0.1 0.08 ], a translation of [ 0.42 0.05 -0.1] and the default rotation.