Kuon  1.1.3
RoadNarrows Robotics Large Outdoor Mobile Robot Project
kuon::KuonDescBase Class Reference

Kuon robotic mobile base escription class. More...

#include <kuonDescBase.h>

Public Member Functions

 KuonDescBase ()
 
 ~KuonDescBase ()
 
void setDesc (int eProdId, const std::string &strProdName="", const std::string &strProdBrief="", const std::string &strHwVer="1.0.0", double fFrontTireRadius=0.0, double fRearTireRadius=0.0)
 
void resetDesc ()
 Reset base description to the "unitialized" values.
 
bool isDescribed ()
 Test if required base description is adequately described. More...
 
int getProdId ()
 Get this base description's base product id. More...
 
std::string getProdName ()
 Get this base description's name. More...
 
std::string getProdBrief ()
 Get this base description's brief. More...
 
std::string getProdHwVer ()
 Get this base description's hardware version. More...
 
int getNumMotors ()
 Get the number of expected and required motors. More...
 
bool hasMotor (int nMotorId)
 Test if motor id is in the list of motors. More...
 

Static Public Member Functions

static const char * getProdName (int eProdId)
 Get the Kuon product name string given the product id. More...
 
static const char * getProdBrief (int eProdId)
 Get the Kuon product one-line brief description string given the product id. More...
 

Protected Attributes

int m_eProdId
 base product id
 
std::string m_strProdFamily
 product name
 
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
 
KuonSpec m_spec
 fixed specification
 

Friends

class KuonDesc
 
class KuonRobot
 

Detailed Description

Kuon robotic mobile base escription class.

Definition at line 79 of file kuonDescBase.h.

Constructor & Destructor Documentation

KuonDescBase::KuonDescBase ( )

Default constructor.

Definition at line 75 of file kuonDescBase.cxx.

References getProdBrief(), getProdName(), kuon::KuonProdIdUnknown, m_eProdId, m_spec, m_strProdBrief, m_strProdHwVer, m_strProdName, m_uProdHwVer, kuon::KuonSpec::set(), and kuon::strToVersion().

75  :
77 {
79  m_uProdHwVer = 0;
80 }
static const int KuonProdIdUnknown
unknown/undefined product id
Definition: kuon.h:144
std::string m_strProdFamily
product name
Definition: kuonDescBase.h:216
uint_t m_uProdHwVer
product hardware version number
Definition: kuonDescBase.h:220
int m_eProdId
base product id
Definition: kuonDescBase.h:215
const char *const KuonProdFamily
product family name
Definition: kuon.h:142
kuon::KuonDescBase::~KuonDescBase ( )
inline

Destructor.

Definition at line 91 of file kuonDescBase.h.

References resetDesc().

92  {
93  }

Member Function Documentation

int kuon::KuonDescBase::getNumMotors ( )
inline

Get the number of expected and required motors.

Returns
Returns number of motors.

Definition at line 176 of file kuonDescBase.h.

References kuon::KuonSpec::getNumMotors(), and m_spec.

Referenced by kuon::KuonRobot::convertSpecs(), and kuon::KuonDesc::getNumMotors().

177  {
178  return m_spec.getNumMotors();
179  }
KuonSpec m_spec
fixed specification
Definition: kuonDescBase.h:221
int getNumMotors()
Get specification&#39;s number of motors.
Definition: kuonSpec.h:209
std::string kuon::KuonDescBase::getProdBrief ( )
inline

Get this base description's brief.

Returns
Returns string.

Definition at line 156 of file kuonDescBase.h.

References m_strProdBrief.

Referenced by hasMotor(), and KuonDescBase().

157  {
158  return m_strProdBrief;
159  }
std::string m_strProdBrief
product brief
Definition: kuonDescBase.h:218
const char * KuonDescBase::getProdBrief ( int  eProdId)
static

Get the Kuon product one-line brief description string given the product id.

Parameters
eProdIdSupported product id. See KuonProdId.
Returns
Returns product description string. An unidentified product id returns "".

Definition at line 123 of file kuonDescBase.cxx.

References kuon::KuonProdIdNarrow, and kuon::KuonProdIdStd.

124 {
125  switch( eProdId )
126  {
127  case KuonProdIdStd:
128  return "RoadNarrows Kuon Standard robotic mobile platform";
129  case KuonProdIdNarrow:
130  return "RoadNarrows Kuon Narrow robotic mobile platform";
131  default:
132  return "";
133  }
134 }
static const int KuonProdIdNarrow
narrow Kuon product id
Definition: kuon.h:146
static const int KuonProdIdStd
standard Kuon product id
Definition: kuon.h:145
std::string kuon::KuonDescBase::getProdHwVer ( )
inline

Get this base description's hardware version.

Returns
Returns string.

Definition at line 166 of file kuonDescBase.h.

References m_strProdHwVer.

Referenced by kuon::KuonRobot::getVersion().

167  {
168  return m_strProdHwVer;
169  }
std::string m_strProdHwVer
product hardware version string
Definition: kuonDescBase.h:219
int kuon::KuonDescBase::getProdId ( )
inline

Get this base description's base product id.

Returns
Returns product id. See KuonProdId.

Definition at line 136 of file kuonDescBase.h.

References m_eProdId.

Referenced by kuon::KuonDesc::getProdId(), kuon::KuonRobot::getProdId(), and kuon::KuonDesc::isDescribed().

137  {
138  return m_eProdId;
139  }
int m_eProdId
base product id
Definition: kuonDescBase.h:215
std::string kuon::KuonDescBase::getProdName ( )
inline

Get this base description's name.

Returns
Returns string.

Definition at line 146 of file kuonDescBase.h.

References m_strProdName.

Referenced by kuon::KuonRobot::getProdName(), hasMotor(), and KuonDescBase().

147  {
148  return m_strProdName;
149  }
std::string m_strProdName
product name
Definition: kuonDescBase.h:217
const char * KuonDescBase::getProdName ( int  eProdId)
static

Get the Kuon product name string given the product id.

Parameters
eProdIdSupported product id. See KuonProdId.
Returns
Returns product name string. An unidentified product id returns "".

Definition at line 110 of file kuonDescBase.cxx.

References kuon::KuonProdIdNarrow, and kuon::KuonProdIdStd.

111 {
112  switch( eProdId )
113  {
114  case KuonProdIdStd:
115  return "Kuon-Standard";
116  case KuonProdIdNarrow:
117  return "Kuon-Narrow";
118  default:
119  return "";
120  }
121 }
static const int KuonProdIdNarrow
narrow Kuon product id
Definition: kuon.h:146
static const int KuonProdIdStd
standard Kuon product id
Definition: kuon.h:145
bool kuon::KuonDescBase::hasMotor ( int  nMotorId)
inline

Test if motor id is in the list of motors.

Parameters
nMotorIdMotor id.
Returns
Returns true or false.

Definition at line 188 of file kuonDescBase.h.

References getProdBrief(), getProdName(), kuon::KuonSpec::hasMotor(), and m_spec.

189  {
190  return m_spec.hasMotor(nMotorId);
191  }
KuonSpec m_spec
fixed specification
Definition: kuonDescBase.h:221
bool hasMotor(int nMotorId)
Test if motor id is in the motor specifications.
Definition: kuonSpec.h:249
bool kuon::KuonDescBase::isDescribed ( )
inline

Test if required base description is adequately described.

Returns
Returns true or false.

Definition at line 126 of file kuonDescBase.h.

References kuon::KuonProdIdUnknown, and m_eProdId.

127  {
128  return (m_eProdId != KuonProdIdUnknown)? true: false;
129  }
static const int KuonProdIdUnknown
unknown/undefined product id
Definition: kuon.h:144
int m_eProdId
base product id
Definition: kuonDescBase.h:215

The documentation for this class was generated from the following files: