Download Embedded Robotics - Thomas Braunl

Transcript
Biped Robot Design
Figure 10.5: Visualization of servo sensor data
The main program comprises four steps:
•
•
•
•
Initializing all servos.
Setting all servos to the “up” position.
Looping between “up” and “down” until keypress.
Releasing all servos.
Robot configurations like “up” and “down” are stored as arrays with one
integer value per dof of the robot (nine in this example). They are passed as
parameters to the subroutine “move”, which drives the robot servos to the
desired positions by incrementally setting the servos to a number of intermediate positions.
Subroutine “move” uses local arrays for the current position (now) and the
individual servo increment (diff). These values are calculated once. Then for
a pre-determined constant number of steps, all servos are set to their next
incremental position. An OSWait statement between loop iterations gives the
servos some time to actually drive to their new positions.
137