JointPath.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  */
9 
15 #ifndef HRPMODEL_JOINT_PATH_H_INCLUDED
16 #define HRPMODEL_JOINT_PATH_H_INCLUDED
17 
18 #include <boost/shared_ptr.hpp>
19 #include <hrpUtil/Eigen3d.h>
20 #include "LinkPath.h"
21 #include "InverseKinematics.h"
22 #include "Config.h"
23 
24 namespace hrp {
25 
26  class HRPMODEL_API JointPath : public InverseKinematics
27  {
28  public:
29 
30  JointPath();
31  JointPath(Link* base, Link* end);
32  JointPath(Link* end);
33  virtual ~JointPath();
34 
35  bool find(Link* base, Link* end);
36  bool find(Link* end);
37 
38  inline bool empty() const {
39  return joints.empty();
40  }
41 
42  inline unsigned int numJoints() const {
43  return joints.size();
44  }
45 
46  inline Link* joint(int index) const {
47  return joints[index];
48  }
49 
50  inline Link* baseLink() const {
51  return linkPath.baseLink();
52  }
53 
54  inline Link* endLink() const {
55  return linkPath.endLink();
56  }
57 
58  inline bool isJointDownward(int index) const {
59  return (index >= numUpwardJointConnections);
60  }
61 
62  inline void calcForwardKinematics(bool calcVelocity = false, bool calcAcceleration = false) const {
63  linkPath.calcForwardKinematics(calcVelocity, calcAcceleration);
64  }
65 
66  void calcJacobian(dmatrix& out_J, const Vector3& local_p = Vector3::Zero()) const;
67 
68  inline dmatrix Jacobian() const {
69  dmatrix J;
70  calcJacobian(J);
71  return J;
72  }
73 
74  void calcJacobianDot(dmatrix& out_dJ, const Vector3& local_p = Vector3::Zero()) const;
75 
76  // InverseKinematics Interface
77  virtual void setMaxIKError(double e);
78  virtual void setBestEffortIKMode(bool on);
79  virtual bool calcInverseKinematics(const Vector3& end_p, const Matrix33& end_R);
80  virtual bool hasAnalyticalIK();
81 
82  bool calcInverseKinematics(
83  const Vector3& base_p, const Matrix33& base_R, const Vector3& end_p, const Matrix33& end_R);
84 
85  protected:
86 
87  virtual void onJointPathUpdated();
88 
89  double maxIKErrorSqr;
91 
92  private:
93 
94  void initialize();
95  void extractJoints();
96 
98  std::vector<Link*> joints;
100  };
101 
102  typedef boost::shared_ptr<JointPath> JointPathPtr;
103 
104 };
105 
106 
107 #endif
Eigen::MatrixXd dmatrix
Definition: EigenTypes.h:13
Link * baseLink() const
Definition: JointPath.h:50
bool isJointDownward(int index) const
Definition: JointPath.h:58
double maxIKErrorSqr
Definition: JointPath.h:89
std::vector< Link * > joints
Definition: JointPath.h:98
LinkPath linkPath
Definition: JointPath.h:97
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
Eigen::Matrix3d Matrix33
Definition: EigenTypes.h:12
void calcForwardKinematics(bool calcVelocity=false, bool calcAcceleration=false) const
Definition: JointPath.h:62
CORBA::Long find(const CorbaSequence &seq, Functor f)
Link * joint(int index) const
Definition: JointPath.h:46
dmatrix Jacobian() const
Definition: JointPath.h:68
unsigned int numJoints() const
Definition: JointPath.h:42
bool isBestEffortIKMode
Definition: JointPath.h:90
bool empty() const
Definition: JointPath.h:38
boost::shared_ptr< JointPath > JointPathPtr
Definition: Body.h:29
Link * endLink() const
Definition: JointPath.h:54
int numUpwardJointConnections
Definition: JointPath.h:99


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:39