Sensor Matrix

the robot sensor matrix More...

Data Structures

struct  SensorMatrix
struct  SensorMatrix

Functions

SensorMatrixsensor_matrix_create (void)
 Create a sensor matrix.
void sensor_matrix_destroy (SensorMatrix *m)
 Destroy a sensor matrix.
void sensor_matrix_add_robot (SensorMatrix *m, unsigned int id)
 Add a robot to a sensor matrix.
void sensor_matrix_remove_robot (SensorMatrix *m, unsigned int id)
 Remove a robot from a sensor matrix.
void sensor_matrix_set_reading (SensorMatrix *m, int observer, int robot, int reading)
 Set a reading in a sensor matrix.
int sensor_matrix_get_reading (SensorMatrix *m, int observer, int robot)
 Get a reading in a sensor matrix.
void sensor_matrix_set_in_ring (SensorMatrix *m, int robot, int in)
 Set whether the robot is in the token ring.
int sensor_matrix_get_in_ring (SensorMatrix *m, int robot)
 Get whether the robot is in the sensor ring.
int sensor_matrix_get_size (SensorMatrix *m)
 Get the size of the sensor matrix.
int sensor_matrix_get_joined (SensorMatrix *m)
 Get the number of robots which have joined the token ring.

Detailed Description

the robot sensor matrix

These functions and structures are used for localization to determine the relative directions of robots.


Function Documentation

void sensor_matrix_add_robot SensorMatrix m,
unsigned int  id
 

Add a robot to a sensor matrix.

Adds robot with XBee id id to the sensor matrix.

Parameters:
m the sensor matrix
id the XBee ID of the robot to add

SensorMatrix* sensor_matrix_create void   ) 
 

Create a sensor matrix.

Initializes the sensor matrix.

Returns:
the newly created sensor matrix

void sensor_matrix_destroy SensorMatrix m  ) 
 

Destroy a sensor matrix.

Deletes and frees memory from the sensor matrix.

Parameters:
m the sensor matrix to delete

int sensor_matrix_get_in_ring SensorMatrix m,
int  robot
 

Get whether the robot is in the sensor ring.

Checks if the given robot is in the token ring.

Parameters:
m the sensor matrix
robot the ID of the robot to check
Returns:
1 if the robot is in the token ring, 0 otherwise

int sensor_matrix_get_joined SensorMatrix m  ) 
 

Get the number of robots which have joined the token ring.

Returns the number of robots which have joined the token ring.

Parameters:
m the sensor matrix
Returns:
the number of robots in the token ring

int sensor_matrix_get_reading SensorMatrix m,
int  observer,
int  robot
 

Get a reading in a sensor matrix.

Gets the sensor reading for a robot to another robot.

Parameters:
m the sensor matrix
observer the robot whose reading we check
robot the robot who we are checking the reading to
Returns:
the observer's BOM reading for robot

int sensor_matrix_get_size SensorMatrix m  ) 
 

Get the size of the sensor matrix.

Returns the size of the sensor matrix.

Parameters:
m the sensor matrix
Returns:
the size of the sensor matrix

void sensor_matrix_remove_robot SensorMatrix m,
unsigned int  id
 

Remove a robot from a sensor matrix.

Removes robot with id from the sensor matrix, and removes all sensor information regarding the robot.

Parameters:
m the sensor matrix
id the XBee ID of the robot to remove

void sensor_matrix_set_in_ring SensorMatrix m,
int  robot,
int  in
 

Set whether the robot is in the token ring.

Sets whether or not the given robot is part of the token ring.

Parameters:
m the sensor matrix
robot the robot to set as a member / nonmember of the token ring
in 1 if the robot is in the token ring, 0 otherwise

void sensor_matrix_set_reading SensorMatrix m,
int  observer,
int  robot,
int  reading
 

Set a reading in a sensor matrix.

Sets the sensor reading for robot robot to reading.

Parameters:
m the sensor matrix to set the reading for
observer the id of the robot who made the reading
robot the id of the robot who the reading is for
reading the BOM reading from observer to robot


Generated on Wed Oct 31 17:54:43 2007 for libwireless by  doxygen 1.4.6