![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
Laelaps kinematics velocity action class. More...
#include <laeKin.h>
Public Member Functions | |
| LaeKinActionVelocity (LaeKinematics &kin) | |
| Default initialization constructor. More... | |
| virtual | ~LaeKinActionVelocity () |
| Destructor. | |
| int | update (const LaeMapVelocity &velocity) |
| Update with new velocities. More... | |
| virtual int | plan () |
| Plan next execution. More... | |
| virtual int | execute () |
| Execution new velocities. More... | |
| virtual int | terminate () |
| Terminate action. More... | |
Public Member Functions inherited from laelaps::LaeKinAction | |
| LaeKinAction (LaeKinematics &kin, ActionType eActionType=ActionTypeIdle) | |
| Default intialization constructor. More... | |
| virtual | ~LaeKinAction () |
| Destructor. | |
| 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... | |
Protected Member Functions | |
| void | clear () |
| Clear goal. | |
Protected Attributes | |
| LaeMapVelocity | m_mapGoalVel |
| map of goal velocities | |
| s32_t | m_speed [LaeNumMotorCtlrs][LaeNumMotorsPerCtlr] |
| target motor speeds (qpps) | |
Protected Attributes inherited from laelaps::LaeKinAction | |
| LaeKinematics & | m_kin |
| bound kinematics driver | |
| ActionType | m_eActionType |
| action type enum | |
| ActionState | m_eActionState |
| action state. | |
Additional Inherited Members | |
Public Types inherited from laelaps::LaeKinAction | |
| enum | ActionType { ActionTypeIdle, ActionTypeVelocity, ActionTypeDutyCycle, ActionTypeTwist, ActionTypeNavForDist, ActionTypeNavToPos } |
| Supported kinematic extended actions. More... | |
| enum | ActionState { ActionStateIdle, ActionStateUpdate, ActionStatePlan, ActionStateExecute, ActionStateTerminated } |
| Action states. More... | |
Static Public Member Functions inherited from laelaps::LaeKinAction | |
| 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... | |
Laelaps kinematics velocity action class.
A velocity action only sets the velocities of a (sub)set of the powertrain velocities. Powertrains not specified are kept at their current velocities.
| LaeKinActionVelocity::LaeKinActionVelocity | ( | LaeKinematics & | kin | ) |
Default initialization constructor.
| kin | Bound kinemeatics driver. |
Definition at line 1677 of file laeKin.cxx.
References clear().
|
virtual |
Execution new velocities.
All motors with new velocities are written with new speeds.
Reimplemented from laelaps::LaeKinAction.
Definition at line 1785 of file laeKin.cxx.
References laelaps::LaeKinAction::ActionStateIdle, motor::roboclaw::RoboClaw::cmdQDriveWithAccel(), laelaps::LaeKinAction::execute(), laelaps::LaeKinematics::getMotorCtlr(), laelaps::LaeKinAction::isExecutionRequired(), laelaps::LAE_ECODE_MOT_CTLR, laelaps::LAE_OK, laelaps::LaeMotorLeft, laelaps::LaeMotorRight, laelaps::LaeNumMotorCtlrs, laelaps::LaeKinAction::m_eActionState, laelaps::LaeKinAction::m_kin, and m_speed.
Referenced by laelaps::LaeKinematics::setGoalVelocities().
|
virtual |
Plan next execution.
If new velocities, the motor quad pulse per second are calculated.
Reimplemented from laelaps::LaeKinAction.
Definition at line 1727 of file laeKin.cxx.
References laelaps::LaeKinAction::ActionStateExecute, laelaps::LaeKinAction::ActionStateIdle, laelaps::LaePowertrain::getName(), laelaps::LaeKinematics::getPowertrain(), laelaps::LaeKinAction::isPlanningRequired(), laelaps::LAE_OK, laelaps::LaeNumMotorCtlrs, laelaps::LaeNumMotorsPerCtlr, laelaps::LaePowertrain::m_attr, laelaps::LaeKinAction::m_eActionState, laelaps::LaePowertrainAttr::m_fWheelRadsPerPulse, laelaps::LaeKinAction::m_kin, m_mapGoalVel, laelaps::LaePowertrainState::m_nSpeed, m_speed, laelaps::LaePowertrain::m_state, and laelaps::LaeKinAction::plan().
Referenced by laelaps::LaeKinematics::setGoalVelocities().
|
virtual |
Terminate action.
All motors are stopped.
Reimplemented from laelaps::LaeKinAction.
Definition at line 1823 of file laeKin.cxx.
References clear(), motor::roboclaw::RoboClaw::cmdStopWithDecel(), laelaps::LaeKinematics::getMotorCtlr(), laelaps::LaeKinAction::hasTerminated(), laelaps::LAE_OK, laelaps::LaeNumMotorCtlrs, laelaps::LaeKinAction::m_kin, and laelaps::LaeKinAction::terminate().
| int LaeKinActionVelocity::update | ( | const LaeMapVelocity & | velocity | ) |
Update with new velocities.
| velocity | Map of powertrain velocities. |
Definition at line 1683 of file laeKin.cxx.
References laelaps::LaeKinAction::ActionStateIdle, laelaps::LaeKinAction::ActionStatePlan, laelaps::LaeKinAction::ActionStateUpdate, laelaps::LAE_OK, laelaps::LaeKinAction::m_eActionState, and m_mapGoalVel.
Referenced by laelaps::LaeKinematics::setGoalVelocities().