Behaviors associated with robot movement.
More...
Go to the source code of this file.
|
typedef struct Beh | Beh |
| Structure for robot behaviors.
|
|
|
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...
|
|
Beh * | behSubsume (Beh *behOutPtr, Beh *behInLoPtr, Beh *behInHighPtr) |
| Subsume a low priority behavior with a high priority one. More...
|
|
Behaviors associated with robot movement.
- Since
- September 11, 2011
- Author
- James McLurkin
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
-
- Returns
- the rotational velocity of the input behavior
uint8 behGetTv |
( |
Beh * |
behPtr) | |
|
Gets translational velocity.
- Parameters
-
- Returns
- translational velocity of input behavior
uint8 behIsActive |
( |
Beh * |
behPtr) | |
|
Tells whether or not the input behavior is active.
- Parameters
-
- Returns
- a 1 if the behavior is active and 0 if inactive
void behSetActive |
( |
Beh * |
behPtr) | |
|
Sets the input behavior to active.
- Parameters
-
- Returns
- void
void behSetInactive |
( |
Beh * |
behPtr) | |
|
Sets the input behavior to inactive.
- Parameters
-
- Returns
- void
void behSetRv |
( |
Beh * |
behPtr, |
|
|
int32 |
rv |
|
) |
| |
Sets the input behavior's rotational velocity.
- Parameters
-
behPtr | for behavior to update |
rv | desired rotational velocity |
- Returns
- void
void behSetTv |
( |
Beh * |
behPtr, |
|
|
int32 |
tv |
|
) |
| |
Sets the input behavior's translational velocity.
- Parameters
-
behPtr | for behavior to update |
tv | desired translational velocity |
- Returns
- void
void behSetTvRv |
( |
Beh * |
behPtr, |
|
|
int32 |
tv, |
|
|
int32 |
rv |
|
) |
| |
Sets the input behavior's translational and rotational velocities.
- Parameters
-
behPtr | for behavior to update |
tv | desired translational velocity |
rv | desired 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
-
behInLoPtr | low-priority input behavior |
behInHighPtr | high-priority input behavior |
behOutPtr | output 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
-
modePtr | for the mode to update if a button has been pressed |
modeRed | the mode that should be set if the red button has been pressed |
modeGreen | the mode that should be set if the green button has been pressed |
modeBlue | the 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
-
behPtr | for desired motor behavior |
- Returns
- void