Choreonoid  1.1
LeggedBody.h
説明を見る。
1 
6 #ifndef CNOID_BODY_LEGGED_BODY_H_INCLUDED
7 #define CNOID_BODY_LEGGED_BODY_H_INCLUDED
8 
9 #include "Body.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14  class CNOID_EXPORT LeggedBody : public Body
15  {
16  public:
17 
18  LeggedBody();
19  virtual ~LeggedBody();
20 
21  virtual BodyPtr duplicate() const;
22 
23  inline int numFeet() const { return footInfos.size(); }
24 
25  struct FootInfo {
30  };
31 
32  inline Link* footLink(int index) const { return footInfos[index].link; }
33  inline const FootInfo& footInfo(int index) const { return footInfos[index]; }
34 
35  bool doLegIkToMoveCm(const Vector3& c, bool onlyProjectionToFloor = false);
36  bool setStance(double width, Link* baseLink);
37 
38  Vector3 centerOfSole(int footIndex) const;
39  Vector3 centerOfSoles() const;
40 
41  Vector3 homeCopOfSole(int footIndex) const;
42  Vector3 homeCopOfSoles() const;
43 
44  static bool checkBodyInfoAsLeggedBody(const YamlMappingPtr info);
45 
46  protected:
47 
48  LeggedBody(const LeggedBody& org);
49 
50  virtual void doResetInfo(const YamlMapping& info);
51 
52  private:
53 
54  std::vector<FootInfo> footInfos;
55 
56  };
57 
58  typedef boost::intrusive_ptr<LeggedBody> LeggedBodyPtr;
59 }
60 
61 #endif