definitions.hpp
Go to the documentation of this file.
1 
8 // ****************************************************************************
9 // **WARNING: DO NOT CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING!**
10 // ****************************************************************************
11 
12 #ifndef MARTY_DEFINITIONS_HPP
13 #define MARTY_DEFINITIONS_HPP
14 
15 #include <unistd.h>
16 #include <map>
17 
18 #define DEBUG_MODE false
19 
20 // Console printing MACROS
21 #define ERR(x) std::cerr << "\033[22;31;1m" << x << "\033[0m"; // RED
22 #define WARN(x) std::cerr << "\033[22;33;1m" << x << "\033[0m"; // YELLOW
23 #define INFO(x) std::cerr << "\033[22;37;1m" << x << "\033[0m"; // WHITE
24 #define DEBUG(x) std::cerr << "\033[22;34;1m" << x << "\033[0m"; // BLUE
25 #define CLEAR() std::cerr << "\x1B[2J\x1B[H"; // Clear Console
26 
27 inline void sleepms(int ms) {usleep(ms * 1000);}
28 
29 enum JOINTS {
30  LHIP = 0,
41  NUMJOINTS // Number of Joints, Leave at the end!
42 };
43 
44 const std::vector <std::string> NAMES = {
45  "LHIP",
46  "LTWIST",
47  "LKNEE",
48  "RHIP",
49  "RTWIST",
50  "RKNEE",
51  "LARM",
52  "RARM",
53  "EYES",
54  "AUX1",
55  "AUX2"
56 };
57 
58 const std::vector <int> JOINT_DIR = {
59  1, // "LHIP",
60  1, // "LTWIST",
61  -1, // "LKNEE",
62  1, // "RHIP",
63  1, // "RTWIST",
64  -1, // "RKNEE",
65  1, // "LARM",
66  -1, // "RARM",
67  1, // "EYES",
68  1, // "AUX1",
69  1 // "AUX2"
70 };
71 
72 const std::vector <int> JOINT_MULT = {
73  1, // "LHIP",
74  1, // "LTWIST",
75  1, // "LKNEE",
76  1, // "RHIP",
77  1, // "RTWIST",
78  1, // "RKNEE",
79  1, // "LARM",
80  1, // "RARM",
81  1, // "EYES",
82  1, // "AUX1",
83  1 // "AUX2"
84 };
85 
86 const std::map<std::string, int> JOINT_NAMES = {
87  {"LHIP", LHIP},
88  {"LTWIST", LTWIST},
89  {"LKNEE", LKNEE},
90  {"RHIP", RHIP},
91  {"RTWIST", RTWIST},
92  {"RKNEE", RKNEE},
93  {"LARM", LARM},
94  {"RARM", RARM},
95  {"EYES", EYES},
96  {"AUX1", AUX1},
97  {"AUX2", AUX2}
98 };
99 
100 # define HIP_OFFSET 100
101 # define TWIST_OFFSET 110
102 # define KNEE_OFFSET 110
103 # define ARM_OFFSET 300
104 # define EYES_OFFSET 300
105 # define AUX_OFFSET 110
106 
107 // TODO: These should not be definitions, but in joint calibration as rosparams!
108 #define EYES_ANGRY 30
109 #define EYES_NORMAL 0
110 #define EYES_EXCITED -40
111 #define EYES_WIDE -120
112 
113 // Musical Note Frequencies
114 #define SILENCE 0
115 #define NOTE_B0 31
116 #define NOTE_C1 33
117 #define NOTE_CS1 35
118 #define NOTE_D1 37
119 #define NOTE_DS1 39
120 #define NOTE_E1 41
121 #define NOTE_F1 44
122 #define NOTE_FS1 46
123 #define NOTE_G1 49
124 #define NOTE_GS1 52
125 #define NOTE_A1 55
126 #define NOTE_AS1 58
127 #define NOTE_B1 62
128 #define NOTE_C2 65
129 #define NOTE_CS2 69
130 #define NOTE_D2 73
131 #define NOTE_DS2 78
132 #define NOTE_E2 82
133 #define NOTE_F2 87
134 #define NOTE_FS2 93
135 #define NOTE_G2 98
136 #define NOTE_GS2 104
137 #define NOTE_A2 110
138 #define NOTE_AS2 117
139 #define NOTE_B2 123
140 #define NOTE_C3 131
141 #define NOTE_CS3 139
142 #define NOTE_D3 147
143 #define NOTE_DS3 156
144 #define NOTE_E3 165
145 #define NOTE_F3 175
146 #define NOTE_FS3 185
147 #define NOTE_G3 196
148 #define NOTE_GS3 208
149 #define NOTE_A3 220
150 #define NOTE_AS3 233
151 #define NOTE_B3 247
152 #define NOTE_C4 262
153 #define NOTE_CS4 277
154 #define NOTE_D4 294
155 #define NOTE_DS4 311
156 #define NOTE_E4 330
157 #define NOTE_F4 349
158 #define NOTE_FS4 370
159 #define NOTE_G4 392
160 #define NOTE_GS4 415
161 #define NOTE_A4 440
162 #define NOTE_AS4 466
163 #define NOTE_B4 494
164 #define NOTE_C5 523
165 #define NOTE_CS5 554
166 #define NOTE_D5 587
167 #define NOTE_DS5 622
168 #define NOTE_E5 659
169 #define NOTE_F5 698
170 #define NOTE_FS5 740
171 #define NOTE_G5 784
172 #define NOTE_GS5 831
173 #define NOTE_A5 880
174 #define NOTE_AS5 932
175 #define NOTE_B5 988
176 #define NOTE_C6 1047
177 #define NOTE_CS6 1109
178 #define NOTE_D6 1175
179 #define NOTE_DS6 1245
180 #define NOTE_E6 1319
181 #define NOTE_F6 1397
182 #define NOTE_FS6 1480
183 #define NOTE_G6 1568
184 #define NOTE_GS6 1661
185 #define NOTE_A6 1760
186 #define NOTE_AS6 1865
187 #define NOTE_B6 1976
188 #define NOTE_C7 2093
189 #define NOTE_CS7 2217
190 #define NOTE_D7 2349
191 #define NOTE_DS7 2489
192 #define NOTE_E7 2637
193 #define NOTE_F7 2794
194 #define NOTE_FS7 2960
195 #define NOTE_G7 3136
196 #define NOTE_GS7 3322
197 #define NOTE_A7 3520
198 #define NOTE_AS7 3729
199 #define NOTE_B7 3951
200 #define NOTE_C8 4186
201 #define NOTE_CS8 4435
202 #define NOTE_D8 4699
203 #define NOTE_DS8 4978
204 
205 #endif /* MARTY_DEFINITIONS_HPP */
const std::vector< int > JOINT_DIR
Definition: definitions.hpp:58
const std::vector< std::string > NAMES
Definition: definitions.hpp:44
JOINTS
Definition: definitions.hpp:29
void sleepms(int ms)
Definition: definitions.hpp:27
const std::vector< int > JOINT_MULT
Definition: definitions.hpp:72
const std::map< std::string, int > JOINT_NAMES
Definition: definitions.hpp:86


ros_marty
Author(s): Alejandro Bordallo
autogenerated on Fri Jul 21 2017 14:51:45