![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
Laelaps robotic mobile platform full description class. More...
#include <laeDesc.h>
Public Types | |
typedef std::map< std::string, LaeDescPowertrain * > | MapDescPowertrain |
typedef std::map< std::string, LaeDescRangeSensor * > | MapDescRangeSensor |
Public Member Functions | |
LaeDesc () | |
virtual | ~LaeDesc () |
int | markAsDescribed () |
Mark Laelaps hardware as fully described. More... | |
void | clear () |
Clear description to the "unitialized" values. | |
bool | isDescribed () const |
Test if required base description is adequately described. More... | |
int | getProdId () const |
Get this base description's base product id. More... | |
std::string | getProdName () const |
Get this base description's name. More... | |
std::string | getProdBrief () const |
Get this base description's brief. More... | |
std::string | getProdHwVerString () const |
Get this robot's hardware version string. More... | |
uint_t | getProdHwVer () const |
Get this robot's packed hardware version number. More... | |
void | print (int indent=0) |
Print out description to stdout. More... | |
Static Public Member Functions | |
static std::string | prettyMotorCtlrName (int nCtlrId) |
Create pretty motor controller identifier string. More... | |
static std::string | prettyMotorCtlrName (int nCtlrId, byte_t addr) |
Create pretty motor controller identifier string. More... | |
static std::string | prettyMotorName (int nMotorId) |
Create pretty motor/powertrain identifier string. More... | |
static std::string | prettyMotorName (int nCtlrId, byte_t addr, int nMotorId) |
Create pretty motor/powertrain identifier string. More... | |
static const char * | getProdName (int eProdId) |
Get the Laelaps product name string given the product id. More... | |
static const char * | getProdBrief (int eProdId) |
Get the Laelaps product one-line brief description string given the product id. More... | |
Public Attributes | |
bool | m_bIsDescribed |
Laelaps is [not] fully described | |
int | m_eProdId |
base product id | |
std::string | m_strProdFamily |
product family | |
std::string | m_strProdModel |
product model | |
std::string | m_strProdName |
product name | |
std::string | m_strProdBrief |
product brief | |
std::string | m_strProdHwVer |
product hardware version string | |
uint_t | m_uProdHwVer |
product hardware version number | |
LaeDescOptions | m_options |
LaeDescBase * | m_pDescBase |
base description | |
LaeDescBattery * | m_pDescBattery |
internal battery description | |
MapDescPowertrain | m_mapDescPowertrain |
powertrain descriptions | |
MapDescRangeSensor | m_mapDescRangeSensor |
range sensor descriptions | |
LaeDescImu * | m_pDescImu |
built-in imu description | |
Static Public Attributes | |
static const char *const | KeyRobotBase = "platform" |
robot base key | |
static const char *const | KeyBattery = "battery" |
internal battery key | |
static const char *const | KeyMotorCtlr [] |
motor controller keys More... | |
static const char *const | KeyPowertrain [] |
powertrain keys More... | |
static const char *const | KeyImu = "imu" |
built-in IMU keys | |
static const char *const | KeyRangeSensorMax [] |
max range sensor keys More... | |
static const char *const | KeyRangeSensorStd [] |
std range sensor keys More... | |
static const char *const | KeyFCam = "fcam" |
front camera keys | |
Protected Member Functions | |
void | setVersion () |
Set version number from parsed version string. | |
Laelaps robotic mobile platform full description class.
The description is determined from the XML etc configuration file. From those description components, the compiled description are assigned.
typedef std::map<std::string, LaeDescPowertrain*> laelaps::LaeDesc::MapDescPowertrain |
typedef std::map<std::string, LaeDescRangeSensor*> laelaps::LaeDesc::MapDescRangeSensor |
LaeDesc::LaeDesc | ( | ) |
Default constructor.
Definition at line 655 of file laeDesc.cxx.
References laelaps::LaeProdIdUnknown, m_bIsDescribed, m_eProdId, m_pDescBase, m_pDescBattery, m_pDescImu, and m_uProdHwVer.
|
virtual |
Destructor.
Definition at line 667 of file laeDesc.cxx.
References clear().
|
inline |
Get this base description's brief.
Definition at line 588 of file laeDesc.h.
Referenced by laelaps::LaeRobot::getFullProdBrief().
|
static |
Get the Laelaps product one-line brief description string given the product id.
eProdId | Supported product id. See LaeProdId. |
Definition at line 808 of file laeDesc.cxx.
References laelaps::LaeProdIdLarge, and laelaps::LaeProdIdStd.
|
inline |
Get this robot's packed hardware version number.
Definition at line 608 of file laeDesc.h.
References laelaps::LaeDescBase::print().
Referenced by laelaps::LaeRobot::connSensors(), and laelaps::LaeRobot::getVersion().
|
inline |
Get this robot's hardware version string.
Definition at line 598 of file laeDesc.h.
Referenced by laelaps::LaeRobot::getVersionString().
|
inline |
Get this base description's base product id.
Definition at line 568 of file laeDesc.h.
Referenced by laelaps::LaeRobot::getProdId().
|
inline |
Get this base description's name.
Definition at line 578 of file laeDesc.h.
Referenced by laelaps::LaeRobot::getProdName().
|
static |
Get the Laelaps product name string given the product id.
eProdId | Supported product id. See LaeProdId. |
Definition at line 795 of file laeDesc.cxx.
References laelaps::LaeProdIdLarge, and laelaps::LaeProdIdStd.
|
inline |
Test if required base description is adequately described.
Definition at line 558 of file laeDesc.h.
Referenced by laelaps::LaeRobot::connect(), and laelaps::LaeRobot::isDescribed().
int LaeDesc::markAsDescribed | ( | ) |
Mark Laelaps hardware as fully described.
The calling application context determines this state.
Definition at line 672 of file laeDesc.cxx.
References KeyPowertrain, KeyRangeSensorMax, KeyRangeSensorStd, laelaps::LAE_ECODE_BAD_OP, laelaps::LAE_OK, LAE_VERSION, laelaps::LaeMotorsNumOf, laelaps::LaeProdIdLarge, laelaps::LaeProdIdStd, laelaps::LaeProdIdUnknown, m_bIsDescribed, laelaps::LaeDbProduct::m_eProdId, m_eProdId, m_mapDescPowertrain, m_mapDescRangeSensor, m_pDescBase, m_pDescBattery, m_pDescImu, laelaps::LaeDb::m_product, laelaps::LaeDescOptions::m_strPkgToF, m_strProdHwVer, laelaps::LaeDbProduct::m_uProdHwVer, m_uProdHwVer, laelaps::LaeDescOptions::PkgOptDeluxe, laelaps::RtDb, setVersion(), laelaps::ToFSensorMaxNumOf, and laelaps::ToFSensorStdNumOf.
Referenced by main(), and mainInit().
|
static |
Create pretty motor controller identifier string.
nCtlrId | Unique motor controller id. |
Definition at line 596 of file laeDesc.cxx.
References KeyMotorCtlr.
Referenced by prettyMotorName().
|
static |
Create pretty motor controller identifier string.
nCtlrId | Unique motor controller id. |
addr | Motor controller packet address. |
Definition at line 610 of file laeDesc.cxx.
References KeyMotorCtlr.
|
static |
Create pretty motor/powertrain identifier string.
nMotorId | Unique motor id. |
Definition at line 626 of file laeDesc.cxx.
References KeyPowertrain.
Referenced by prettyMotorName().
|
static |
Create pretty motor/powertrain identifier string.
nCtlrId | Unique motor controller id. |
addr | Motor controller packet address. |
nMotorId | Unique motor id. |
Definition at line 645 of file laeDesc.cxx.
References prettyMotorCtlrName(), and prettyMotorName().
void LaeDesc::print | ( | int | indent = 0 | ) |
Print out description to stdout.
indent | Left indentation. |
Definition at line 821 of file laeDesc.cxx.
References m_eProdId, m_mapDescPowertrain, m_mapDescRangeSensor, m_pDescBase, m_pDescBattery, m_pDescImu, m_strProdBrief, m_strProdFamily, m_strProdHwVer, m_strProdModel, m_strProdName, m_uProdHwVer, laelaps::LaeDescBase::print(), laelaps::LaeDescBattery::print(), and laelaps::LaeDescImu::print().
Referenced by mainInit().
|
static |
motor controller keys
Definition at line 462 of file laeDesc.h.
Referenced by laelaps::LaeTunes::LaeTunes(), prettyMotorCtlrName(), and laelaps::LaeDescOptions::print().
|
static |
powertrain keys
Definition at line 463 of file laeDesc.h.
Referenced by markAsDescribed(), prettyMotorName(), and laelaps::LaeDescOptions::print().
|
static |
max range sensor keys
Definition at line 465 of file laeDesc.h.
Referenced by laelaps::LaeTunes::LaeTunes(), markAsDescribed(), and laelaps::LaeDescOptions::print().
|
static |
std range sensor keys
Definition at line 466 of file laeDesc.h.
Referenced by markAsDescribed(), and laelaps::LaeDescOptions::print().