Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekState.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Hekateros
4 //
5 // Library: libhekateros
6 //
7 // File: hekState.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2014-09-18 16:53:49 -0600 (Thu, 18 Sep 2014) $
12  * $Rev: 3748 $
13  *
14  * \brief Hekateros Robot State classes 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_STATE_H
51 #define _HEK_STATE_H
52 
53 #include <string>
54 #include <vector>
55 
56 #include "rnr/rnrconfig.h"
57 
58 #include "Dynamixel/Dynamixel.h"
59 
60 #include "Hekateros/hekateros.h"
61 
62 namespace hekateros
63 {
64  // ---------------------------------------------------------------------------
65  // Class HekServoHealth
66  // ---------------------------------------------------------------------------
67 
68  /*!
69  * \brief Robot servo health.
70  */
72  {
73  public:
74  /*!
75  * \brief Default constructor.
76  */
78 
79  /*!
80  * \brief Copy constructor.
81  */
82  HekServoHealth(const HekServoHealth &src);
83 
84  /*!
85  * \brief Destructor.
86  */
88  {
89  }
90 
91  /*!
92  * \brief Assignment operator.
93  *
94  * \param rhs Right hand side object.
95  *
96  * \return Returns copy of this.
97  */
99 
100  int m_nServoId; ///< servo id
101  float m_fTemperature; ///< servo temperature (Celsius)
102  float m_fVoltage; ///< servo voltage (volts)
103  uint_t m_uAlarms; ///< servo alarms
104  };
105 
106 
107  // ---------------------------------------------------------------------------
108  // Class HekRobotState
109  // ---------------------------------------------------------------------------
110 
111  /*!
112  * \brief Robot overall state.
113  */
115  {
116  public:
117  typedef std::vector<HekServoHealth> VecHealth;
118 
119  /*!
120  * \brief Default constructor.
121  */
123  {
124  clear();
125  }
126 
127  /*!
128  * \brief Copy constructor.
129  */
130  HekRobotState(const HekRobotState &src);
131 
132  /*!
133  * \brief Destructor.
134  */
136  {
137  }
138 
139  /*!
140  * \brief Assignment operator.
141  *
142  * \param rhs Right hand side object.
143  *
144  * \return Returns copy of this.
145  */
147 
148  /*!
149  * \brief Clear data.
150  */
151  void clear();
152 
153  HekRobotMode m_eRobotMode; ///< robot operating mode
154  HekTriState m_eIsCalibrated; ///< robot is [not] calibrated
155  HekTriState m_eIsEStopped; ///< robot is [not] emergency stopped
156  HekTriState m_eAreDrivesPowered; ///< servos are [not] powered
157  HekTriState m_eIsMotionPossible; ///< motion is [not] possible
158  HekTriState m_eIsInMotion; ///< robot is [not] moving
159  HekTriState m_eIsInError; ///< robot is [not] in error condition
160  int m_nErrorCode; ///< hekateros error code
161  VecHealth m_vecServoHealth; ///< servos' health
162  };
163 
164 } // namespace hekateros
165 
166 #endif // _HEK_STATE_H
Robot overall state.
Definition: hekState.h:114
int m_nServoId
servo id
Definition: hekState.h:100
int m_nErrorCode
hekateros error code
Definition: hekState.h:160
HekServoHealth operator=(const HekServoHealth &rhs)
Assignment operator.
Definition: hekState.cxx:89
~HekServoHealth()
Destructor.
Definition: hekState.h:87
HekRobotState()
Default constructor.
Definition: hekState.h:122
VecHealth m_vecServoHealth
servos&#39; health
Definition: hekState.h:161
HekTriState m_eIsInError
robot is [not] in error condition
Definition: hekState.h:159
HekTriState m_eIsEStopped
robot is [not] emergency stopped
Definition: hekState.h:155
HekRobotMode
<b><i>Hekateros</i></b> mode of operation.
Definition: hekateros.h:506
float m_fTemperature
servo temperature (Celsius)
Definition: hekState.h:101
uint_t m_uAlarms
servo alarms
Definition: hekState.h:103
HekTriState
<b><i>Hekateros</i></b> tri-state type.
Definition: hekateros.h:479
float m_fVoltage
servo voltage (volts)
Definition: hekState.h:102
HekRobotMode m_eRobotMode
robot operating mode
Definition: hekState.h:153
~HekRobotState()
Destructor.
Definition: hekState.h:135
Top-level package include file.
HekServoHealth()
Default constructor.
Definition: hekState.cxx:73
HekTriState m_eIsInMotion
robot is [not] moving
Definition: hekState.h:158
Robot servo health.
Definition: hekState.h:71
HekTriState m_eIsMotionPossible
motion is [not] possible
Definition: hekState.h:157
HekTriState m_eAreDrivesPowered
servos are [not] powered
Definition: hekState.h:156
HekTriState m_eIsCalibrated
robot is [not] calibrated
Definition: hekState.h:154
The <b><i>Hekateros</i></b> namespace encapsulates all <b><i>Hekateros</i></b> related constructs...
Definition: hekateros.h:56