![]() |
roneos
Operating System for the r-one robot
|
Used to maintain information about network neighbors, sets up data storage, and sets up callbacks. More...
Go to the source code of this file.
Data Structures | |
struct | NbrData |
Linked list of data on messages. More... | |
struct | NbrMsgRadioNbrData |
The IR message a neighbor has. More... | |
struct | NbrMsgRadio |
Linked list of a neighbor's messages. More... | |
struct | Nbr |
Information stored on a network neighbor. More... | |
struct | NbrDatabase |
Array containing data on all the network neighbors. More... | |
struct | NbrList |
Array containing pointers to all the network neighbors' data. More... | |
struct | IRRangeData |
Data from IR signal. More... | |
Typedefs | |
typedef struct NbrData | NbrData |
Linked list of data on messages. | |
typedef struct NbrMsgRadioNbrData | NbrMsgRadioNbrData |
The IR message a neighbor has. | |
typedef struct NbrMsgRadio | NbrMsgRadio |
Linked list of a neighbor's messages. | |
typedef struct Nbr | Nbr |
Information stored on a network neighbor. | |
typedef struct NbrDatabase | NbrDatabase |
Array containing data on all the network neighbors. | |
typedef struct NbrList | NbrList |
Array containing pointers to all the network neighbors' data. | |
typedef struct IRRangeData | IRRangeData |
Data from IR signal. | |
Functions | |
void | neighborsInit (uint32 neighbor_period) |
Initialize neighbors and start neighbors task. More... | |
void | neighborsDisable (void) |
Disable neighbor xmit/recv. More... | |
void | neighborsXmitEnable (boolean neighbor_xmit_enable_arg) |
Enable neighbor to transmit messages. More... | |
void | neighborsSetPeriod (uint32 neighbor_period_arg) |
Set neighbor period, neighbor timeout, and obstacle timeout proportional to argument. More... | |
void | neighborsSetTimeoutRounds (uint8 timeoutRounds, uint8 minActive, uint8 maxInactive) |
Set neighbor period, neighbor timeout, and obstacle timeout proportional to argument. More... | |
uint32 | neighborsGetPeriod (void) |
Get neighbor period. More... | |
void | neighborsGetMutex (void) |
Get neighbors mutex. More... | |
void | neighborsPutMutex (void) |
Put neighbors mutex. More... | |
uint32 | neighborsGetRound (void) |
Get neighbor round from neighbor data. More... | |
boolean | neighborsNewRoundCheck (uint32 *roundOldPtr) |
Check to see if there is a new neighbor round. Updates the variable at the pointer. More... | |
void | neighborsIgnore (uint8 neighborID) |
Tries add neighborID to list of neighbors to ignore. More... | |
uint8 | irObstaclesGetBits (void) |
Get IR obstacle bits. More... | |
uint8 * | irObstaclesGetRangeBits (void) |
Get IR obstacle range bits. More... | |
uint8 * | irObstaclesGetBitMatrix (void) |
Get IR obstacle bit matrix. More... | |
int16 | irObstaclesGetBearing (void) |
Get IR obstacle bearing. More... | |
void | obstaclePrint (void) |
Print the obstacle data from the IR sensors. More... | |
uint8 | nbrGetID (Nbr *nbrPtr) |
Get neighbor ID. More... | |
int32 | nbrGetBearing (Nbr *nbrPtr) |
Get neighbor bearing. More... | |
int32 | nbrGetOrientation (Nbr *nbrPtr) |
Get neighbor orientation. More... | |
int32 | nbrGetRange (Nbr *nbrPtr) |
Get neighbor range. More... | |
boolean | nbrGetOrientationValid (Nbr *nbrPtr) |
Get neighbor orientation valid. More... | |
uint8 | nbrGetRangeBits (Nbr *nbrPtr) |
Get neighbor range bits. More... | |
uint8 | nbrGetReceiverBits (Nbr *nbrPtr) |
Get neighbor receiver bits. More... | |
uint8 | nbrGetTransmitterBits (Nbr *nbrPtr) |
Get neighbor transmitter bits. More... | |
uint32 | nbrGetUpdateTime (Nbr *nbrPtr) |
Get neighbor update time. More... | |
uint32 | nbrGetUpdateRound (Nbr *nbrPtr) |
Get neighbor update round. More... | |
void | nbrPrint (Nbr *nbr) |
Print information on neighbor (and information of neighbor's neighbors). More... | |
void | nbrPrintData (Nbr *nbr, uint32 round) |
Print header and neighbor data. More... | |
boolean | nbrIsRobot (Nbr *nbrPtr) |
Returns true if this neighbor is a beacon. More... | |
boolean | nbrIsBeacon (Nbr *nbrPtr) |
Returns true if this neighbor is a beacon. More... | |
void | nbrMsgRadioCreate (NbrMsgRadio *nbrMsgRadioPtr, const char *name) |
Create a radio neighbor message. More... | |
void | nbrMsgRadioSet (NbrMsgRadio *nbrMsgRadioPtr, char *dataPtr, uint8 length) |
Gets a radio neighbor message. More... | |
NbrMsgRadioNbrData * | nbrMsgRadioGetNbr (NbrMsgRadio *nbrMsgRadioPtr, Nbr *nbrPtr) |
Gets a radio neighbor message. More... | |
void | nbrMsgRadioPrint (NbrMsgRadio *nbrMsgRadioPtr, Nbr *nbrPtr) |
Prints the message data for the input neighbor. More... | |
Used to maintain information about network neighbors, sets up data storage, and sets up callbacks.
Initializing neighbors initializes the neighbor period, neighbor timeout, obstacle timeout. Also initializes neighborData, sets the message length, and puts the 7-bit roneID in message. In addition, semaphore implementing neighborsMutex is created.
int16 irObstaclesGetBearing | ( | void | ) |
Get IR obstacle bearing.
This function returns the bearing of an IR obstacle. It looks for contiguous obstacle bits, to select the largest (nearest) obstacle. This could cause dithering for 1-bit sized obstacles.
uint8* irObstaclesGetBitMatrix | ( | void | ) |
Get IR obstacle bit matrix.
uint8 irObstaclesGetBits | ( | void | ) |
Get IR obstacle bits.
uint8* irObstaclesGetRangeBits | ( | void | ) |
Get IR obstacle range bits.
int32 nbrGetBearing | ( | Nbr * | nbrPtr) |
Get neighbor bearing.
nbrPtr | neighbor pointer |
uint8 nbrGetID | ( | Nbr * | nbrPtr) |
Get neighbor ID.
nbrPtr | neighbor pointer |
int32 nbrGetOrientation | ( | Nbr * | nbrPtr) |
Get neighbor orientation.
nbrPtr | neighbor pointer |
boolean nbrGetOrientationValid | ( | Nbr * | nbrPtr) |
Get neighbor orientation valid.
nbrPtr | neighbor pointer |
int32 nbrGetRange | ( | Nbr * | nbrPtr) |
Get neighbor range.
nbrPtr | neighbor pointer |
uint8 nbrGetRangeBits | ( | Nbr * | nbrPtr) |
Get neighbor range bits.
Range bits are recieverBitCount + orientationBitCount
nbrPtr | neighbor pointer |
uint8 nbrGetReceiverBits | ( | Nbr * | nbrPtr) |
Get neighbor receiver bits.
Receiver bits are the actual receivers the message was received on.
nbrPtr | neighbor pointer |
uint8 nbrGetTransmitterBits | ( | Nbr * | nbrPtr) |
Get neighbor transmitter bits.
Receiver bits are the actual transmitter the message was received from.
nbrPtr | neighbor pointer |
uint32 nbrGetUpdateRound | ( | Nbr * | nbrPtr) |
Get neighbor update round.
nbrPtr | neighbor pointer |
uint32 nbrGetUpdateTime | ( | Nbr * | nbrPtr) |
Get neighbor update time.
nbrPtr | neighbor pointer |
boolean nbrIsBeacon | ( | Nbr * | nbrPtr) |
Returns true if this neighbor is a beacon.
nbrPtr | neighbor pointer |
boolean nbrIsRobot | ( | Nbr * | nbrPtr) |
Returns true if this neighbor is a beacon.
nbrPtr | neighbor pointer |
void nbrMsgRadioCreate | ( | NbrMsgRadio * | nbrMsgRadioPtr, |
const char * | name | ||
) |
Create a radio neighbor message.
This function is called only once per program execution for each thing.
nbrMsgRadioPtr | the pointer to the radio message |
name | the name for the radio message |
NbrMsgRadioNbrData* nbrMsgRadioGetNbr | ( | NbrMsgRadio * | nbrMsgRadioPtr, |
Nbr * | nbrPtr | ||
) |
Gets a radio neighbor message.
This function returns a pointer to the NbrMsgRadioNbrData struct for this neighbor.
nbrMsgRadioPtr | the pointer to the radio message |
nbrPtr | pointer to the neighbor |
void nbrMsgRadioPrint | ( | NbrMsgRadio * | nbrMsgRadioPtr, |
Nbr * | nbrPtr | ||
) |
Prints the message data for the input neighbor.
nbrMsgRadioPtr | pointer for the linked list of a neighbor's messages |
nbrPtr | pointer for the desired neighbor |
void nbrMsgRadioSet | ( | NbrMsgRadio * | nbrMsgRadioPtr, |
char * | dataPtr, | ||
uint8 | length | ||
) |
Gets a radio neighbor message.
This function returns a pointer to the NbrMsgRadioNbrData struct for this neighbor.
nbrMsgRadioPtr | the pointer to the radio message |
dataPtr | pointer to a char array of max length RADIO_COMMAND_MESSAGE_DATA_LENGTH |
length |
void nbrPrint | ( | Nbr * | nbr) |
Print information on neighbor (and information of neighbor's neighbors).
Print roneID and neighbor's ID, bear, orientation, orientation valid Print name and value of each neighbor message.
nbr | neighbor pointer |
void nbrPrintData | ( | Nbr * | nbr, |
uint32 | round | ||
) |
Print header and neighbor data.
Print header once. Print id, time, round; neighbor's ID, bearing, update time; neighbor's neighbor's ID, bearing, update time.
nbr | neighbor pointer |
round | the round number |
void neighborsDisable | ( | void | ) |
Disable neighbor xmit/recv.
void neighborsGetMutex | ( | void | ) |
Get neighbors mutex.
uint32 neighborsGetPeriod | ( | void | ) |
Get neighbor period.
uint32 neighborsGetRound | ( | void | ) |
Get neighbor round from neighbor data.
void neighborsIgnore | ( | uint8 | neighborID) |
Tries add neighborID to list of neighbors to ignore.
neighborID | the neighbor we want to ignore (no longer monitor) |
void neighborsInit | ( | uint32 | neighbor_period) |
Initialize neighbors and start neighbors task.
neighbor_period | the neighbor period in rounds |
boolean neighborsNewRoundCheck | ( | uint32 * | roundOldPtr) |
Check to see if there is a new neighbor round. Updates the variable at the pointer.
roundOldPtr | pointer for previous round |
void neighborsPutMutex | ( | void | ) |
Put neighbors mutex.
void neighborsSetPeriod | ( | uint32 | neighbor_period_arg) |
Set neighbor period, neighbor timeout, and obstacle timeout proportional to argument.
neighbor_period_arg | the neighbor period length in rounds |
void neighborsSetTimeoutRounds | ( | uint8 | timeoutRounds, |
uint8 | minActive, | ||
uint8 | maxInactive | ||
) |
Set neighbor period, neighbor timeout, and obstacle timeout proportional to argument.
timeoutRounds | |
minActive | |
maxInactive |
void neighborsXmitEnable | ( | boolean | neighbor_xmit_enable_arg) |
Enable neighbor to transmit messages.
neighbor_xmit_enable_arg | a boolean that allows enable or not |
void obstaclePrint | ( | void | ) |
Print the obstacle data from the IR sensors.