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

Provides a consistent API for updating and accessing the external pose of the robot swarm. More...

Go to the source code of this file.

Data Structures

struct  ExternalPose
 External pose of the robot as determined by an outside ASCII radio command system. More...
 

Typedefs

typedef struct ExternalPose ExternalPose
 External pose of the robot as determined by an outside ASCII radio command system.
 

Functions

void externalPoseInit (void)
 sets up memory and radio callbacks for getting external pose data. More...
 
boolean externalPoseGet (ExternalPose *poseArg)
 Gets this robot's pose. More...
 
boolean externalPoseGetNbr (ExternalPose *poseArg, Nbr *nbrPtr)
 Gets the pose of a given neighbor. More...
 
int32 externalPoseGetNbrRange (Nbr *nbrPtr)
 Gets the distance to a given neighbor's external pose. More...
 
boolean externalPoseIsHost (void)
 Determines if this is "the Host" (the robot connected over serial to external system). More...
 
boolean externalPoseIsActive (void)
 Determines if the external pose is active or inactive. More...
 

Detailed Description

Provides a consistent API for updating and accessing the external pose of the robot swarm.

This was developed as an interface between poses provided by the Newton Cam and the AprilTag system, but will work for any system that provides ASCII radio commands of the form:

            "EP, ID, X,Y,theta"

Where 'X','Y','theta' are integers. To use this, call externalPoseInit(); in your behaviorTask()

See Also
"\robotcode\AprilTagReader\src\AprilTagReaderUsageExample.c"
Since
November 28, 2012
Author
James McLurkin

Function Documentation

boolean externalPoseGet ( ExternalPose poseArg)

Gets this robot's pose.

Parameters
poseArg(overwritten if external pose is active with external pose data)
Returns
TRUE if external pose is active
boolean externalPoseGetNbr ( ExternalPose poseArg,
Nbr *  nbrPtr 
)

Gets the pose of a given neighbor.

Parameters
poseArg(overwritten with external pose data if external pose is active and a neighbor)
nbrPtrrobot we want to know the external pose of
Returns
TRUE if external pose is active AND this neighbor exists
int32 externalPoseGetNbrRange ( Nbr *  nbrPtr)

Gets the distance to a given neighbor's external pose.

Parameters
nbrPtrfor robot we want to know the distance from
Returns
the distance to the given neighbor's external pose.
void externalPoseInit ( void  )

sets up memory and radio callbacks for getting external pose data.

Should be called once in behaviorTask.

Returns
void
boolean externalPoseIsActive ( void  )

Determines if the external pose is active or inactive.

Returns
TRUE if external pose is active or FALSE if not
boolean externalPoseIsHost ( void  )

Determines if this is "the Host" (the robot connected over serial to external system).

Returns
TRUE if this is the host or FALSE