Choreonoid  1.5
CompositeIK.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_COMPOSITE_IK_H
7 #define CNOID_BODY_COMPOSITE_IK_H
8 
9 #include "Body.h"
10 #include "InverseKinematics.h"
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15 class JointPath;
16 typedef boost::shared_ptr<JointPath> JointPathPtr;
17 
19 {
20 public:
21  CompositeIK();
22  CompositeIK(Body* body, Link* targetLink);
23  ~CompositeIK();
24 
25  void reset(Body* body, Link* targetLink);
26  bool addBaseLink(Link* link);
27  void setMaxIKerror(double e);
28 
29  Body* body() const { return body_; }
30  Link* targetLink() const { return targetLink_; }
31  int numJointPaths() const { return pathList.size(); }
32  JointPathPtr jointPath(int index) const { return pathList[index].path; }
33  Link* baseLink(int index) const { return pathList[index].endLink; }
34 
35  virtual bool hasAnalyticalIK() const;
36  virtual bool calcInverseKinematics(const Vector3& p, const Matrix3& R);
37 
38 private:
39  BodyPtr body_;
40  Link* targetLink_;
41  struct PathInfo {
42  JointPathPtr path;
43  Link* endLink;
44  Vector3 p_given;
45  Matrix3 R_given;
46  };
47  std::vector<PathInfo> pathList;
48  bool isAnalytical_;
49 };
50 
51 typedef boost::shared_ptr<CompositeIK> CompositeIKPtr;
52 
53 }
54 
55 #endif
int numJointPaths() const
Definition: CompositeIK.h:31
boost::shared_ptr< JointPath > JointPathPtr
Definition: BodyMotionPoseProvider.h:20
Definition: Body.h:28
Definition: InverseKinematics.h:14
Link * baseLink(int index) const
Definition: CompositeIK.h:33
Definition: CompositeIK.h:18
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
boost::shared_ptr< CompositeIK > CompositeIKPtr
Definition: CompositeIK.h:51
Body * body() const
Definition: CompositeIK.h:29
JointPathPtr jointPath(int index) const
Definition: CompositeIK.h:32
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Link * targetLink() const
Definition: CompositeIK.h:30
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:57