the robot sensor matrix More...
Data Structures | |
struct | SensorMatrix |
Defines | |
#define | MAXIMUM_XBEE_ID 0x10 |
#define | READING_UNKNOWN 0xFF |
Functions | |
void | sensor_matrix_create (void) |
Create a sensor matrix. | |
void | sensor_matrix_set_reading (int observer, int robot, int reading) |
Set a reading in a sensor matrix. | |
int | sensor_matrix_get_reading (int observer, int robot) |
Get a reading in a sensor matrix. | |
void | sensor_matrix_set_in_ring (int robot, int in) |
Set whether the robot is in the token ring. | |
int | sensor_matrix_get_in_ring (int robot) |
Get whether the robot is in the sensor ring. | |
int | sensor_matrix_get_joined (void) |
Get the number of robots which have joined the token ring. | |
int | sensor_matrix_get_size (void) |
Get the maximum size of the sensor matrix. |
the robot sensor matrix
These functions and structures are used for localization to determine the relative directions of robots.
void sensor_matrix_create | ( | void | ) |
Create a sensor matrix.
Initializes the sensor matrix.
References SensorMatrix::joined, SensorMatrix::matrix, and SensorMatrix::numJoined.
Referenced by wl_token_ring_register().
int sensor_matrix_get_in_ring | ( | int | robot | ) |
Get whether the robot is in the sensor ring.
Checks if the given robot is in the token ring.
robot | the ID of the robot to check |
References SensorMatrix::joined.
Referenced by wl_token_is_robot_in_ring(), wl_token_iterator_begin(), and wl_token_iterator_next().
int sensor_matrix_get_joined | ( | void | ) |
Get the number of robots which have joined the token ring.
Returns the number of robots which have joined the token ring.
References SensorMatrix::numJoined.
Referenced by wl_token_get_num_robots(), and wl_token_get_robots_in_ring().
int sensor_matrix_get_reading | ( | int | observer, | |
int | robot | |||
) |
Get a reading in a sensor matrix.
Gets the sensor reading for a robot to another robot.
observer | the robot whose reading we check | |
robot | the robot who we are checking the reading to |
References SensorMatrix::matrix.
Referenced by wl_token_get_sensor_reading().
int sensor_matrix_get_size | ( | void | ) |
Get the maximum size of the sensor matrix.
Returns the maximum XBee id of a robot which can be stored in the sensor matrix.
Referenced by wl_token_get_matrix_size(), wl_token_iterator_begin(), and wl_token_iterator_next().
void sensor_matrix_set_in_ring | ( | 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.
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 |
References SensorMatrix::joined, and SensorMatrix::numJoined.
Referenced by wl_token_ring_register().
void sensor_matrix_set_reading | ( | int | observer, | |
int | robot, | |||
int | reading | |||
) |
Set a reading in a sensor matrix.
Sets the sensor reading for robot robot to reading.
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 |
References SensorMatrix::matrix.