Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekDescArm.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Hekateros
4 //
5 // Library: libhekateros
6 //
7 // File: hekDescArm.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2014-09-18 16:53:49 -0600 (Thu, 18 Sep 2014) $
12  * $Rev: 3748 $
13  *
14  * \brief HekDescArm - Hekateros robotic arm description class interface.
15  *
16  * The arm description does not include any end effector description nor
17  * the equipment deck and auxiliary effector descriptions.
18  *
19  * \author Robin Knight (robin.knight@roadnarrows.com)
20  * \author Daniel Packard (daniel@roadnarrows.com)
21  * \author Rob Shiely (rob@roadnarrows.com)
22  *
23  * \copyright
24  * \h_copy 2012-2017. RoadNarrows LLC.\n
25  * http://www.roadnarrows.com\n
26  * All Rights Reserved
27  */
28 /*
29  * @EulaBegin@
30  *
31  * Unless otherwise stated explicitly, all materials contained are copyrighted
32  * and may not be used without RoadNarrows LLC's written consent,
33  * except as provided in these terms and conditions or in the copyright
34  * notice (documents and software) or other proprietary notice provided with
35  * the relevant materials.
36  *
37  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
38  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
39  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
40  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
41  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
42  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43  *
44  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
45  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
46  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
47  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
48  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
49  *
50  * @EulaEnd@
51  */
52 ////////////////////////////////////////////////////////////////////////////////
53 
54 #ifndef _HEK_DESC_ARM_H
55 #define _HEK_DESC_ARM_H
56 
57 #include <vector>
58 
59 #include "rnr/rnrconfig.h"
60 
61 #include "Hekateros/hekateros.h"
62 #include "Hekateros/hekSpec.h"
63 #include "Hekateros/hekProdArm.h"
64 
65 
66 namespace hekateros
67 {
68  //
69  // Forward declarations
70  //
71  class HekDesc;
72  class HekRobot;
73 
74  /*!
75  * \brief Hekateros robotic arm (manipulator) description class.
76  */
77  class HekDescArm
78  {
79  public:
80 
81  /*!
82  * \breif Default constructor.
83  */
84  HekDescArm();
85 
86  /*!
87  * \breif Destructor.
88  */
90  {
91  }
92 
93  /*
94  * Set \h_hek's robotic base description.
95  *
96  * \param eProdId \h_hek base product id. See \ref HekProdId.
97  * \param strProdName Product name. If string is empty, then the default
98  * name from product id is used.
99  * \param strProdBrief Product brief. If string is empty, then the default
100  * brief from product id is used.
101  * \param strHwVer Hardware version.
102  * \param nDoF Degrees of Freedom. If 0, then the value
103  * encoded in the product id is used.
104  * \param eProdSize Product size. If HekProdSizeUnknown, then the value
105  * encoded in the product id is used.
106  * See \ref HekProdSize.
107  */
108  void setDesc(int eProdId,
109  const std::string &strProdName="",
110  const std::string &strProdBrief="",
111  const std::string &strHwVer="1.0.0",
112  int nDoF=0,
113  int eProdSize=HekProdSizeUnknown);
114 
115  /*!
116  * \brief Reset base description to the "unitialized" values.
117  */
118  void resetDesc();
119 
120  /*!
121  * \brief Test if required base description is adequately described.
122  *
123  * \return Returns true or false.
124  */
125  bool isDescribed()
126  {
127  return (m_eProdId != HekProdIdUnknown)? true: false;
128  }
129 
130  /*!
131  * \brief Get this base description's base product id.
132  *
133  * \return Returns product id. See \ref HekProdId.
134  */
135  int getProdId()
136  {
137  return m_eProdId;
138  }
139 
140  /*!
141  * \brief Get this base description's name.
142  *
143  * \return Returns string.
144  */
145  std::string getProdName()
146  {
147  return m_strProdName;
148  }
149 
150  /*!
151  * \brief Get this base description's brief.
152  *
153  * \return Returns string.
154  */
155  std::string getProdBrief()
156  {
157  return m_strProdBrief;
158  }
159 
160  /*!
161  * \brief Get this base description's hardware version.
162  *
163  * \return Returns string.
164  */
165  std::string getProdHwVer()
166  {
167  return m_strProdHwVer;
168  }
169 
170  /*!
171  * \brief Get this base description's size.
172  *
173  * \return Returns product size. See \ref HekProdSize.
174  */
176  {
177  return m_eProdSize;
178  }
179 
180  /*!
181  * \brief Get this base description's degrees of freedom.
182  *
183  * \return Returns DoF.
184  */
185  int getDoF()
186  {
187  return m_nDoF;
188  }
189 
190  /*!
191  * \brief Get the number of expected and required servos.
192  *
193  * \return Returns number of servos.
194  */
196  {
197  return m_spec.getNumServos();
198  }
199 
200  /*!
201  * \brief Test if servo id is in the list of servos.
202  *
203  * \param nServoId Servo id.
204  *
205  * \return Returns true or false.
206  */
207  bool hasServo(int nServoId)
208  {
209  return m_spec.hasServo(nServoId);
210  }
211 
212  /*!
213  * \brief Get the \h_hek product name string given the product id.
214  *
215  * \param eProdId Supported product id. See \ref HekProdId.
216  *
217  * \return Returns product name string.
218  * An unidentified product id returns "".
219  */
220  static const char *getProdName(int eProdId);
221 
222  /*!
223  * \brief Get the \h_hek product one-line brief description string given the
224  * product id.
225  *
226  * \param eProdId Supported product id. See \ref HekProdId.
227  *
228  * \return Returns product description string.
229  * An unidentified product id returns "".
230  */
231  static const char *getProdBrief(int eProdId);
232 
233  /*!
234  * \brief Get the \h_hek base size given the product id.
235  *
236  * \param eProdId Supported product id. See \ref HekProdId.
237  *
238  * \return Returns product size value.
239  * An unidentified product id returns HekProdSizeUknown.
240  */
241  static int getProdSize(int eProdId);
242 
243  /*!
244  * \brief Get the \h_hek base degrees of freedom given the product id.
245  *
246  * \param eProdId Supported product id. See \ref HekProdId.
247  *
248  * \return Returns the degrees of freedom.
249  */
250  static int getDoF(int eProdId);
251 
252  protected:
253  int m_eProdId; ///< base product id
254  std::string m_strProdName; ///< product name
255  std::string m_strProdBrief; ///< product brief
256  std::string m_strProdHwVer; ///< product hardware version string
257  uint_t m_uProdHwVer; ///< product hardware version number
258  int m_eProdSize; ///< product size code
259  int m_nDoF; ///< degrees of freedom
260  HekSpec m_spec; ///< fixed specification
261 
262  friend class HekDesc;
263  friend class HekRobot;
264  };
265 
266 } // namespace hekaeros
267 
268 #endif // _HEK_DESC_ARM_H
std::string m_strProdBrief
product brief
Definition: hekDescArm.h:255
int m_eProdSize
product size code
Definition: hekDescArm.h:258
std::string getProdBrief()
Get this base description&#39;s brief.
Definition: hekDescArm.h:155
bool hasServo(int nServoId)
Test if servo id is in the servo specifications.
Definition: hekSpec.cxx:305
Robotic specification.
Definition: hekSpec.h:232
const int HekProdIdUnknown
unknown/undefined product id
Definition: hekateros.h:219
int m_nDoF
degrees of freedom
Definition: hekDescArm.h:259
bool hasServo(int nServoId)
Test if servo id is in the list of servos.
Definition: hekDescArm.h:207
int m_eProdId
base product id
Definition: hekDescArm.h:253
std::string m_strProdName
product name
Definition: hekDescArm.h:254
HekSpec m_spec
fixed specification
Definition: hekDescArm.h:260
void resetDesc()
Reset base description to the "unitialized" values.
Definition: hekDescArm.cxx:98
int getNumServos()
Get the number of expected and required servos.
Definition: hekDescArm.h:195
int getNumServos()
Get specification&#39;s number of servos.
Definition: hekSpec.h:323
Hekateros robotic arm (manipulator) description class.
Definition: hekDescArm.h:77
uint_t m_uProdHwVer
product hardware version number
Definition: hekDescArm.h:257
Hekateros robotic manipulator full description class.
Definition: hekDesc.h:75
std::string getProdHwVer()
Get this base description&#39;s hardware version.
Definition: hekDescArm.h:165
Top-level package include file.
bool isDescribed()
Test if required base description is adequately described.
Definition: hekDescArm.h:125
int getProdSize()
Get this base description&#39;s size.
Definition: hekDescArm.h:175
<b><i>Hekateros</i></b> product specification base classes.
Hekateros robotic manipulator plus accesories class.
Definition: hekRobot.h:88
std::string getProdName()
Get this base description&#39;s name.
Definition: hekDescArm.h:145
Aggregagte of supported Hekateros robotic arms static specifications.
std::string m_strProdHwVer
product hardware version string
Definition: hekDescArm.h:256
int getProdId()
Get this base description&#39;s base product id.
Definition: hekDescArm.h:135
The <b><i>Hekateros</i></b> namespace encapsulates all <b><i>Hekateros</i></b> related constructs...
Definition: hekateros.h:56
int getDoF()
Get this base description&#39;s degrees of freedom.
Definition: hekDescArm.h:185