|  | |
5.5 Controlling Actuators
Actuators are easier to handle than sensors. They don't need to be enabled.
To control an actuator, it must be:
-
identified: this is performed by the
robot_get_device function which returns a handler to
the actuator from its name. This needs to be done only once in the reset
callback function, which is provided as an argument to the
robot_live function. As with sensors, the only
exception to this rule concerns the root device of a robot.
-
set: this is performed by the appropriate
set function specific to each actuator (see
differential_wheels_set_speed for an example). It is
usually called in the endless loop with different computed values at each
step.
-
run: this is done by the
robot_step function inside the endless loop.

^ page top ^
|