cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
robJoint.h
Go to the documentation of this file.
1 /*
2 
3  Author(s): Simon Leonard
4  Created on: November 11 2009
5 
6  (C) Copyright 2008 Johns Hopkins University (JHU), All Rights
7  Reserved.
8 
9 --- begin cisst license - do not edit ---
10 
11 This software is provided "as is" under an open source license, with
12 no warranty. The complete license can be found in license.txt and
13 http://www.cisst.org/cisst/license.txt.
14 
15 --- end cisst license ---
16 */
17 
18 #ifndef _robJoint_h
19 #define _robJoint_h
20 
21 #include <iostream>
22 #include <cisstConfig.h>
23 
24 #if CISST_HAS_JSON
25 #include <json/json.h>
26 #endif
27 
28 #include <cisstRobot/robExport.h>
29 
31 
36 
37  public:
38 
39  enum Type{
40  UNDEFINED, // no clue
41  HINGE, // revolute joint
42  SLIDER, // prismatic joint
43  UNIVERSAL, // universal joint
44  BALLSOCKET // ball and socket joint
45  };
46 
48 
51  enum Mode{
53  PASSIVE
54  };
55 
56  enum Errno{
58  EFAILURE
59  };
60 
61 private:
62 
64 
67  robJoint::Type type;
68 
70 
73  robJoint::Mode mode;
74 
76  double qoffset;
77 
79  double qmin;
80 
82  double qmax;
83 
85  double ftmax;
86 
87 public:
88 
90  robJoint();
92  robJoint::Mode mode,
93  double offset,
94  double min,
95  double max,
96  double ftmax );
97 
98 
100 
103  robJoint::Type GetType() const;
104 
106 
109  robJoint::Mode GetMode() const;
110 
112 
116  double GetPosition() const;
117 
119 
123  double GetVelocity() const;
124 
126 
130  double GetForceTorque() const;
131 
133 
138  void SetPosition( double q );
139 
141 
146  void SetVelocity( double qd );
147 
149 
154  void SetForceTorque( double ft );
155 
157 
160  double PositionOffset() const;
161 
163 
166  double PositionMin() const;
167 
169 
172  double PositionMax() const;
173 
175 
179  double ForceTorqueMax() const;
180 
182 
188  virtual robJoint::Errno Read( std::istream& is );
189 #if CISST_HAS_JSON
190  virtual robJoint::Errno Read( const Json::Value &config );
191 #endif
192 
194 
199  virtual robJoint::Errno Write( std::ostream& os ) const;
200 
201 };
202 
203 #endif
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Definition: robJoint.h:57
Mode
Joint modes.
Definition: robJoint.h:51
Definition: robJoint.h:43
Definition: robJoint.h:41
Definition: robJoint.h:40
Type
Definition: robJoint.h:39
Joint types.
Definition: robJoint.h:35
Definition: robJoint.h:42
Definition: robJoint.h:52
Errno
Definition: robJoint.h:56