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

Behaviors associated with robot movement. More...

Go to the source code of this file.

Data Structures

struct  Beh
 Structure for robot behaviors. More...
 

Typedefs

typedef struct Beh Beh
 Structure for robot behaviors.
 

Functions

void behaviorSystemInit (void(*behaviorTask)(void *parameters), uint32 stackSize)
 Initializes the behavior system task. More...
 
void motorSetBeh (Beh *behPtr)
 Moves the robot based on the input motor behavior. More...
 
uint8 behGetTv (Beh *behPtr)
 Gets translational velocity. More...
 
void behSetTvRv (Beh *behPtr, int32 tv, int32 rv)
 Sets the input behavior's translational and rotational velocities. More...
 
void behSetTv (Beh *behPtr, int32 tv)
 Sets the input behavior's translational velocity. More...
 
void behSetRv (Beh *behPtr, int32 rv)
 Sets the input behavior's rotational velocity. More...
 
uint8 behGetRv (Beh *behPtr)
 Gets the input behavior's rotational velocity. More...
 
uint8 behIsActive (Beh *behPtr)
 Tells whether or not the input behavior is active. More...
 
void behSetActive (Beh *behPtr)
 Sets the input behavior to active. More...
 
void behSetInactive (Beh *behPtr)
 Sets the input behavior to inactive. More...
 
boolean buttonModeRGB (uint8 *modePtr, uint8 modeRed, uint8 modeGreen, uint8 modeBlue)
 Determines if the red, green, or blue button has been pressed. More...
 
BehbehSubsume (Beh *behOutPtr, Beh *behInLoPtr, Beh *behInHighPtr)
 Subsume a low priority behavior with a high priority one. More...
 

Detailed Description

Behaviors associated with robot movement.

Since
September 11, 2011
Author
James McLurkin

Function Documentation

void behaviorSystemInit ( void(*)(void *parameters)  behaviorTask,
uint32  stackSize 
)

Initializes the behavior system task.

Returns
void
uint8 behGetRv ( Beh behPtr)

Gets the input behavior's rotational velocity.

Parameters
behPtrfor behavior
Returns
the rotational velocity of the input behavior
uint8 behGetTv ( Beh behPtr)

Gets translational velocity.

Parameters
behPtrfor behavior
Returns
translational velocity of input behavior
uint8 behIsActive ( Beh behPtr)

Tells whether or not the input behavior is active.

Parameters
behPtrfor behavior
Returns
a 1 if the behavior is active and 0 if inactive
void behSetActive ( Beh behPtr)

Sets the input behavior to active.

Parameters
behPtrfor behavior
Returns
void
void behSetInactive ( Beh behPtr)

Sets the input behavior to inactive.

Parameters
behPtrfor behavior
Returns
void
void behSetRv ( Beh behPtr,
int32  rv 
)

Sets the input behavior's rotational velocity.

Parameters
behPtrfor behavior to update
rvdesired rotational velocity
Returns
void
void behSetTv ( Beh behPtr,
int32  tv 
)

Sets the input behavior's translational velocity.

Parameters
behPtrfor behavior to update
tvdesired translational velocity
Returns
void
void behSetTvRv ( Beh behPtr,
int32  tv,
int32  rv 
)

Sets the input behavior's translational and rotational velocities.

Parameters
behPtrfor behavior to update
tvdesired translational velocity
rvdesired rotational velocity
Returns
void
Beh* behSubsume ( Beh behOutPtr,
Beh behInLoPtr,
Beh behInHighPtr 
)

Subsume a low priority behavior with a high priority one.

Compute behOutPtr by subsuming behInLoPtr with behInHighPtr if behInHighPtr is active. Otherwise, behOutPtr is set to behInLoPtr.

Parameters
behInLoPtrlow-priority input behavior
behInHighPtrhigh-priority input behavior
behOutPtroutput behavior
Returns
behOutPtr
boolean buttonModeRGB ( uint8 *  modePtr,
uint8  modeRed,
uint8  modeGreen,
uint8  modeBlue 
)

Determines if the red, green, or blue button has been pressed.

Updates the input modePtr to indicate which color has been pressed.

Parameters
modePtrfor the mode to update if a button has been pressed
modeRedthe mode that should be set if the red button has been pressed
modeGreenthe mode that should be set if the green button has been pressed
modeBluethe mode that should be set if the blue button has been pressed
Returns
a boolean TRUE if a button has been pressed (and therefore modePtr updated) and FALSE if not
void motorSetBeh ( Beh behPtr)

Moves the robot based on the input motor behavior.

If the input behavior is inactive, the motors are not turned on.

Parameters
behPtrfor desired motor behavior
Returns
void