Skip to content

Webots Define the Robot

Figure 1: Webots PcbBot setup

Setting up Webots for our Woodbot robot includes the following steps:

  • Optional, See Appendix Exporting 3D models from Solidworks
  • Optional, See Appendix Importing them into Webots
  • Configuring robot boundary conditions and actuation
  • Defining sensors
  • Setting up a controller to drive the robot and to read sensor outputs


Remember to save your world occationally. You can easily lose your process otherwise.

Creating a New Webots Project and Environment

  1. Go to "Wizards → New project directory..."
  2. Choose a folder for your Webots project

After creating the project directory, copy the provided Webots world file to your project directory and open it in Webots. You should see the pre-imported robot geometry and robot node.

Defining Your Robot

To define the robot and object boundaries:

  1. Cut and paste all Woodbot Solid nodes under the Robot's children node.
  2. Set Solid DEF names appropriately (e.g., Servo, servo horn).
  3. Double-click wheel Solid nodes' physics node and add physics. Now your solid has mass and inertia based on its shape and density.
  4. Set density to \(600 \frac{kg}{m^3}\).
  5. Ensure the boundingObject node in the Robot node is set to "USE Body" (Shape).
  6. Set Robot node physics weight to 0.15 kg and center of mass to [-.03, 0, 0] m.

Defining Joints and Actuators

To define joints for simulation:

  1. Expand one of the hingeJoints in the Robot node's children.
  2. Add jointParameter and rotational motor nodes.
  3. Set axis to \([0,0,-1]\) and anchor position to \([-0.01425, -0.0063, 0]\) m.
  4. Name the rotationalMotor nodes appropriately (e.g., motor_r, motor_l).

Scene Tree with Sensor Definitions Scene tree with proper sensor definitions

Defining Sensors and Their Models

For setting up sensors:

  1. Expand the Lidar_l node and change type to "laser".
  2. Set translations and rotations for sensors as specified.
  3. Open the lookup table node in lidar to define the relationship between distance and sensor outputs.

The lookup table is as follows:

Actual [m] Output STD [%]
0 0 0.04
1.2 1200 0.04

Scene Tree with Sensor Definitions Scene tree with proper sensor definitions

WorldInfo and Contact Definition

In the WorldInfo tree:

  1. Add a contactProperties node to define frictions between objects.
  2. Set materials and coulombFriction as needed (e.g., rubber with 0.8 friction).
  3. Adjust contactMaterial settings for wheel and floor.

Defining a Robot Controller

To set up the robot controller:

  • Set the controller under the Robot node to <extern> and ensure Supervisor is true.

Remember to save your world before proceeding.