Kuon  1.1.3
RoadNarrows Robotics Large Outdoor Mobile Robot Project
kuonDescBase.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Kuon
4 //
5 // Library: libkuon
6 //
7 // File: kuonDescBase.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2014-04-04 17:05:03 -0600 (Fri, 04 Apr 2014) $
12  * $Rev: 3629 $
13  *
14  * \brief Kuon robotic base mobile platform description class interface.
15  *
16  * The base description does not include any payload descriptions.
17  *
18  * \author Robin Knight (robin.knight@roadnarrows.com)
19  *
20  * \copyright
21  * \h_copy 2014-2017. RoadNarrows LLC.\n
22  * http://www.roadnarrows.com\n
23  * All Rights Reserved
24  */
25 /*
26  * @EulaBegin@
27  *
28  * Permission is hereby granted, without written agreement and without
29  * license or royalty fees, to use, copy, modify, and distribute this
30  * software and its documentation for any purpose, provided that
31  * (1) The above copyright notice and the following two paragraphs
32  * appear in all copies of the source code and (2) redistributions
33  * including binaries reproduces these notices in the supporting
34  * documentation. Substantial modifications to this software may be
35  * copyrighted by their authors and need not follow the licensing terms
36  * described here, provided that the new terms are clearly indicated in
37  * all files where they apply.
38  *
39  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY MEMBERS/EMPLOYEES
40  * OF ROADNARROW LLC OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
41  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
42  * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
43  * EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
44  * THE POSSIBILITY OF SUCH DAMAGE.
45  *
46  * THE AUTHOR AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
47  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
48  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
49  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
50  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
51  *
52  * @EulaEnd@
53  */
54 ////////////////////////////////////////////////////////////////////////////////
55 
56 #ifndef _KUON_DESC_BASE_H
57 #define _KUON_DESC_BASE_H
58 
59 #include <vector>
60 
61 #include "rnr/rnrconfig.h"
62 
63 #include "Kuon/kuon.h"
64 #include "Kuon/kuonSpec.h"
65 #include "Kuon/kuonProdBase.h"
66 
67 
68 namespace kuon
69 {
70  //
71  // Forward declarations
72  //
73  class KuonDesc;
74  class KuonRobot;
75 
76  /*!
77  * \brief Kuon robotic mobile base escription class.
78  */
80  {
81  public:
82 
83  /*!
84  * \breif Default constructor.
85  */
86  KuonDescBase();
87 
88  /*!
89  * \breif Destructor.
90  */
92  {
93  }
94 
95  /*
96  * Set \h_kuon's robotic mobile base description.
97  *
98  * \param eProdId \h_kuon base product id. See \ref KuonProdId.
99  * \param strProdName Product name. If string is empty, then the
100  * default name from product id is used.
101  * \param strProdBrief Product brief. If string is empty, then the
102  * default brief from product id is used.
103  * \param strHwVer Hardware version.
104  * \param fFrontTireRadius Radius of front tires (mm). If zero, then
105  * factory defaults are used.
106  * \param fRearTireRadius Radius of rear tires (mm). If zero, then
107  * factory defaults are used.
108  */
109  void setDesc(int eProdId,
110  const std::string &strProdName="",
111  const std::string &strProdBrief="",
112  const std::string &strHwVer="1.0.0",
113  double fFrontTireRadius=0.0,
114  double fRearTireRadius=0.0);
115 
116  /*!
117  * \brief Reset base description to the "unitialized" values.
118  */
119  void resetDesc();
120 
121  /*!
122  * \brief Test if required base description is adequately described.
123  *
124  * \return Returns true or false.
125  */
126  bool isDescribed()
127  {
128  return (m_eProdId != KuonProdIdUnknown)? true: false;
129  }
130 
131  /*!
132  * \brief Get this base description's base product id.
133  *
134  * \return Returns product id. See \ref KuonProdId.
135  */
136  int getProdId()
137  {
138  return m_eProdId;
139  }
140 
141  /*!
142  * \brief Get this base description's name.
143  *
144  * \return Returns string.
145  */
146  std::string getProdName()
147  {
148  return m_strProdName;
149  }
150 
151  /*!
152  * \brief Get this base description's brief.
153  *
154  * \return Returns string.
155  */
156  std::string getProdBrief()
157  {
158  return m_strProdBrief;
159  }
160 
161  /*!
162  * \brief Get this base description's hardware version.
163  *
164  * \return Returns string.
165  */
166  std::string getProdHwVer()
167  {
168  return m_strProdHwVer;
169  }
170 
171  /*!
172  * \brief Get the number of expected and required motors.
173  *
174  * \return Returns number of motors.
175  */
177  {
178  return m_spec.getNumMotors();
179  }
180 
181  /*!
182  * \brief Test if motor id is in the list of motors.
183  *
184  * \param nMotorId Motor id.
185  *
186  * \return Returns true or false.
187  */
188  bool hasMotor(int nMotorId)
189  {
190  return m_spec.hasMotor(nMotorId);
191  }
192 
193  /*!
194  * \brief Get the \h_kuon product name string given the product id.
195  *
196  * \param eProdId Supported product id. See \ref KuonProdId.
197  *
198  * \return Returns product name string. An unidentified product id
199  * returns "".
200  */
201  static const char *getProdName(int eProdId);
202 
203  /*!
204  * \brief Get the \h_kuon product one-line brief description string given
205  * the product id.
206  *
207  * \param eProdId Supported product id. See \ref KuonProdId.
208  *
209  * \return Returns product description string. An unidentified product id
210  * returns "".
211  */
212  static const char *getProdBrief(int eProdId);
213 
214  protected:
215  int m_eProdId; ///< base product id
216  std::string m_strProdFamily; ///< product name
217  std::string m_strProdName; ///< product name
218  std::string m_strProdBrief; ///< product brief
219  std::string m_strProdHwVer; ///< product hardware version string
220  uint_t m_uProdHwVer; ///< product hardware version number
221  KuonSpec m_spec; ///< fixed specification
222 
223  friend class KuonDesc;
224  friend class KuonRobot;
225  };
226 
227 } // namespace kuon
228 
229 #endif // _KUON_DESC_BASE_H
std::string m_strProdHwVer
product hardware version string
Definition: kuonDescBase.h:219
std::string getProdName()
Get this base description&#39;s name.
Definition: kuonDescBase.h:146
KuonSpec m_spec
fixed specification
Definition: kuonDescBase.h:221
Aggregagte of supported Kuon robotic mobile bases static specifications.
int getNumMotors()
Get the number of expected and required motors.
Definition: kuonDescBase.h:176
int getProdId()
Get this base description&#39;s base product id.
Definition: kuonDescBase.h:136
Kuon robotic mobile base escription class.
Definition: kuonDescBase.h:79
Kuon robotic manipulator plus accesories class.
Definition: kuonRobot.h:83
std::string getProdHwVer()
Get this base description&#39;s hardware version.
Definition: kuonDescBase.h:166
static const int KuonProdIdUnknown
unknown/undefined product id
Definition: kuon.h:144
The <b><i>Kuon</i></b> namespace encapsulates all <b><i>Kuon</i></b> related constructs.
Definition: kuon.h:66
bool hasMotor(int nMotorId)
Test if motor id is in the motor specifications.
Definition: kuonSpec.h:249
<b><i>Kuon</i></b> product specification base classes.
RoadNarrows Kuon robot top-level header file.
std::string m_strProdFamily
product name
Definition: kuonDescBase.h:216
bool hasMotor(int nMotorId)
Test if motor id is in the list of motors.
Definition: kuonDescBase.h:188
std::string m_strProdName
product name
Definition: kuonDescBase.h:217
Kuon robotic manipulator full description class.
Definition: kuonDesc.h:83
void resetDesc()
Reset base description to the "unitialized" values.
uint_t m_uProdHwVer
product hardware version number
Definition: kuonDescBase.h:220
bool isDescribed()
Test if required base description is adequately described.
Definition: kuonDescBase.h:126
int m_eProdId
base product id
Definition: kuonDescBase.h:215
int getNumMotors()
Get specification&#39;s number of motors.
Definition: kuonSpec.h:209
std::string m_strProdBrief
product brief
Definition: kuonDescBase.h:218
std::string getProdBrief()
Get this base description&#39;s brief.
Definition: kuonDescBase.h:156
Robotic specification.
Definition: kuonSpec.h:151