Choreonoid  1.8
ZMPSeq.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_ZMP_SEQ_H
7 #define CNOID_BODY_ZMP_SEQ_H
8 
9 #include <cnoid/Vector3Seq>
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT ZMPSeq : public Vector3Seq
15 {
16 public:
18 
19  static const std::string& key();
20 
21  ZMPSeq(int nFrames = 0);
22  ZMPSeq(const ZMPSeq& org);
23  ZMPSeq(const Vector3Seq& org);
24 
25  virtual AbstractSeq& operator=(const AbstractSeq& rhs) override;
26  ZMPSeq& operator=(const ZMPSeq& rhs);
27  virtual std::shared_ptr<AbstractSeq> cloneSeq() const override;
28 
29  bool isRootRelative() const { return isRootRelative_; }
30  void setRootRelative(bool on);
31 
32 protected:
33  virtual bool doReadSeq(const Mapping* archive, std::ostream& os) override;
34  virtual bool doWriteSeq(YAMLWriter& writer, std::function<void()> additionalPartCallback) override;
35 
36 private:
37  bool isRootRelative_;
38 };
39 
40 class BodyMotion;
41 
42 CNOID_EXPORT std::shared_ptr<ZMPSeq> getZMPSeq(const BodyMotion& motion);
43 CNOID_EXPORT std::shared_ptr<ZMPSeq> getOrCreateZMPSeq(BodyMotion& motion);
44 CNOID_EXPORT void clearZMPSeq(BodyMotion& motion);
45 CNOID_EXPORT bool makeRootRelative(ZMPSeq& zmpseq, BodyMotion& motion, bool on);
46 
47 }
48 
49 #endif
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::YAMLWriter
Definition: YAMLWriter.h:16
cnoid::makeRootRelative
CNOID_EXPORT bool makeRootRelative(ZMPSeq &zmpseq, BodyMotion &motion, bool on)
Definition: ZMPSeq.cpp:121
cnoid::ZMPSeq::isRootRelative
bool isRootRelative() const
Definition: ZMPSeq.h:29
cnoid::getZMPSeq
CNOID_EXPORT std::shared_ptr< ZMPSeq > getZMPSeq(const BodyMotion &motion)
Definition: ZMPSeq.cpp:103
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::AbstractSeq
Definition: AbstractSeq.h:21
cnoid::ZMPSeq::BaseSeqType
Vector3Seq BaseSeqType
Definition: ZMPSeq.h:17
cnoid::getOrCreateZMPSeq
CNOID_EXPORT std::shared_ptr< ZMPSeq > getOrCreateZMPSeq(BodyMotion &motion)
Definition: ZMPSeq.cpp:109
cnoid::Vector3Seq
Definition: Vector3Seq.h:16
cnoid::clearZMPSeq
CNOID_EXPORT void clearZMPSeq(BodyMotion &motion)
Definition: ZMPSeq.cpp:115
cnoid::ZMPSeq
Definition: ZMPSeq.h:14