![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
Robot platform control and state data class. More...
#include <laePlatform.h>
Public Types | |
enum | Idx { IdxPrev = 0, IdxCur = 1, HistSize = 2 } |
Working indices and sizes. More... | |
Public Member Functions | |
LaePlatform () | |
Default constructor. | |
LaePlatform (const LaePlatform &src) | |
Copy constructor. | |
~LaePlatform () | |
Destructor. | |
LaePlatform | operator= (const LaePlatform &rhs) |
Assignment operator. More... | |
void | clear () |
Clear data sans name. | |
std::string | getPlatformName () const |
Get robot platform name. More... | |
virtual int | configure (const LaeDescBase &desc) |
Configure robot platform from product description. More... | |
virtual int | configure (const LaeTunes &tunes) |
Configure platform. More... | |
virtual int | reload (const LaeTunes &tunes) |
Reload tuning parameters and re-configure. More... | |
virtual int | resetOdometer () |
Reset odometry to zero. More... | |
virtual int | updateStateDynamics (const LaeMapPowertrain &mapPowertrains) |
Update robot platform state dynamics. More... | |
virtual int | updateCtlrHealth (int nCtlr, double fVolts, double fTemp, uint_t uStatus) |
Update robot platform motor controller health state. More... | |
virtual int | updateHealth (const LaeMapPowertrain &mapPowertrains) |
Update robot platform health state. More... | |
virtual void | clearPoses () |
Clear pose history. | |
virtual void | pushNewPose (const LaePose &pose) |
Push a new pose on the pose history. More... | |
Public Attributes | |
std::string | m_strName |
robot platform name | |
Dim | m_dimRobot |
total dimensions of robot (TODO) | |
Dim | m_dimBody |
dimensions of robot body | |
double | m_fWheelbase |
wheelbase (m) | |
double | m_fWheeltrack |
wheeltrack (m) | |
double | m_fPosLast [LaeMotorsNumOf] |
last sensed wheel positions (radians) | |
LaePose | m_pose [HistSize] |
robot pose (meters, meters, radians) | |
double | m_fOdometer |
robot odometer (meters) | |
double | m_fVelocity |
robot velocity (meters/second) | |
double | m_fAmpsMotors |
total draw from all motors (A) | |
double | m_fVoltsAvg |
average sensed battery voltage (V) | |
double | m_fTempAvg |
average sensed interior tempature (C) | |
LaeMotorCtlrState | m_ctlr [LaeNumMotorCtlrs] |
motor controllers' state | |
Robot platform control and state data class.
Definition at line 127 of file laePlatform.h.
enum laelaps::LaePlatform::Idx |
Working indices and sizes.
Enumerator | |
---|---|
IdxPrev |
index of previous history |
IdxCur |
index of current state |
HistSize |
size of history |
Definition at line 133 of file laePlatform.h.
|
virtual |
Configure robot platform from product description.
desc | Laelaps robot base product description data. |
Definition at line 218 of file laePlatform.cxx.
References laelaps::LaeDescBase::m_dimBody, m_dimBody, laelaps::LaeDescBase::m_dimRobot, m_dimRobot, laelaps::LaeDescBase::m_fWheelbase, m_fWheelbase, laelaps::LaeDescBase::m_fWheeltrack, and m_fWheeltrack.
Referenced by reload().
|
virtual |
Configure platform.
tunes | Laelaps tuning parameters. |
Definition at line 227 of file laePlatform.cxx.
References laelaps::LaeDescBase::calcDimensions(), laelaps::LaeTunes::getTireDimParams(), laelaps::LAE_OK, laelaps::LaeKeyLeftFront, laelaps::LaeDescBase::m_dimBody, m_dimBody, laelaps::LaeDescBase::m_dimRobot, m_dimRobot, laelaps::LaeDescBase::m_fWheelbase, m_fWheelbase, laelaps::LaeDescBase::m_fWheeltrack, and m_fWheeltrack.
|
inline |
Get robot platform name.
Definition at line 199 of file laePlatform.h.
References laelaps::LaeMotorCtlrState::m_strName.
LaePlatform LaePlatform::operator= | ( | const LaePlatform & | rhs | ) |
Assignment operator.
rhs | Right hand side object. |
Definition at line 149 of file laePlatform.cxx.
References HistSize, laelaps::LaeMotorsNumOf, laelaps::LaeNumMotorCtlrs, m_ctlr, m_dimBody, m_dimRobot, m_fAmpsMotors, m_fOdometer, m_fPosLast, m_fTempAvg, m_fVelocity, m_fVoltsAvg, m_fWheelbase, m_fWheeltrack, m_pose, and m_strName.
|
virtual |
Push a new pose on the pose history.
The history is aged first.
pose | New pose. |
Definition at line 471 of file laePlatform.cxx.
References IdxCur, IdxPrev, and m_pose.
Referenced by updateStateDynamics().
|
virtual |
Reload tuning parameters and re-configure.
tunes | Laelaps tuning parameters. |
Definition at line 245 of file laePlatform.cxx.
References configure().
|
virtual |
Reset odometry to zero.
All related positioning data are reset to 0.
Definition at line 250 of file laePlatform.cxx.
References clearPoses(), laelaps::LaeMotorsNumOf, m_fOdometer, and m_fPosLast.
|
virtual |
Update robot platform motor controller health state.
nCtlr | Motor controller id. |
fVolts | Motor input voltage (V). |
fTemp | Motor controller board voltage (V). |
uCtlrStatus | Motor controller status bits. |
Definition at line 414 of file laePlatform.cxx.
References laelaps::LAE_ECODE_BAD_VAL, laelaps::LAE_OK, laelaps::LaeNumMotorCtlrs, m_ctlr, laelaps::LaeMotorCtlrState::m_fBoardTemp, laelaps::LaeMotorCtlrState::m_fMainVolts, and laelaps::LaeMotorCtlrState::m_uStatus.
|
virtual |
Update robot platform health state.
mapPowertrains | Powertrain kinodynamics. |
Definition at line 432 of file laePlatform.cxx.
References laelaps::LAE_OK, laelaps::LaePowertrainState::m_fAmps, m_fAmpsMotors, laelaps::LaePowertrainState::m_fTemp, laelaps::LaeDbRobotStatus::m_fTempAvg, m_fTempAvg, laelaps::LaePowertrainState::m_fVolts, m_fVoltsAvg, laelaps::LaeDb::m_robotstatus, laelaps::LaePowertrain::m_state, and laelaps::RtDb.
|
virtual |
Update robot platform state dynamics.
mapPowertrains | Powertrain kinodynamics. |
Definition at line 264 of file laePlatform.cxx.
References IdxCur, IdxPrev, laelaps::LAE_OK, laelaps::LaeMotorIdLF, laelaps::LaeMotorIdLR, laelaps::LaeMotorIdRF, laelaps::LaeMotorIdRR, laelaps::LaeMotorsNumOf, laelaps::LaePowertrain::m_attr, laelaps::LaePowertrainAttr::m_fMetersPerRadian, m_fOdometer, laelaps::LaeDbKinRobot::m_fOdometer, laelaps::LaePowertrainState::m_fPosition, m_fPosLast, m_fVelocity, laelaps::LaePowertrainState::m_fVelocity, laelaps::LaeDbKinRobot::m_fVelocity, m_fWheelbase, laelaps::LaeDb::m_kin, laelaps::LaePowertrainAttr::m_nMotorId, m_pose, laelaps::LaeDbKin::m_robot, laelaps::LaePowertrain::m_state, M_TAU, laelaps::LaePose::m_theta, laelaps::LaeDbKinRobot::m_theta, laelaps::LaePose::m_x, laelaps::LaeDbKinRobot::m_x, laelaps::LaePose::m_y, laelaps::LaeDbKinRobot::m_y, pushNewPose(), and laelaps::RtDb.