Arm Theater

This sample world includes a pair of double pendula configured as actuated two-link arms. This model demonstrates several key concepts: rigid body dynamics, collision modeling, and PD control.

The world file is arm-theater.wbt, which can be found within the Webots.zip archive.

../_images/arm-theater.png

Screenshot of Webots model of the arm-theater robots. Each robot is independently driven by a Python script.

World File

The world file specifies all the elements of the scene: camera position, background scenery, lighting, fixed objects, and robots. The robots are modeled as separate .proto scripts so the world file is short and fairly readable, since only parameters changed from the defaults are specified.

 1#VRML_SIM R2023b utf8
 2
 3EXTERNPROTO "../protos/HL-A11-room.proto"
 4EXTERNPROTO "../protos/clock.proto"
 5EXTERNPROTO "../protos/two-link.proto"
 6
 7WorldInfo {
 8}
 9Viewpoint {
10  orientation 0 0 -1 3.14159
11  position 7.5 0 1.3
12  followType "None"
13}
14Background {
15  skyColor [
16    0.1 0.1 0.1
17  ]
18}
19SpotLight {
20  attenuation 0 0 1
21  beamWidth 0.3
22  cutOffAngle 0.4
23  direction -2 -2 1.2
24  intensity 5
25  location 1.5 2 0.1
26}
27SpotLight {
28  attenuation 0 0 1
29  beamWidth 0.3
30  cutOffAngle 0.4
31  direction -2 2 1.2
32  intensity 5
33  location 1.5 -2 0.1
34}
35HL-A11-room {
36}
37clock {
38  translation -1.5 0 1
39  rotation 0.5773509358554485 0.5773509358554485 0.5773489358556708 2.0944
40}
41two-link {
42  translation 0 1.0 0.5
43  rotation 0.707107 0 0.707107 -3.14159  
44  name "right-two-link"
45  controller "arm_theater"
46}
47two-link {
48  translation 0 -1.0 0.5
49  rotation 0.707107 0 0.707107 -3.14159
50  name "left-two-link"
51  controller "arm_theater"  
52}

Proto Files

The proto files are a mixture of VRML and embedded Lua. They can be browsed directly from the course site:

The two-link arm is documented is detail on Two-Link Robot Model. The clock is documented in detail on Clock Robot Model.