Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekDesc.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Hekateros
4 //
5 // Library: libhekateros
6 //
7 // File: hekDesc.cxx
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2014-09-18 16:53:49 -0600 (Thu, 18 Sep 2014) $
12  * $Rev: 3748 $
13  *
14  * \brief Hekateros full description.
15  *
16  * \author Robin Knight (robin.knight@roadnarrows.com)
17  *
18  * \copyright
19  * \h_copy 2013-2017. RoadNarrows LLC.\n
20  * http://www.roadnarrows.com\n
21  * All Rights Reserved
22  */
23 /*
24  * @EulaBegin@
25  *
26  * Unless otherwise stated explicitly, all materials contained are copyrighted
27  * and may not be used without RoadNarrows LLC's written consent,
28  * except as provided in these terms and conditions or in the copyright
29  * notice (documents and software) or other proprietary notice provided with
30  * the relevant materials.
31  *
32  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
33  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
34  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
35  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
36  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
37  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *
39  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
40  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
41  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
42  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
43  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
44  *
45  * @EulaEnd@
46  */
47 ////////////////////////////////////////////////////////////////////////////////
48 
49 #include <stdio.h>
50 
51 #include <string>
52 #include <vector>
53 
54 #include "rnr/rnrconfig.h"
55 #include "rnr/log.h"
56 
57 #include "Hekateros/hekateros.h"
58 #include "Hekateros/hekDescArm.h"
59 #include "Hekateros/hekDescEE.h"
60 #include "Hekateros/hekDesc.h"
61 
62 using namespace std;
63 using namespace hekateros;
64 
65 
66 void HekDesc::resetDesc()
67 {
68  m_descArm.resetDesc();
69  m_descEE.resetDesc();
70  m_strFullBrief.clear();
71  m_bIsDescribed = false;
72 }
73 
74 int HekDesc::markAsDescribed()
75 {
76  if( !m_descArm.isDescribed() )
77  {
78  LOGERROR("Hekateros base description is undefined.");
79  return -HEK_ECODE_BAD_OP;
80  }
81 
82  if( !m_descEE.isDescribed() )
83  {
84  LOGERROR("Hekateros end effector description is undefined.");
85  return -HEK_ECODE_BAD_OP;
86  }
87 
88  m_strFullBrief = m_descArm.getProdBrief() +
89  " with " +
90  m_descEE.getProdBrief();
91 
92  m_bIsDescribed = true;
93 
94  return HEK_OK;
95 }
96 
97 bool HekDesc::hasServo(int nServoId)
98 {
99  if( m_descArm.hasServo(nServoId) )
100  {
101  return true;
102  }
103  else if( m_descEE.hasServo(nServoId) )
104  {
105  }
106  else
107  {
108  return false;
109  }
110 }
111 
112 
113 
114 #ifdef RDK_REDO
115 void hekDesc::setServoOffset(int servoId, int servoOffset) {
116  m_servoOffsets[servoId] = servoOffset;
117 }
118 
119 void hekDesc::setServoLimCW(int servoId, int servoMin) {
120  m_servosLimCW[servoId] = servoMin;
121 }
122 
123 void hekDesc::setServoLimCCW(int servoId, int servoMax) {
124  m_servosLimCCW[servoId] = servoMax;
125 }
126 #endif // RDK_REDO
HekDesc - Hekateros full robotic manipulator descripition class interface.
Top-level package include file.
HekDescEE - Hekateros end effector tool description class interface.
HekDescArm - Hekateros robotic arm description class interface.
The <b><i>Hekateros</i></b> namespace encapsulates all <b><i>Hekateros</i></b> related constructs...
Definition: hekateros.h:56