Choreonoid  1.5
BodyMotionPoseProvider.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_BODY_MOTION_POSE_PROVIDER_H
7 #define CNOID_BODY_BODY_MOTION_POSE_PROVIDER_H
8 
9 #include "Body.h"
10 #include "PoseProvider.h"
11 #include "BodyMotion.h"
12 #include "ZMPSeq.h"
13 #include <cnoid/MultiAffine3Seq>
14 #include "exportdecl.h"
15 
16 namespace cnoid {
17 
18 class Link;
19 
20 class JointPath;
21 typedef boost::shared_ptr<JointPath> JointPathPtr;
22 
24 {
25 public:
28 
29  void initialize(Body* body, BodyMotionPtr motion);
30 
31  bool updateMotion();
32 
33  virtual Body* body() const;
34  virtual double beginningTime() const;
35  virtual double endingTime() const;
36  virtual bool seek(double time);
37  virtual bool seek(double time, int waistLinkIndex, const Vector3& waistTranslation);
38  virtual int baseLinkIndex() const;
39  virtual bool getBaseLinkPosition(Position& out_T) const;
40  virtual void getJointPositions(std::vector< boost::optional<double> >& out_q) const;
41  virtual boost::optional<Vector3> ZMP() const;
42 
43 private:
44  BodyPtr body_;
45  BodyMotionPtr motion;
46  ZMPSeqPtr zmpSeq;
47  int minNumJoints;
48  std::vector<Link*> footLinks;
49  std::vector<JointPathPtr> ikPaths;
50  MultiAffine3SeqPtr footLinkPositions;
51  std::vector<double> qTranslated;
52  Vector3 p_waist;
53  Matrix3 R_waist;
54  Vector3 ZMP_;
55 
56  bool seek(double time, int waistLinkIndex, const Vector3& waistTranslation, bool applyWaistTranslation);
57 };
58 
59 }
60 
61 #endif
boost::shared_ptr< ZMPSeq > ZMPSeqPtr
Definition: ZMPSeq.h:39
boost::shared_ptr< JointPath > JointPathPtr
Definition: BodyMotionPoseProvider.h:20
Definition: Body.h:28
boost::shared_ptr< BodyMotion > BodyMotionPtr
Definition: BodyMotion.h:147
Definition: BodyMotionPoseProvider.h:23
Definition: PoseProvider.h:16
Definition: JointPath.h:21
Eigen::Transform< double, 3, Eigen::AffineCompact > Position
Definition: EigenTypes.h:73
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
MultiAffine3Seq::Ptr MultiAffine3SeqPtr
Definition: MultiAffine3Seq.h:42
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:57