Choreonoid  1.8
BodyState.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_BODY_STATE_H
7 #define CNOID_BODY_BODY_STATE_H
8 
9 #include <cnoid/EigenTypes>
10 #include <cnoid/DataMap>
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15 class Body;
16 
20 class CNOID_EXPORT BodyState : public DataMap<double>
21 {
22  typedef DataMap<double> BaseType;
23 public:
24  enum DataType {
28  ZMP
29  };
30 
31  BodyState();
32  BodyState(const Body& body);
33  BodyState(const BodyState& state);
34  BodyState& operator=(const BodyState& rhs) {
36  return *this;
37  }
38 
39  void storePositions(const Body& body);
40  bool restorePositions(Body& io_body) const;
41 
42  void setRootLinkPosition(const Isometry3& T);
43  void setRootLinkPosition(const SE3& position);
44  bool getRootLinkPosition(Isometry3& out_T) const;
45  bool getRootLinkPosition(SE3& out_position) const;
46 
47  void setZMP(const Vector3& zmp);
48  bool getZMP(Vector3& out_zmp) const;
49 
50 protected:
51  virtual std::map<std::string, int>& nameToIdMap();
52  virtual std::map<int, std::string>& idToNameMap();
53  virtual int nextDynamicId();
54 };
55 
56 
57 CNOID_EXPORT BodyState& operator<<(BodyState& state, const Body& body);
58 CNOID_EXPORT const BodyState& operator>>(const BodyState& state, Body& body);
59 CNOID_EXPORT Body& operator<<(Body& body, const BodyState& state);
60 CNOID_EXPORT const Body& operator>>(const Body& body, BodyState& state);
61 
62 }
63 
64 #endif
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::BodyState
Definition: BodyState.h:20
cnoid::Isometry3
Eigen::Isometry3d Isometry3
Definition: EigenTypes.h:73
cnoid::DataMap::operator=
DataMap & operator=(const DataMap &rhs)
Definition: DataMap.h:48
cnoid::operator<<
CNOID_EXPORT std::ostream & operator<<(std::ostream &os, const BoundingBox &bb)
Definition: BoundingBox.cpp:160
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::BodyState::JOINT_POSITIONS
@ JOINT_POSITIONS
Definition: BodyState.h:25
cnoid::DataMap
Definition: DataMap.h:33
cnoid::SE3
Definition: EigenTypes.h:79
cnoid::BodyState::operator=
BodyState & operator=(const BodyState &rhs)
Definition: BodyState.h:34
cnoid::BodyState::LINK_POSITIONS
@ LINK_POSITIONS
Definition: BodyState.h:26
cnoid::BodyState::JOINT_FORCE_OR_TORQUE
@ JOINT_FORCE_OR_TORQUE
Definition: BodyState.h:27
cnoid::Body
Definition: Body.h:28
cnoid::operator>>
CNOID_EXPORT EasyScanner & operator>>(EasyScanner &scanner, double &value)
Definition: EasyScanner.cpp:681
cnoid::BodyState::DataType
DataType
Definition: BodyState.h:24