cisst-saw
Loading...
Searching...
No Matches
robJoint.h
Go to the documentation of this file.
1/*
2 Author(s): Simon Leonard
3 Created on: November 11 2009
4
5 (C) Copyright 2008-2024 Johns Hopkins University (JHU), All Rights Reserved.
6
7--- begin cisst license - do not edit ---
8
9This software is provided "as is" under an open source license, with
10no warranty. The complete license can be found in license.txt and
11http://www.cisst.org/cisst/license.txt.
12
13--- end cisst license ---
14*/
15
16#ifndef _robJoint_h
17#define _robJoint_h
18
19#include <iostream>
20#include <cisstConfig.h>
22
23#if CISST_HAS_JSON
24#include <json/json.h>
25#endif
26
28
30
33
35
36 public:
37
38 // for backward compatibility
45
47
54
59
60private:
61
62 std::string name;
63
65
68 cmnJointType type;
69
71
74 robJoint::Mode mode;
75
77 double qoffset;
78
80 double qmin;
81
83 double qmax;
84
86 double ftmax;
87
88public:
89
93 robJoint::Mode mode,
94 double offset,
95 double min,
96 double max,
97 double ftmax );
98
99 // class with virtual methods should have a virtual destructor
100 inline virtual ~robJoint() {};
101
102 inline const std::string & Name(void) const {
103 return name;
104 }
105 inline std::string & Name(void) {
106 return name;
107 }
108
110
114
116
120
122
126 double GetPosition() const;
127
129
133 double GetVelocity() const;
134
136
140 double GetForceTorque() const;
141
143
148 void SetPosition( double q );
149
151
156 void SetVelocity( double qd );
157
159
164 void SetForceTorque( double ft );
165
167
170 double PositionOffset() const;
171 void SetPositionOffset(const double offset);
172
174
177 const double & PositionMin(void) const;
178 double & PositionMin(void);
179
181
184 const double & PositionMax(void) const;
185 double & PositionMax(void);
186
188
192 const double & ForceTorqueMax(void) const;
193 double & ForceTorqueMax(void);
194
196
202 virtual robJoint::Errno Read( std::istream& is );
203#if CISST_HAS_JSON
204 virtual robJoint::Errno Read( const Json::Value &config );
205#endif
206
208
213 virtual robJoint::Errno Write( std::ostream& os ) const;
214
215};
216
217#endif
double GetForceTorque() const
Return the joint force or torque.
cmnJointType GetType() const
Return the type of the joint.
static const cmnJointType HINGE
Definition robJoint.h:41
static const cmnJointType UNDEFINED
Definition robJoint.h:40
double GetPosition() const
Return the joint position.
virtual robJoint::Errno Read(std::istream &is)
Read from an input stream.
double & PositionMin(void)
robJoint(cmnJointType type, robJoint::Mode mode, double offset, double min, double max, double ftmax)
cmnJointType Type
Definition robJoint.h:39
robJoint::Mode GetMode() const
Return the mode of the joint.
double GetVelocity() const
Return the joint velocity.
std::string & Name(void)
Definition robJoint.h:105
double & PositionMax(void)
robJoint()
Default constructor.
Errno
Definition robJoint.h:55
@ ESUCCESS
Definition robJoint.h:56
@ EFAILURE
Definition robJoint.h:57
void SetPosition(double q)
Set the joint position.
const std::string & Name(void) const
Definition robJoint.h:102
virtual robJoint::Errno Write(std::ostream &os) const
Read from an input stream.
const double & PositionMax(void) const
Return the maximum position.
Mode
Joint modes.
Definition robJoint.h:50
@ ACTIVE
Definition robJoint.h:51
@ PASSIVE
Definition robJoint.h:52
void SetForceTorque(double ft)
Set the force/torque.
void SetVelocity(double qd)
Set the joint velocity.
virtual ~robJoint()
Definition robJoint.h:100
double & ForceTorqueMax(void)
double PositionOffset() const
Return the offset position.
const double & PositionMin(void) const
Return the minimum position.
static const cmnJointType SLIDER
Definition robJoint.h:42
static const cmnJointType UNIVERSAL
Definition robJoint.h:43
const double & ForceTorqueMax(void) const
Return the maximum force/torque.
static const cmnJointType BALLSOCKET
Definition robJoint.h:44
void SetPositionOffset(const double offset)
#define CISST_EXPORT
Definition cmnExportMacros.h:50
cmnJointType
Definition cmnJointType.h:29
@ CMN_JOINT_PRISMATIC
Definition cmnJointType.h:29
@ CMN_JOINT_REVOLUTE
Definition cmnJointType.h:29
@ CMN_JOINT_BALL_SOCKET
Definition cmnJointType.h:29
@ CMN_JOINT_UNDEFINED
Definition cmnJointType.h:29
@ CMN_JOINT_UNIVERSAL
Definition cmnJointType.h:29