![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
Laelaps kinematics base action class. More...
#include <laeKin.h>
Public Types | |
enum | ActionType { ActionTypeIdle, ActionTypeVelocity, ActionTypeDutyCycle, ActionTypeTwist, ActionTypeNavForDist, ActionTypeNavToPos } |
Supported kinematic extended actions. More... | |
enum | ActionState { ActionStateIdle, ActionStateUpdate, ActionStatePlan, ActionStateExecute, ActionStateTerminated } |
Action states. More... | |
Public Member Functions | |
LaeKinAction (LaeKinematics &kin, ActionType eActionType=ActionTypeIdle) | |
Default intialization constructor. More... | |
virtual | ~LaeKinAction () |
Destructor. | |
virtual int | plan () |
Plan next execution. More... | |
virtual int | execute () |
Execution [sub]action. More... | |
virtual int | terminate () |
Terminate action. More... | |
virtual bool | isIdle () |
Test if action is idle. More... | |
virtual bool | isPlanningRequired () |
Test if action requires (re)planning. More... | |
virtual bool | isExecutionRequired () const |
Test if more action requires (more) execution. More... | |
virtual bool | hasTerminated () const |
Test if action has been terminated. More... | |
virtual ActionType | getActionType () const |
Get the action type for this class. More... | |
virtual ActionState | getActionState () const |
Get the action state. More... | |
Static Public Member Functions | |
static LaeKinAction * | newAction (LaeKinematics &kin, const ActionType eActionType) |
Archetype constructor to create action type instance. More... | |
static LaeKinAction * | replaceAction (LaeKinematics &kin, LaeKinAction *pAction, const ActionType eNewActionType) |
Archetype constructor to replace action type instance. More... | |
Protected Attributes | |
LaeKinematics & | m_kin |
bound kinematics driver | |
ActionType | m_eActionType |
action type enum | |
ActionState | m_eActionState |
action state. | |
Laelaps kinematics base action class.
An action spans multiple kinematic control cycles. For example, navigating to a goal position.
The base class has no action.
enum laelaps::LaeKinAction::ActionState |
enum laelaps::LaeKinAction::ActionType |
Supported kinematic extended actions.
Definition at line 780 of file laeKin.h.
|
inline |
Default intialization constructor.
kin | Bound kinemeatics driver. |
eAction | Action type. |
Definition at line 808 of file laeKin.h.
|
inlinevirtual |
Execution [sub]action.
Hardware is updated as needed.
Reimplemented in laelaps::LaeKinActionTwist, laelaps::LaeKinActionDutyCycle, and laelaps::LaeKinActionVelocity.
Definition at line 866 of file laeKin.h.
References laelaps::LAE_OK.
Referenced by laelaps::LaeKinActionVelocity::execute(), laelaps::LaeKinActionDutyCycle::execute(), and laelaps::LaeKinActionTwist::execute().
|
inlinevirtual |
Get the action state.
Definition at line 942 of file laeKin.h.
|
inlinevirtual |
Get the action type for this class.
Definition at line 932 of file laeKin.h.
|
inlinevirtual |
Test if action has been terminated.
Definition at line 922 of file laeKin.h.
Referenced by laelaps::LaeKinActionVelocity::terminate(), laelaps::LaeKinActionDutyCycle::terminate(), and laelaps::LaeKinActionTwist::terminate().
|
inlinevirtual |
Test if more action requires (more) execution.
Definition at line 909 of file laeKin.h.
Referenced by laelaps::LaeKinActionVelocity::execute(), laelaps::LaeKinActionDutyCycle::execute(), laelaps::LaeKinActionTwist::execute(), laelaps::LaeKinematics::setGoalDutyCycles(), laelaps::LaeKinematics::setGoalTwist(), and laelaps::LaeKinematics::setGoalVelocities().
|
inlinevirtual |
Test if action is idle.
Definition at line 889 of file laeKin.h.
|
inlinevirtual |
Test if action requires (re)planning.
Definition at line 899 of file laeKin.h.
Referenced by laelaps::LaeKinActionVelocity::plan(), laelaps::LaeKinActionTwist::plan(), laelaps::LaeKinematics::setGoalDutyCycles(), laelaps::LaeKinematics::setGoalTwist(), and laelaps::LaeKinematics::setGoalVelocities().
|
static |
Archetype constructor to create action type instance.
kin | Bound kinemeatics driver. |
eAction | Action type to create. |
Definition at line 1638 of file laeKin.cxx.
|
inlinevirtual |
Plan next execution.
No hardware is touched.
Reimplemented in laelaps::LaeKinActionTwist, and laelaps::LaeKinActionVelocity.
Definition at line 854 of file laeKin.h.
References laelaps::LAE_OK.
Referenced by laelaps::LaeKinActionVelocity::plan(), laelaps::LaeKinActionTwist::plan(), and laelaps::LaeKinematics::setGoalDutyCycles().
|
static |
Archetype constructor to replace action type instance.
kin | Bound kinemeatics driver. |
pAction | Pointer to current action to be terminated and deleted. The pointer is no long valid after this function returns. |
eAction | New action type to create. |
Definition at line 1659 of file laeKin.cxx.
References terminate().
|
inlinevirtual |
Terminate action.
Hardware is updated as needed. The robot should be stopped.
Reimplemented in laelaps::LaeKinActionTwist, laelaps::LaeKinActionDutyCycle, and laelaps::LaeKinActionVelocity.
Definition at line 878 of file laeKin.h.
References laelaps::LAE_OK.
Referenced by replaceAction(), laelaps::LaeKinActionVelocity::terminate(), laelaps::LaeKinActionDutyCycle::terminate(), and laelaps::LaeKinActionTwist::terminate().