Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekDesc.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Hekateros
4 //
5 // Library: libhekateros
6 //
7 // File: hekDesc.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2014-09-18 16:53:49 -0600 (Thu, 18 Sep 2014) $
12  * $Rev: 3748 $
13  *
14  * \brief HekDesc - Hekateros full robotic manipulator descripition class
15  * interface.
16  *
17  * \author Robin Knight (robin.knight@roadnarrows.com)
18  * \author Daniel Packard (daniel@roadnarrows.com)
19  *
20  * \copyright
21  * \h_copy 2012-2017. RoadNarrows LLC.\n
22  * http://www.roadnarrows.com\n
23  * All Rights Reserved
24  */
25 /*
26  * @EulaBegin@
27  *
28  * Unless otherwise stated explicitly, all materials contained are copyrighted
29  * and may not be used without RoadNarrows LLC's written consent,
30  * except as provided in these terms and conditions or in the copyright
31  * notice (documents and software) or other proprietary notice provided with
32  * the relevant materials.
33  *
34  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
35  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
36  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
37  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
38  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
39  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
42  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
43  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
44  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
45  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
46  *
47  * @EulaEnd@
48  */
49 ////////////////////////////////////////////////////////////////////////////////
50 
51 #ifndef _HEK_DESC_H
52 #define _HEK_DESC_H
53 
54 #include <math.h>
55 #include <vector>
56 
57 #include "Hekateros/hekateros.h"
58 #include "Hekateros/hekDescArm.h"
59 #include "Hekateros/hekDescEE.h"
60 
61 
62 namespace hekateros
63 {
64  //
65  // Forward declaraions.
66  //
67  class HekRobot;
68 
69  /*!
70  * \brief Hekateros robotic manipulator full description class.
71  *
72  * The description is determined from the XML etc configuration file. From
73  * those description components, the compiled specifications are assigned.
74  */
75  class HekDesc
76  {
77  public:
78 
79  /*!
80  * \breif Default constructor.
81  */
83  {
84  }
85 
86  /*!
87  * \breif Destructor.
88  */
90  {
91  }
92 
93  /*
94  * Set \h_hek's robotic arm (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 setArmDesc(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  m_descArm.setDesc(eProdId, strProdName, strProdBrief, strHwVer,
116  nDoF, eProdSize);
117  }
118 
119  /*
120  * Set \h_hek's end effector tool description.
121  *
122  * \param eProdId \h_hek end effector product id.
123  * See \ref HekEEProdId.
124  * \param strProdName Product name. If string is empty, then the default
125  * name from product id is used.
126  * \param strProdBrief Product brief. If string is empty, then the default
127  * brief from product id is used.
128  * \param strHwVer Hardware version.
129  * \param nDoF Degrees of Freedom. If 0, then the value
130  * encoded in the product id is used.
131  * \param eProdSize Product size. If HekProdSizeUnknown, then the value
132  * encoded in the product id is used.
133  * See \ref HekProdSize.
134  */
135  void setEEDesc(int eEEProdId,
136  const std::string &strProdName="",
137  const std::string &strProdBrief="",
138  const std::string &strHwVer="1.0.0",
139  int nDoF=0,
140  int eProdSize=HekProdSizeUnknown)
141  {
142  m_descEE.setDesc(eEEProdId, strProdName, strProdBrief, strHwVer,
143  nDoF, eProdSize);
144  }
145 
146  /*!
147  * \brief Reset \h_hek description to the "unitialized" values.
148  */
149  void resetDesc();
150 
151  /*!
152  * \brief Mark \h_hek hardware as fully described.
153  *
154  * The calling application context determines this state.
155  *
156  * \copydoc doc_return_std
157  */
158  int markAsDescribed();
159 
160  /*!
161  * \brief Test if required descriptions are described.
162  *
163  * \return Returns true or false.
164  */
165  bool isDescribed()
166  {
167  return m_bIsDescribed &&
169  (m_descEE.getProdId() != HekProdIdUnknown)? true: false;
170  }
171 
172  /*!
173  * \brief Get the \h_hek base product description.
174  *
175  * \return Returns pointer to robotic base description.
176  */
178  {
179  return &m_descArm;
180  }
181 
182  /*!
183  * \brief Get the \h_hek end effector product description.
184  *
185  * \return Returns pointer to end effector description.
186  */
188  {
189  return &m_descEE;
190  }
191 
192  /*!
193  * \brief Convenience function to get this \h_hek description's base
194  * product id.
195  *
196  * \return Returns product id. See \ref HekProdId.
197  */
198  int getProdId()
199  {
200  return m_descArm.getProdId();
201  }
202 
203  /*!
204  * \brief Get the \h_hek full brief descirption.
205  *
206  * \return Returns string.
207  */
208  std::string getFullProdBrief()
209  {
210  return m_strFullBrief;
211  }
212 
213  /*!
214  * \brief Check if this \h_hek description has an end effector description.
215  *
216  * \return Returns true or false.
217  */
219  {
220  return m_descEE.getProdId() != HekProdIdUnknown? true: false;
221  }
222 
223  /*!
224  * \brief Get this \h_hek description's total degrees of freedom.
225  *
226  * \return Returns DoF.
227  */
228  int getDoF()
229  {
230  return m_descArm.getDoF() + m_descEE.getDoF();
231  }
232 
233  /*!
234  * \brief Get the number of expected and required servos.
235  *
236  * \return Returns number of servos.
237  */
239  {
241  }
242 
243  /*!
244  * \brief Test if servo id is in the list of servos.
245  *
246  * \return Returns true or false.
247  */
248  bool hasServo(int nServoId);
249 
250  protected:
251  bool m_bIsDescribed; ///< \h_hek is [not] fully described
252  HekDescArm m_descArm; ///< \h_hek robotic arm
253  HekDescEE m_descEE; ///< \h_hek end effector tool
254  //HekDescEquip m_descEquip; ///< \h_hek equipment deck
255  //HekDescAux m_descAux; ///< \h_hek base auxilliary hardware
256  std::string m_strFullBrief; ///< product with accessories full brief
257 
258  friend class HekRobot;
259  };
260 
261 } // namespace hekaeros
262 
263 #endif // _HEK_DESC_H
Hekateros end effector tool description class.
Definition: hekDescEE.h:71
int getNumServos()
Get the number of expected and required servos.
Definition: hekDescEE.h:190
HekDescEE m_descEE
<b><i>Hekateros</i></b> end effector tool
Definition: hekDesc.h:253
HekDescArm m_descArm
<b><i>Hekateros</i></b> robotic arm
Definition: hekDesc.h:252
const int HekProdIdUnknown
unknown/undefined product id
Definition: hekateros.h:219
int markAsDescribed()
Mark <b><i>Hekateros</i></b> hardware as fully described.
Definition: hekDesc.cxx:74
void resetDesc()
Reset <b><i>Hekateros</i></b> description to the "unitialized" values.
Definition: hekDesc.cxx:66
int getDoF()
Get this end effector description&#39;s degrees of freedom.
Definition: hekDescEE.h:180
bool hasServo(int nServoId)
Test if servo id is in the list of servos.
Definition: hekDesc.cxx:97
HekDescArm * getArmDesc()
Get the <b><i>Hekateros</i></b> base product description.
Definition: hekDesc.h:177
bool hasEndEffector()
Check if this <b><i>Hekateros</i></b> description has an end effector description.
Definition: hekDesc.h:218
int getNumServos()
Get the number of expected and required servos.
Definition: hekDescArm.h:195
Hekateros robotic arm (manipulator) description class.
Definition: hekDescArm.h:77
std::string m_strFullBrief
product with accessories full brief
Definition: hekDesc.h:256
Hekateros robotic manipulator full description class.
Definition: hekDesc.h:75
HekDescEE * getEEDesc()
Get the <b><i>Hekateros</i></b> end effector product description.
Definition: hekDesc.h:187
Top-level package include file.
int getProdId()
Get this end effector description&#39;s product id.
Definition: hekDescEE.h:130
HekDescEE - Hekateros end effector tool description class interface.
int getNumServos()
Get the number of expected and required servos.
Definition: hekDesc.h:238
int getDoF()
Get this <b><i>Hekateros</i></b> description&#39;s total degrees of freedom.
Definition: hekDesc.h:228
HekDescArm - Hekateros robotic arm description class interface.
int getProdId()
Convenience function to get this <b><i>Hekateros</i></b> description&#39;s base product id...
Definition: hekDesc.h:198
Hekateros robotic manipulator plus accesories class.
Definition: hekRobot.h:88
bool isDescribed()
Test if required descriptions are described.
Definition: hekDesc.h:165
bool m_bIsDescribed
<b><i>Hekateros</i></b> is [not] fully described
Definition: hekDesc.h:251
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
std::string getFullProdBrief()
Get the <b><i>Hekateros</i></b> full brief descirption.
Definition: hekDesc.h:208