Revision 1456
sensor_matrix.h | ||
---|---|---|
49 | 49 |
#define MAXIMUM_XBEE_ID 0x10 |
50 | 50 |
#define READING_UNKNOWN 0xFF |
51 | 51 |
|
52 |
typedef struct |
|
53 |
{ |
|
54 |
/* direction of max reading */ |
|
55 |
unsigned char dir; |
|
56 |
/* estimated distance */ |
|
57 |
unsigned char dist; |
|
58 |
} SensorReading; |
|
59 |
|
|
52 | 60 |
/** |
53 | 61 |
* @struct SensorMatrix |
54 | 62 |
* |
... | ... | |
75 | 83 |
* The matrix. Each row represents the readings of one |
76 | 84 |
* robot. |
77 | 85 |
**/ |
78 |
unsigned char matrix[MAXIMUM_XBEE_ID][MAXIMUM_XBEE_ID];
|
|
86 |
SensorReading matrix[MAXIMUM_XBEE_ID][MAXIMUM_XBEE_ID];
|
|
79 | 87 |
#endif |
80 | 88 |
} SensorMatrix; |
81 | 89 |
|
82 | 90 |
/**@brief Create a sensor matrix **/ |
83 | 91 |
void sensor_matrix_create(void); |
84 | 92 |
/**@brief Set a reading in a sensor matrix **/ |
85 |
void sensor_matrix_set_reading(int observer, int robot, int reading);
|
|
93 |
void sensor_matrix_set_reading(int observer, int robot, SensorReading reading);
|
|
86 | 94 |
/**@brief Get a reading in a sensor matrix **/ |
87 |
int sensor_matrix_get_reading(int observer, int robot);
|
|
95 |
SensorReading * sensor_matrix_get_reading(int observer, int robot);
|
|
88 | 96 |
/**@brief Set whether the robot is in the token ring **/ |
89 | 97 |
void sensor_matrix_set_in_ring(int robot, int in); |
90 | 98 |
/**@brief Get whether the robot is in the sensor ring **/ |
Also available in: Unified diff