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
Definition: LeggedBody.h:14
boost::intrusive_ptr< Body > BodyPtr
Definition: Body.h:22
Definition: Body.h:45
Vector3 homeCop
Definition: LeggedBody.h:27
Definition: LeggedBody.h:25
Vector3 soleCenter
Definition: LeggedBody.h:28
boost::intrusive_ptr< LeggedBody > LeggedBodyPtr
Definition: LeggedBody.h:58
YamlMappingPtr info
Definition: LeggedBody.h:29
const FootInfo & footInfo(int index) const
Definition: LeggedBody.h:33
Link * link
Definition: LeggedBody.h:26
Definition: EasyScanner.h:16
int numFeet() const
Definition: LeggedBody.h:23
Link * footLink(int index) const
Definition: LeggedBody.h:32
Definition: YamlNodes.h:212
boost::intrusive_ptr< YamlMapping > YamlMappingPtr
Definition: YamlNodes.h:380
Eigen::Vector3d Vector3
Definition: EigenTypes.h:26
#define CNOID_EXPORT
Definition: Util/exportdecl.h:13