Webots Modeling¶
New for 2026. Draft notes - work in progress.
Exploring a machine idea using the Webots open source robot simulator could involve creating a new robot model. Please see Robot Simulation Design for an introduction to the general principles involved in simulation design. These notes are a brief, practical guide to implementing a rigid-body simulation model within the Webots system.
The Scene Tree¶
The Webots Scene Tree is
a graph-based representation of an entire simulation. An individual robot is
represented by a Robot node which typically appears at the root level of the
scene. The Robot sub-tree may be entirely contained in the world file and
interactively edited in the GUI, but may also be generated by a proto script and
edited via a text editor. Either way, the following notes will help you parse
and edit the robot tree structure.
ZYY Arm Kinematics and Geometry¶
The following example is extracted from the ZYY Robot Arm Model to highlight the
tree nodes essential for the kinematic representation of the arm. Each
Robot and Solid node is a container corresponding to a single rigid
body. Each Shape node specifies geometry available for rendering, contact
detection, or mass properties. Each HingeJoint node connects two rigid
bodies with a joint.
ZYY Arm Dynamics and Contact¶
Following is an SVG figure showing more of the ZYY tree, now including the dynamics and contact nodes essential for physical simulation. It may be easier to read by opening the frame in a separate window, if your browser allows. This still omits other slots and nodes for other Webots properties, e.g. sensors.
Each
Shapeis a container for geometry (e.g.Cylinder) and rendering properties (Appearance)Each
Shapeis contained within aPosewhich positions the geometric coordinate frame for the primitive within the rigid body coordinate frame.Each
SolidincludesPhysicsto enable dynamics and specify mass properties for a single rigid body.Each
Solidincludes aboundingObjectslot to specify collision geometry. In this model, the same geometry is used for calculating mass properties.Each
HingeJointincludes an actuator in thedeviceslot. Note that the actuator has no intrinsic mass or geometry.The
boundingObjectslots use a DEF/USE mechanism to link to theShapeobjects. EachShapeincludes a named DEF, eachboundingObjectuses a named USE to invoke it.
Actuator Model¶
The Motor actuator model in Webots defaults to position control using a simulated PID controller calculated inside the physics loop. The default parameters include PID gains [10,0,0] (i.e. undamped position control), and maxVelocity of 10 (about 95 RPM), and no position or acceleration limits.
The motor devices are identified by name, e.g.:
from controller import Robot
robot = Robot()
motor = robot.getDevice('motor1')
A Motor device can be switched to velocity mode by setting the position target to infinity:
motor.setPosition(math.inf)
A Motor device can be switched to pure torque or force mode by calling setTorque, bypassing the PID control, e.g.:
motor.setTorque(0)
The Clock Robot Model controller demonstrates torque mode by implementing PD position control in Python. Note that this controller runs at the event loop step rate which might be considerably slower than the underlying physics step rate.
Related topics from the Motor scene tree node documentation:
Course Model Examples¶
A few of the simulation models created for the course include related commentary on the design:
Two-Link Robot Model: planar robot arm
ZYY Robot Arm Model: three-DOF robot arm
Wobbly Robot Model: two-wheeled robot
Dobot Magician Lite: three-DOF robot arm modeling an actual machine which includes linkages
Pendulum 1-2 Robot Model: underactuated double pendulum
Webots Documentation¶
The online Webots User Guide includes tutorials which walk through many of the software features. The specific tutorial most closely to this discussion is Tutorial 6: 4-Wheeled Robot which walks through the creation of a a four-wheeled cart.
The online Webots Reference Manual includes much more detail needed to create simulation models. A few sections of particular interest: