Movement

Functions fo controlling robot motion Higher level functions to control the movement of robots. More...

Defines

#define FWD   0
 Move forwards.
#define BCK   1
 Move backwards.
#define SLOW_SPD   96
 A slow speed.
#define HALF_SPD   128
 Half of the full speed.
#define NRML_SPD   160
 A normal speed.
#define FAST_SPD   192
 A fast speed.
#define FULL_SPD   255
 The maximum speed.
#define SLOW_TURN   64
 A slow turning speed.
#define NRML_TURN   96
 A medium turning speed.
#define FAST_TURN   128
 A high turning speed.

Functions

void move (int velocity, int omega)
 Move the robot at the specified velocity.
void move_avoid (int velocity, int omega, int strength)
 Move the robot while avoiding obstacles.

Detailed Description

Functions fo controlling robot motion Higher level functions to control the movement of robots.


Function Documentation

void move ( int  velocity,
int  omega 
)

Move the robot at the specified velocity.

Causes the robot to move with the given translation and rotational velocities. motors_init must be called before this function can be used.

Parameters:
velocity the translational velocity of the robot, in the range -255 to 255. A positive value indicates forward motion, while a negative value indicates backwards motion.
omega the rotational velocity of the robot, in the range -255 to 255. A positive value indicates a counterclockwise velocity, while a negative value indicates a clockwise velocity.
See also:
motors_init, motor1_set, motor2_set

void move_avoid ( int  velocity,
int  omega,
int  strength 
)

Move the robot while avoiding obstacles.

Moves the robot with the given translational and angular velocities while avoiding obstacles. To be effective, this function must be called repeatedly throughout the motion. It relies on the IR rangefinders to detect obstacles. Before calling this function, motors_init and range_init must be called.

Parameters:
velocity the translational velocity of the robot, in the range -255 to 255. A positive value indicates forward motion.
omega the rotational velocity of the robot, in the range -255 to 255. A positive value indicates a counterclockwise velocity.
strength the strength of the avoid behavior, in the range 0 to 100.
See also:
motors_init, range_init, move


Generated on Thu Nov 8 23:15:40 2007 for libdragonfly by  doxygen 1.5.3