Module mvh

Simple robot movement functions Use this module for very simple robot movements.

Authors: Thomas Lorentsen, Sten Gruener.

Description

Simple robot movement functions Use this module for very simple robot movements. It provides moving the robot by speed or to a position. It also allows the position of the robot to be read and some other useful movement functions. This functions are non-blocking so they will return before the robot has reached its destination.

Data Types

movemode()

movemode() = distance | speed | full | difference | position

distance

Will move until it has moved a specified distance.

speed

Will constantly keep moving at a specified speed.

full

As well as moving at a specified speed, rotation speed can be specified.

difference

position

Travels toward a specified position.

rotationmode()

rotationmode() = degrees | speed

degrees

This tells the robot to rotate until it has reached the number of degrees specified.

speed

This tells the robot to constantly rotate at a specified speed.

Function Index

get_position/1Reads the robot odometer.
move/3Provides several ways of moving the robot.
rotate/3Rotate the robot by degrees or speed.
stop/1Stops a moving robot.

Function Details

get_position/1

get_position(RobotID::pid()) -> {X::float(), Y::float(), Radians::float()} | {error, Reason::atom()}

Reads the robot odometer. The inital odometer is set to {0,0,0} and will track the position of the robot from its starting position.

move/3

move(RobotId::pid(), Mode::movemode(), Params::tuple()) -> ok

Provides several ways of moving the robot. Supports: distance, speed, full, difference, position. It also supports a list of RobotIds.

rotate/3

rotate(RobotID::pid(), Mode::rotationmode(), Params::float()) -> ok | {error, Reason::atom()}

Rotate the robot by degrees or speed. Rotating by degrees is relative. It keep rotating until it has reached the direction it needs. Rotating by speed will make the robot rotate at a fixed speed. It will keep rotating until it is stopped by using another movement function. This function can also take a list of robots.

stop/1

stop(RobotId::pid()) -> ok

Stops a moving robot.


Generated by EDoc, Aug 13 2009, 23:20:23.