libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
joint.hpp
1 /*
2  * joint.h
3  * BioMove3D
4  *
5  * Created by Jim Mainprice on 12/05/10.
6  * Copyright 2010 LAAS/CNRS. All rights reserved.
7  *
8  */
9 #ifndef JOINT_HPP
10 #define JOINT_HPP
11 
12 #include "API/ConfigSpace/configuration.hpp"
13 #include <eigen3/Eigen/Geometry>
14 #include "p3d_matrix.h"
15 
16 class Robot;
17 
18 #ifndef _DEVICE_H
19 struct jnt;
20 #endif
21 
27 class Joint
28 {
29 public:
34  Joint(Robot* R, jnt* jntPt , int id = -1, bool copy = false );
35 
39  ~Joint();
40 
44  std::string getName() const { return m_Name; }
45 
46  Robot* getRobot() const {return m_Robot;}
47 
51  jnt* getJointStruct() const { return m_Joint; }
52 
56  Eigen::Affine3d getMatrixPos() const;
57 
61  Eigen::Vector3d getVectorPos() const;
62 
66  void getAbsVector(p3d_vector3 r);
67 
71  p3d_matrix4* getAbsPos();
72 
76  void shoot(Configuration& q,bool sample_passive=false);
77 
81  double getJointDof(int ithDoF) const;
82 
86  void setJointDof(int ithDoF, double value);
87 
91  bool setFreeFlyerFromMatrix( const Eigen::Affine3d& T );
92 
96  bool isJointDofUser(int ithDoF) const;
97 
101  void getDofBounds(int ithDoF, double& vmin, double& vmax) const;
102 
106  unsigned int getNumberOfDof() const;
107 
111  unsigned int getIndexOfFirstDof() const;
112 
116  int getId() const { return m_id; }
117 
122 
127 
131  std::vector<Joint*> getAllPrevJoints();
132 
134  unsigned computeDimension();
135 
137  double computeSpaceVolume();
138 
139 private:
140  Robot* m_Robot;
141  jnt* m_Joint;
142  std::string m_Name;
143  bool m_copy;
144  int m_id;
146 };
147 
148 #endif
double computeSpaceVolume()
Compute the volume of the space swept by the joint.
Definition: joint.cpp:262
unsigned int getNumberOfDof() const
Get Number of DoF.
Definition: joint.cpp:152
void setJointDof(int ithDoF, double value)
Set the Joint Dof.
Definition: joint.cpp:115
Joint(Robot *R, jnt *jntPt, int id=-1, bool copy=false)
Constructor.
Definition: joint.cpp:28
void getDofBounds(int ithDoF, double &vmin, double &vmax) const
Get Min Max dof.
Definition: joint.cpp:146
bool setFreeFlyerFromMatrix(const Eigen::Affine3d &T)
Set ff from Eigen::Transform.
Definition: joint.cpp:120
unsigned int getIndexOfFirstDof() const
Get Dof Pos in Configuration.
Definition: joint.cpp:157
int getId() const
Get the id in the joint structure of the robot.
Definition: joint.hpp:116
std::string getName() const
Returns the name of the joint.
Definition: joint.hpp:44
~Joint()
Destructor of the class.
void getAbsVector(p3d_vector3 r)
Get the p3d abs vect.
Definition: joint.cpp:74
void shoot(Configuration &q, bool sample_passive=false)
Random shoot the joint.
Definition: joint.cpp:87
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
std::vector< Joint * > getAllPrevJoints()
Returns the array of previous joints.
Definition: joint.cpp:195
bool isJointDofUser(int ithDoF) const
True if Joint Dof is user.
Definition: joint.cpp:141
This class holds a Joint and is associated with a Body (Link) It's the basic element of a kinematic c...
Definition: joint.hpp:27
Eigen::Vector3d getVectorPos() const
Get the Vector abs_pos of the Joint.
Definition: joint.cpp:36
unsigned computeDimension()
Compute the dimension of the space swept by the joint.
Definition: joint.cpp:217
Classe représentant une Configuration d'un Robot.
Definition: configuration.hpp:25
jnt * getJointStruct() const
Get the Joint structue.
Definition: joint.hpp:51
void setConfigFromDofValues(Configuration &q)
Set the config from the DoF values.
Definition: joint.cpp:162
Eigen::Affine3d getMatrixPos() const
Get the Matrix abs_pos of the Joint.
Definition: joint.cpp:47
Joint * getPreviousJoint()
Returns the previous joint.
Definition: joint.cpp:171
p3d_matrix4 * getAbsPos()
Get the p3d abs pos.
Definition: joint.cpp:82
double getJointDof(int ithDoF) const
Returns the Joint Dof.
Definition: joint.cpp:110