spatial-dyn
joint.h
1 
10 #ifndef SPATIAL_DYN_STRUCTS_JOINT_H_
11 #define SPATIAL_DYN_STRUCTS_JOINT_H_
12 
13 #include <limits> // std::numeric_limits
14 #include <ostream> // std::ostream
15 #include <string> // std::string
16 
17 #include "spatial_dyn/eigen/spatial_math.h"
18 
19 namespace spatial_dyn {
20 
28 class Joint {
29 
30  public:
32  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
34 
38  enum class Type {
39  kUndefined,
40  kRx,
41  kRy,
42  kRz,
43  kPx,
44  kPy,
45  kPz
46  };
47 
51  Joint() {}
52 
58  Joint(Type type);
59 
68  Joint(const std::string& type);
69 
74  Type type() const { return type_; }
75 
81  void set_type(Type type);
82 
87  bool is_prismatic() const;
88 
93  bool is_revolute() const;
94 
99  const SpatialMotiond& subspace() const { return subspace_; }
100 
105  double q_min() const { return q_min_; }
106 
112  void set_q_min(double q_min);
113 
118  double q_max() const { return q_max_; }
119 
125  void set_q_max(double q_max);
126 
133  void set_q_limits(double q_min, double q_max);
134 
139  double dq_max() const { return dq_max_; }
140 
146  void set_dq_max(double dq_max);
147 
152  double fq_max() const { return fq_max_; }
153 
159  void set_fq_max(double fq_max);
160 
166  double f_coulomb() const { return f_coulomb_; }
167 
173  void set_f_coulomb(double f_coulomb);
174 
179  double f_viscous() const { return f_viscous_; }
180 
186  void set_f_viscous(double f_viscous);
187 
192  double f_stiction() const { return f_stiction_; }
193 
199  void set_f_stiction(double f_stiction);
200 
208  Eigen::Isometry3d T_joint(double q) const;
209 
210  protected:
211 
213  Type type_ = Type::kUndefined;
214  SpatialMotiond subspace_ = SpatialMotiond::Zero();
215 
216  double q_min_ = -std::numeric_limits<double>::infinity();
217  double q_max_ = std::numeric_limits<double>::infinity();
218  double dq_max_ = std::numeric_limits<double>::infinity();
219  double fq_max_ = std::numeric_limits<double>::infinity();
220  double f_coulomb_ = 0.;
221  double f_viscous_ = 0.;
222  double f_stiction_ = 0.;
224 
225 };
226 
234 std::ostream& operator<<(std::ostream& os, const Joint::Type& type);
235 
243 std::istream& operator>>(std::istream& is, Joint::Type& type);
244 
250 std::ostream& operator<<(std::ostream& os, const Joint& j);
251 
252 } // namespace spatial_dyn
253 
254 #endif // SPATIAL_DYN_STRUCTS_JOINT_H_
Definition: joint.h:28
double f_coulomb() const
Definition: joint.h:166
const SpatialMotiond & subspace() const
Definition: joint.h:99
double fq_max() const
Definition: joint.h:152
bool is_prismatic() const
Definition: joint.cc:55
void set_f_coulomb(double f_coulomb)
Definition: joint.cc:103
void set_q_max(double q_max)
Definition: joint.cc:70
double f_stiction() const
Definition: joint.h:192
void set_fq_max(double fq_max)
Definition: joint.cc:95
bool is_revolute() const
Definition: joint.cc:58
void set_type(Type type)
Definition: joint.cc:29
double q_max() const
Definition: joint.h:118
double f_viscous() const
Definition: joint.h:179
void set_dq_max(double dq_max)
Definition: joint.cc:87
void set_q_limits(double q_min, double q_max)
Definition: joint.cc:78
Eigen::Isometry3d T_joint(double q) const
Definition: joint.cc:127
void set_f_stiction(double f_stiction)
Definition: joint.cc:119
double q_min() const
Definition: joint.h:105
Type
Definition: joint.h:38
@ kRy
Revolute about Y.
@ kPy
Prismatic along Y.
@ kPx
Prismatic along X.
@ kPz
Prismatic along Z.
@ kRz
Revolute about Z.
@ kRx
Revolute about X.
void set_q_min(double q_min)
Definition: joint.cc:62
double dq_max() const
Definition: joint.h:139
Joint()
Definition: joint.h:51
void set_f_viscous(double f_viscous)
Definition: joint.cc:111
Type type() const
Definition: joint.h:74
Definition: spatial_motion.h:18
std::ostream & operator<<(std::ostream &os, const ArticulatedBody &ab)
Definition: articulated_body.cc:346
Definition: discrete_dynamics.cc:21
std::istream & operator>>(std::istream &is, Graphics::Geometry::Type &type)
Definition: graphics.cc:41