ronelib
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs
NbrNbrComms.h File Reference

The neighbor communication provides an API for accessing data about a robot's neighbors and information on those neighbor's neighbors. More...

Go to the source code of this file.

Data Structures

struct  NbrNbr
 All relevant data about a neighbor's neighbor. More...
 
struct  NbrNbrList
 Array of neighbor's neighbors. More...
 

Typedefs

typedef struct NbrNbr NbrNbr
 All relevant data about a neighbor's neighbor. More...
 
typedef struct NbrNbrList NbrNbrList
 Array of neighbor's neighbors. More...
 

Functions

void nbrNbrInit (void)
 Initializes messages for broadcasting and adds a callback. More...
 
void nbrNbrListGetFromNbr (Nbr *nbrPtr, NbrNbrList *nbrNbrList)
 Get list of neighbor's neighbors. More...
 
uint8 nbrNbrListGetSize (NbrNbrList *nbrNbrListPtr)
 Gets the size of this neighbor's "neighbor list.". More...
 
void nbrNbrListPrint (NbrNbrList *nbrNbrListPtr)
 Print information on neighbor (and information of neighbor's neighbors). More...
 
NbrNbrnbrNbrListGetNbrAtIdx (NbrNbrList *nbrNbrListPtr, uint8 idx)
 Returns pointer to the neighbors at the input index of this neighborList. More...
 
NbrNbrnbrNbrListGetNbrWithID (NbrNbrList *nbrNbrListPtr, uint8 id)
 Returns pointer to the neighbor with id of this nbr nbr List. More...
 
uint8 nbrNbrGetID (NbrNbr *nbrNbrPtr)
 Get ID of neighbor's neighbor. More...
 
int16 nbrNbrGetBearing (NbrNbr *nbrNbrPtr)
 Get bearing of neighbor's neighbor. More...
 
int16 nbrNbrGetOrientation (NbrNbr *nbrNbrPtr)
 Get orientation of neighbor's neighbor. More...
 

Detailed Description

The neighbor communication provides an API for accessing data about a robot's neighbors and information on those neighbor's neighbors.

This code implements a class-type object and may be difficult to understand.

Since
November 13, 2012
Author
James McLurkin

Typedef Documentation

typedef struct NbrNbr NbrNbr

All relevant data about a neighbor's neighbor.

typedef struct NbrNbrList NbrNbrList

Array of neighbor's neighbors.

Function Documentation

int16 nbrNbrGetBearing ( NbrNbr nbrNbrPtr)

Get bearing of neighbor's neighbor.

Warning
Incomplete.
Parameters
nbrNbrPtrpointer to neighbor's neighbor
Returns
bearing of neighbor's neighbor
uint8 nbrNbrGetID ( NbrNbr nbrNbrPtr)

Get ID of neighbor's neighbor.

Parameters
nbrNbrPtrpointer to neighbor's neighbor
Returns
the ID of neighbor's neighbor
int16 nbrNbrGetOrientation ( NbrNbr nbrNbrPtr)

Get orientation of neighbor's neighbor.

Parameters
nbrNbrPtrpointer to neighbor's neighbor
Returns
orientation of neighbor's neighbor
void nbrNbrInit ( void  )

Initializes messages for broadcasting and adds a callback.

Returns
void
void nbrNbrListGetFromNbr ( Nbr *  nbrPtr,
NbrNbrList nbrNbrList 
)

Get list of neighbor's neighbors.

Parameters
nbrPtrpointer to neighbor's neighbor
nbrNbrListpointer to where to place list
Returns
void
NbrNbr* nbrNbrListGetNbrAtIdx ( NbrNbrList nbrNbrListPtr,
uint8  idx 
)

Returns pointer to the neighbors at the input index of this neighborList.

Parameters
nbrNbrListPtrlist of the neighbors of this neighbor
idxindex
Returns
pointer to the neighbors at index idx of this neighborList, NULL if list is empty
NbrNbr* nbrNbrListGetNbrWithID ( NbrNbrList nbrNbrListPtr,
uint8  id 
)

Returns pointer to the neighbor with id of this nbr nbr List.

Parameters
nbrNbrListPtrlist of the neighbors of this neighbor
idrobot ID
Returns
pointer to the neighbor with input ID, or NULL
uint8 nbrNbrListGetSize ( NbrNbrList nbrNbrListPtr)

Gets the size of this neighbor's "neighbor list.".

Parameters
nbrNbrListPtrlist of the neighbors of this neighbor
Returns
number of neighbors, 0 if empty
void nbrNbrListPrint ( NbrNbrList nbrNbrListPtr)

Print information on neighbor (and information of neighbor's neighbors).

Print roneID and neighbor's ID, bear, orientation, orientation valid If neighbor_nbrnbr_enable is true, print ID and bearing of each neighbor's neighbor. Print name and value of each neighbor field.

Parameters
nbrNbrListPtrlist of the neighbors of this neighbor
Returns
void