Main Page
·
Modules
·
All Classes
·
Class Hierarchy
mindaibo
src
types
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
56
struct
MABodyPartFeature
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
86
MANum<float>
Value
;
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
:
110
MANum<float>
ForeBackValue
;
112
MANum<float>
UpDownValue
;
113
};
114
118
struct
MASidelong
:
public
MABodyPartFeature
119
{
121
explicit
MASidelong
(
int
value = 0);
122
123
virtual
void
FromJointDegree(
int
degree)
override
;
124
virtual
int
ToJointDegree()
const override
;
125
};
126
130
struct
MABentStretched
:
public
MABodyPartFeature
131
{
133
explicit
MABentStretched
(
int
value = 0);
134
135
virtual
void
FromJointDegree(
int
degree)
override
;
136
virtual
int
ToJointDegree()
const override
;
137
};
138
142
struct
MALeftRightTurned
:
public
MABodyPartFeature
143
{
145
explicit
MALeftRightTurned
(
int
value = 0);
146
147
virtual
void
FromJointDegree(
int
degree)
override
;
148
virtual
int
ToJointDegree()
const override
;
149
};
150
154
struct
MAHeadPosition
:
public
MABodyPartFeature
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
167
MANum<float>
ForeBackValue
;
169
MANum<float>
UpDownValue
;
170
};
171
175
struct
MAMouthOpened
:
public
MABodyPartFeature
176
{
178
explicit
MAMouthOpened
(
int
value = 0);
179
180
virtual
void
FromJointDegree(
int
degree)
override
;
181
virtual
int
ToJointDegree()
const override
;
182
};
183
MABodyPartFeature::Value
MANum< float > Value
Current value.
Definition:
MABodyTypes.hpp:86
MALegPosition::UpDownValue
MANum< float > UpDownValue
Current up-down direction value.
Definition:
MABodyTypes.hpp:112
MALegPosition
The forward-backward/upward-downward feature of a leg joint.
Definition:
MABodyTypes.hpp:92
MAHeadPosition::UpDownValue
MANum< float > UpDownValue
Current up-down direction value.
Definition:
MABodyTypes.hpp:169
MALegPosition::ForeBackValue
MANum< float > ForeBackValue
Current fore-back direction value.
Definition:
MABodyTypes.hpp:110
MABodyPartFeature
A base class for the limb features.
Definition:
MABodyTypes.hpp:56
MANum< float >
MALeftRightTurned
The left-right turning feature of the head.
Definition:
MABodyTypes.hpp:142
MABentStretched
The bent-stretched feature of a leg joint.
Definition:
MABodyTypes.hpp:130
MASidelong
The sidelong feature of a leg joint.
Definition:
MABodyTypes.hpp:118
MA
Definition:
MABehavior.hpp:130
MABodyPartFeature::~MABodyPartFeature
virtual ~MABodyPartFeature()
Struct destructor.
Definition:
MABodyTypes.hpp:61
MAMouthOpened
The opened-closed position of the mouth.
Definition:
MABodyTypes.hpp:175
MAHeadPosition::ForeBackValue
MANum< float > ForeBackValue
Current fore-back direction value.
Definition:
MABodyTypes.hpp:167
MAHeadPosition
The fore-back, up-down position of the head.
Definition:
MABodyTypes.hpp:154
Generated by
1.8.11