cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
robLink.h
Go to the documentation of this file.
1 /*
2  Author(s): Simon Leonard
3  Created on: Nov 11 2009
4 
5  (C) Copyright 2008-2014 Johns Hopkins University (JHU), All Rights
6  Reserved.
7 
8 --- begin cisst license - do not edit ---
9 
10 This software is provided "as is" under an open source license, with
11 no warranty. The complete license can be found in license.txt and
12 http://www.cisst.org/cisst/license.txt.
13 
14 --- end cisst license ---
15 */
16 
17 #ifndef _robLink_h
18 #define _robLink_h
19 
20 #include <iostream>
21 
23 #include <cisstRobot/robMass.h>
24 
25 #if CISST_HAS_JSON
26 #include <json/json.h>
27 #endif
28 
29 #include <cisstRobot/robExport.h>
30 
32 
39 
40  protected:
41 
44 
45  public:
46 
47  enum Errno { ESUCCESS, EFAILURE };
48 
50  robLink();
51 
53  robLink( const robLink& link );
54 
56  robLink( robKinematics* kinematics, const robMass& mass );
57 
59  ~robLink();
60 
62 
82  robLink::Errno Read( std::istream& is );
83 
84 #if CISST_HAS_JSON
85  robLink::Errno Read( const Json::Value & linkConfig );
86 #endif
87 
89  robLink::Errno Write( std::ostream& os ) const;
90 
91  vctFrame4x4<double> ForwardKinematics( double q ) const;
92 
93 
94  vctFixedSizeVector<double,3> PStar() const;
95  vctMatrixRotation3<double> Orientation( double q ) const;
96 
97  robKinematics* GetKinematics() const;
98  robMass GetMass() const;
99 
100  robKinematics::Convention GetConvention() const;
101 
102  robJoint::Type GetType() const;
103 
104  double Mass() const { return mass.Mass(); }
105 
107  { return mass.CenterOfMass(); }
108 
110  { return mass.MomentOfInertiaAtCOM(); }
111 
113  { return mass.MomentOfInertia(); }
114 
115  double PositionMin() const {
116  if( kinematics != NULL ) { return kinematics->PositionMin(); }
117  return 0.0;
118  }
119 
120  double PositionMax() const {
121  if( kinematics != NULL ) { return kinematics->PositionMax(); }
122  return 0.0;
123  }
124 
125  double ForceTorqueMax() const {
126  if( kinematics != NULL ) { return kinematics->ForceTorqueMax(); }
127  return 0.0;
128  }
129 
130 };
131 
132 #endif // _robLink_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Definition: robMass.h:30
Convention
Kinematics convention.
Definition: robKinematics.h:25
Definition: robKinematics.h:18
Type
Definition: robJoint.h:39