![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
Powertrain data class. More...
#include <laePowertrain.h>
Public Member Functions | |
| LaePowertrain () | |
| Default constructor. | |
| LaePowertrain (const LaePowertrain &src) | |
| Copy constructor. | |
| ~LaePowertrain () | |
| Destructor. | |
| LaePowertrain | operator= (const LaePowertrain &rhs) |
| Assignment operator. More... | |
| std::string | getName () const |
| Get this powertrain unique name (key). More... | |
| int | getMotorId () const |
| Get motor id. More... | |
| int | getMotorCtlrId () const |
| Get motor controller id. More... | |
| int | getMotorIndex () const |
| Get motor controller motor index. More... | |
| virtual int | configure (const LaeDescPowertrain &desc) |
| Configure powertrain from product description. More... | |
| virtual int | configure (const LaeTunes &tunes) |
| Configure powertrain from tune parameters. 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 (s64_t nEncoder, s32_t nSpeed, double fAmps, uint_t uBufLen) |
| Update state dynamics. More... | |
| virtual int | updateHealth (double fVolts, double fTemp, uint_t uCtlrStatus) |
| Update motor health state. More... | |
Static Public Member Functions | |
| static int | toMotorId (const int nCtlrId, const int nMotorIndex) |
| Map motor controller id and motor index to motor id. More... | |
| static std::string | toKey (const int nCtlrId, const int nMotorIndex) |
| Map motor controller id and motor index to powertrain name (key). More... | |
| static std::string | toKey (const int nMotorId) |
| Map motor id to powertrain name (key). More... | |
Public Attributes | |
| std::string | m_strName |
| powertrain unique name (key) | |
| LaePowertrainAttr | m_attr |
| semi-fixed attribute data | |
| LaePowertrainState | m_state |
| dynamic state data | |
Powertrain data class.
This class encapsulates the fixed data and current state of one powertrain.
Definition at line 196 of file laePowertrain.h.
|
virtual |
Configure powertrain from product description.
| desc | Laelaps powertrain product description data. |
Definition at line 296 of file laePowertrain.cxx.
References laelaps::LaeDescPowertrain::m_eJointType, laelaps::LaeDescPowertrain::m_fGearRatio, laelaps::LaeDescPowertrain::m_nDir, laelaps::LaeDescPowertrain::m_nMotorCtlrId, laelaps::LaeDescPowertrain::m_nMotorId, laelaps::LaeDescPowertrain::m_nMotorIndex, laelaps::LaeDescPowertrain::m_strKey, and M_TAU.
Referenced by laelaps::LaeKinematics::configure().
|
virtual |
Configure powertrain from tune parameters.
| tunes | Laelaps tuning parameters. |
Definition at line 325 of file laePowertrain.cxx.
References laelaps::LaeTunes::getTireDimParams().
|
inline |
Get motor controller id.
Definition at line 283 of file laePowertrain.h.
References laelaps::LaePowertrainAttr::m_nMotorCtlrId.
|
inline |
Get motor id.
Definition at line 273 of file laePowertrain.h.
References laelaps::LaePowertrainAttr::m_nMotorId.
|
inline |
Get motor controller motor index.
Definition at line 293 of file laePowertrain.h.
References laelaps::LaePowertrainAttr::m_nMotorIndex.
|
inline |
Get this powertrain unique name (key).
Definition at line 263 of file laePowertrain.h.
Referenced by laelaps::LaeKinActionDutyCycle::execute(), and laelaps::LaeKinActionVelocity::plan().
| LaePowertrain LaePowertrain::operator= | ( | const LaePowertrain & | rhs | ) |
Assignment operator.
| rhs | Right hand side object. |
Definition at line 231 of file laePowertrain.cxx.
References m_attr, m_state, and m_strName.
|
virtual |
Reload tuning parameters and re-configure.
| tunes | Laelaps tuning parameters. |
Definition at line 340 of file laePowertrain.cxx.
|
virtual |
Reset odometry to zero.
All related positioning data are reset to 0.
Definition at line 345 of file laePowertrain.cxx.
Referenced by laelaps::LaeKinematics::resetOdometers().
|
static |
Map motor controller id and motor index to powertrain name (key).
| nCtrlId | Motor controller id. |
| nMotorIndex | Motor controller motor index |
Definition at line 273 of file laePowertrain.cxx.
|
static |
Map motor id to powertrain name (key).
| nMotorId | Motor id. |
Definition at line 282 of file laePowertrain.cxx.
|
static |
Map motor controller id and motor index to motor id.
| nCtrlId | Motor controller id. |
| nMotorIndex | Motor controller motor index |
Definition at line 240 of file laePowertrain.cxx.
|
virtual |
Update motor health state.
| fVolts | Motor input voltage (V). |
| fTemp | Motor controller board voltage (V). |
| uCtlrStatus | Motor controller status bits. |
Definition at line 407 of file laePowertrain.cxx.
References motor::roboclaw::ParamStatusErrLogicBattHigh, motor::roboclaw::ParamStatusErrLogicBattLow, motor::roboclaw::ParamStatusErrMainBattHigh, motor::roboclaw::ParamStatusErrMot1Fault, motor::roboclaw::ParamStatusErrMot2Fault, motor::roboclaw::ParamStatusErrTemp, motor::roboclaw::ParamStatusEStopped, motor::roboclaw::ParamStatusNormal, motor::roboclaw::ParamStatusWarnMainBattHigh, motor::roboclaw::ParamStatusWarnMainBattLow, motor::roboclaw::ParamStatusWarnMot1OverCur, motor::roboclaw::ParamStatusWarnMot2OverCur, and motor::roboclaw::ParamStatusWarnTemp.
Referenced by laelaps::LaeKinematics::monitorHealth().
|
virtual |
Update state dynamics.
| nEncoder | Current encoder position (quad pulses). |
| nSpeed | Current motor speed (qpps). |
| fAmps | Current motor draw (amperes). |
| uBufLen | Current command queue length. |
Definition at line 353 of file laePowertrain.cxx.
References laelaps::fcap(), and motor::roboclaw::ParamAmpMax.
Referenced by laelaps::LaeKinematics::senseDynamics().