Main Page · Modules · All Classes · Class Hierarchy
MAMotionSkit.hpp
1 /*
2  * This file is part of the AiBO+ project
3  *
4  * Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5  *
6  * AiBO+ is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * AiBO+ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #pragma once
23 
24 #include <string>
25 
26 #include "core/MACoreTypes.hpp"
27 #include "types/MABodyTypes.hpp"
28 #include "types/MALeg.hpp"
29 #include "MASkitBase.hpp"
30 
31 class MCBinaryData;
32 class MAMotionSkit;
33 
39 namespace MA
40 {
42 typedef boost::shared_ptr<MAMotionSkit> MotionSkitSPtr;
43 }
44 
48 class MAMotionSkit : public MASkitBase
49 {
51  MAMotionSkit();
52 public:
60  std::string GetName() const;
61 
69  std::string GetSkitName() const;
70 
78  int GetDuration() const;
79 
85  MA::MotionSkitSPtr CloneMirrored() const;
86 
92  void Dump() const;
93 
102  bool IsStartingPostureSit() const;
103 
112  bool IsFinishingPostureSit() const;
113 
122  bool IsStartingPostureLie() const;
123 
132  bool IsFinishingPostureLie() const;
133 
134 
143  bool IsStartingPostureStand() const;
144 
153  bool IsFinishingPostureStand() const;
154 
165  MAGeneratorContainer* GetGeneratorContainer(MA::Leg::LegTypes leg, MA::LegJointsType joint) const;
166 
176  MAGeneratorContainer* GetGeneratorContainer(MA::TailJointsType tail_joint) const;
177 
187  MAGeneratorContainer* GetGeneratorContainer(MA::HeadJointsType head_joint) const;
188 
198  static MAMotionSkit* DecodeMtnData(const MCBinaryData& binary_data);
199 
200 private:
201 
212  bool IsPostureSit(unsigned int keyframe_index) const;
213 
224  bool IsPostureLie(unsigned int keyframe_index) const;
225 
236  bool IsPostureStand(unsigned int keyframe_index) const;
237 
248  MAGeneratorContainer* GetGeneratorContainer(unsigned int column_index,
249  bool invert_value = false) const;
250 
251 private:
253  std::string Name;
255  MC::IntTable Keyframes;
258 };
259 
Skit base class.
Definition: MASkitBase.hpp:40
Binary data class.
std::string Name
Motion name.
MC::IntTable Keyframes
Keyframes (first column - timestamp, other columns - joint values)
Generator container class.
Motion sequence (motion skit) class.
int SkitDuration
Skit duration (in msec)