Main Page · Modules · All Classes · Class Hierarchy
MABodyTypes.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 "core/MANum.hpp"
25 #include "core/MASignal.hpp"
26 
32 namespace MA
33 {
35 typedef enum
36 {
37  NeckPan = 0,
38  NeckTilt1,
39  NeckTilt2,
40  MouthJoint,
41  EarLeft,
42  EarRight,
43 } HeadJointsType;
44 
46 typedef enum
47 {
48  TailTilt = 0,
49  TailPan,
50 } TailJointsType;
51 }
52 
57 {
59  MABodyPartFeature(int value = 0, int minimum = -100, int maximum = 100);
61  virtual ~MABodyPartFeature() {};
62 
72  virtual void FromJointDegree(int degree) = 0;
73 
83  virtual int ToJointDegree() const = 0;
84 
87 };
88 
92 struct MALegPosition : public MABodyPartFeature // -V690 (PVS Studio suppression)3
93 {
94  MA_SLOT_CLASS
96  MALegPosition();
98  MALegPosition(const MALegPosition& other);
99 
100  virtual void FromJointDegree(int degree) override;
101  virtual int ToJointDegree() const override;
102 
103 private:
104  void NotifyNumUpdate(MANum<float>& number);
105  float DegreeToForeBack(int degree) const;
106  float DegreeToUpDown(int degree) const;
107 
108 public:
113 };
114 
119 {
121  explicit MASidelong(int value = 0);
122 
123  virtual void FromJointDegree(int degree) override;
124  virtual int ToJointDegree() const override;
125 };
126 
131 {
133  explicit MABentStretched(int value = 0);
134 
135  virtual void FromJointDegree(int degree) override;
136  virtual int ToJointDegree() const override;
137 };
138 
143 {
145  explicit MALeftRightTurned(int value = 0);
146 
147  virtual void FromJointDegree(int degree) override;
148  virtual int ToJointDegree() const override;
149 };
150 
155 {
157  MAHeadPosition();
158  virtual ~MAHeadPosition() {};
159 
160  virtual void FromJointDegree(int degree) override;
161  virtual int ToJointDegree() const override;
162  void FromJointDegrees(int neck_tilt1, int neck_tilt2);
163  int ToNeckTilt1Degree() const;
164  int ToNeckTilt2Degree() const;
165 
170 };
171 
176 {
178  explicit MAMouthOpened(int value = 0);
179 
180  virtual void FromJointDegree(int degree) override;
181  virtual int ToJointDegree() const override;
182 };
183 
MANum< float > Value
Current value.
Definition: MABodyTypes.hpp:86
MANum< float > UpDownValue
Current up-down direction value.
The forward-backward/upward-downward feature of a leg joint.
Definition: MABodyTypes.hpp:92
MANum< float > UpDownValue
Current up-down direction value.
MANum< float > ForeBackValue
Current fore-back direction value.
A base class for the limb features.
Definition: MABodyTypes.hpp:56
The left-right turning feature of the head.
The bent-stretched feature of a leg joint.
The sidelong feature of a leg joint.
virtual ~MABodyPartFeature()
Struct destructor.
Definition: MABodyTypes.hpp:61
The opened-closed position of the mouth.
MANum< float > ForeBackValue
Current fore-back direction value.
The fore-back, up-down position of the head.