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