gusimplewhiteboard
wb_hal_legtarget.h
Go to the documentation of this file.
1
9#ifndef wb_hal_legtarget_h
10#define wb_hal_legtarget_h
11
12#include <gu_util.h>
13#include <stdint.h>
14
15#define LEFT_LEG 0
16#define RIGHT_LEG 1
17
24#define HIP_YAWPITCH_LIMIT_BACK_DEG -65.62f
25#define HIP_YAWPITCH_LIMIT_FRONT_DEG 42.44f
26
27#define LEFT_HIP_ROLL_OUT_DEG 45.29f
28#define LEFT_HIP_ROLL_IN_DEG -21.74f
29#define LEFT_HIP_PITCH_FRONT_DEG -88.00f
30#define LEFT_HIP_PITCH_BACK_DEG 27.73f
31#define LEFT_KNEE_PITCH_FRONT_DEG -5.29f
32#define LEFT_KNEE_PITCH_BACK_DEG 121.04f
33#define LEFT_ANKLE_PITCH_FRONT_DEG -68.15f
34#define LEFT_ANKLE_PITCH_BACK_DEG 52.86f
35#define LEFT_ANKLE_ROLL_OUT_DEG 44.06f
36#define LEFT_ANKLE_ROLL_IN_DEG -22.79f
37
38#define RIGHT_HIP_ROLL_OUT_DEG -45.29f
39#define RIGHT_HIP_ROLL_IN_DEG 21.74f
40#define RIGHT_HIP_PITCH_FRONT_DEG -88.00f
41#define RIGHT_HIP_PITCH_BACK_DEG 27.73f
42#define RIGHT_KNEE_PITCH_FRONT_DEG -5.90f
43#define RIGHT_KNEE_PITCH_BACK_DEG 121.47f
44#define RIGHT_ANKLE_PITCH_FRONT_DEG -67.97f
45#define RIGHT_ANKLE_PITCH_BACK_DEG 53.40f
46#define RIGHT_ANKLE_ROLL_OUT_DEG -44.06f
47#define RIGHT_ANKLE_ROLL_IN_DEG 22.80f
48
50#define HIP_YAWPITCH_LIMIT_BACK_RAD -1.145303f
51#define HIP_YAWPITCH_LIMIT_FRONT_RAD 0.740810f
52
53#define LEFT_HIP_ROLL_OUT_RAD 0.790477f
54#define LEFT_HIP_ROLL_IN_RAD -0.379472f
55#define LEFT_HIP_PITCH_FRONT_RAD -1.535889f
56#define LEFT_HIP_PITCH_BACK_RAD 0.484090f
57#define LEFT_KNEE_PITCH_FRONT_RAD -0.092346f
58#define LEFT_KNEE_PITCH_BACK_RAD 2.112528f
59#define LEFT_ANKLE_PITCH_FRONT_RAD -1.189516f
60#define LEFT_ANKLE_PITCH_BACK_RAD 0.922747f
61#define LEFT_ANKLE_ROLL_OUT_RAD 0.769001f
62#define LEFT_ANKLE_ROLL_IN_RAD -0.397880f
63
64#define RIGHT_HIP_ROLL_OUT_RAD -0.790477f
65#define RIGHT_HIP_ROLL_IN_RAD 0.379472f
66#define RIGHT_HIP_PITCH_FRONT_RAD -1.535889f
67#define RIGHT_HIP_PITCH_BACK_RAD 0.484090f
68#define RIGHT_KNEE_PITCH_FRONT_RAD -0.103083f
69#define RIGHT_KNEE_PITCH_BACK_RAD 2.120198f
70#define RIGHT_ANKLE_PITCH_FRONT_RAD -1.186448f
71#define RIGHT_ANKLE_PITCH_BACK_RAD 0.932056f
72#define RIGHT_ANKLE_ROLL_OUT_RAD -0.768992f
73#define RIGHT_ANKLE_ROLL_IN_RAD 0.397935f
74
90{
97 PROPERTY(int32_t, target_movement_time)
98
99
100 PROPERTY(int16_t, target_hipyawpitch)
101
102
103 PROPERTY(int16_t, target_hiproll)
104
106 PROPERTY(int16_t, target_hippitch)
107
109 PROPERTY(int16_t, target_kneepitch)
110
112 PROPERTY(int16_t, target_anklepitch)
113
115 PROPERTY(int16_t, target_ankleroll)
116
122 PROPERTY(uint8_t, target_leg)
123
125 PROPERTY(uint8_t, target_hipyawpitchstiffness)
126
128 PROPERTY(uint8_t, target_hiprollstiffness)
129
131 PROPERTY(uint8_t, target_hippitchstiffness)
132
134 PROPERTY(uint8_t, target_kneepitchstiffness)
135
137 PROPERTY(uint8_t, target_anklepitchstiffness)
138
140 PROPERTY(uint8_t, target_anklerollstiffness)
141
150 PROPERTY(uint8_t, target_pliability)
151
164 BIT_PROPERTY(target_hipyawpitch_active)
165
170 BIT_PROPERTY(target_hiproll_active)
171
176 BIT_PROPERTY(target_hippitch_active)
177
182 BIT_PROPERTY(target_kneepitch_active)
183
188 BIT_PROPERTY(target_anklepitch_active)
189
194 BIT_PROPERTY(target_ankleroll_active)
195
203 BIT_PROPERTY(target_leg_at_goal)
204
211 BIT_PROPERTY(target_leg_stop)
212
213
214
215#ifdef __cplusplus
246 wb_hal_legtarget(uint8_t leg = LEFT_LEG,
247 int16_t hipyawpitch = 0,
248 int16_t hiproll = 0,
249 int16_t hippitch = 0,
250 int16_t kneepitch = 0,
251 int16_t anklepitch = 0,
252 int16_t ankleroll = 0,
254 uint8_t hiprollstiffness = 0,
255 uint8_t hippitchstiffness = 0,
260 bool hiproll_active = true,
261 bool hippitch_active = true,
262 bool kneepitch_active = true,
263 bool anklepitch_active = true,
264 bool ankleroll_active = true,
265 int32_t movement_time = INT_MAX, // Ensures sudden movements do not take place
266 uint8_t pliability = 0,
267 bool leg_at_goal = false,
268 bool leg_stop = false)
269 {
270 set_target_leg(leg);
271 set_target_hipyawpitch(hipyawpitch);
272 set_target_hiproll(hiproll);
273 set_target_hippitch(hippitch);
274 set_target_kneepitch(kneepitch);
275 set_target_anklepitch(anklepitch);
276 set_target_ankleroll(ankleroll);
277 set_target_hipyawpitchstiffness(hipyawpitchstiffness);
278 set_target_hiprollstiffness(hiprollstiffness);
279 set_target_hippitchstiffness(hippitchstiffness);
280 set_target_kneepitchstiffness(kneepitchstiffness);
281 set_target_anklepitchstiffness(anklepitchstiffness);
282 set_target_anklerollstiffness(anklerollstiffness);
283 set_target_hipyawpitch_active(hipyawpitch_active);
284 set_target_hiproll_active(hiproll_active);
285 set_target_hippitch_active(hippitch_active);
286 set_target_kneepitch_active(kneepitch_active);
287 set_target_anklepitch_active(anklepitch_active);
288 set_target_ankleroll_active(ankleroll_active);
289 set_target_movement_time(movement_time);
290 set_target_pliability(pliability);
291 set_target_leg_at_goal(leg_at_goal);
292 set_target_leg_stop(leg_stop);
293 }
294
297 {
298 set_target_leg(other.target_leg());
299 set_target_hipyawpitch(other.target_hipyawpitch());
300 set_target_hiproll(other.target_hiproll());
301 set_target_hippitch(other.target_hippitch());
302 set_target_kneepitch(other.target_kneepitch());
303 set_target_anklepitch(other.target_anklepitch());
304 set_target_ankleroll(other.target_ankleroll());
305 set_target_hipyawpitchstiffness(other.target_hipyawpitchstiffness());
306 set_target_hiprollstiffness(other.target_hiprollstiffness());
307 set_target_hippitchstiffness(other.target_hippitchstiffness());
308 set_target_kneepitchstiffness(other.target_kneepitchstiffness());
309 set_target_anklepitchstiffness(other.target_anklepitchstiffness());
310 set_target_anklerollstiffness(other.target_anklerollstiffness());
311 set_target_hipyawpitch_active(other.target_hipyawpitch_active());
312 set_target_hiproll_active(other.target_hiproll_active());
313 set_target_hippitch_active(other.target_hippitch_active());
314 set_target_kneepitch_active(other.target_kneepitch_active());
315 set_target_anklepitch_active(other.target_anklepitch_active());
316 set_target_ankleroll_active(other.target_ankleroll_active());
317 set_target_movement_time(other.target_movement_time());
318 set_target_pliability(other.target_pliability());
319 set_target_leg_at_goal(other.target_leg_at_goal());
320 set_target_leg_stop(other.target_leg_stop());
321 }
322
324 wb_hal_legtarget &operator = (const wb_hal_legtarget &other)
325 {
326 set_target_leg(other.target_leg());
327 set_target_hipyawpitch(other.target_hipyawpitch());
328 set_target_hiproll(other.target_hiproll());
329 set_target_hippitch(other.target_hippitch());
330 set_target_kneepitch(other.target_kneepitch());
331 set_target_anklepitch(other.target_anklepitch());
332 set_target_ankleroll(other.target_ankleroll());
333 set_target_hipyawpitchstiffness(other.target_hipyawpitchstiffness());
334 set_target_hiprollstiffness(other.target_hiprollstiffness());
335 set_target_hippitchstiffness(other.target_hippitchstiffness());
336 set_target_kneepitchstiffness(other.target_kneepitchstiffness());
337 set_target_anklepitchstiffness(other.target_anklepitchstiffness());
338 set_target_anklerollstiffness(other.target_anklerollstiffness());
339 set_target_hipyawpitch_active(other.target_hipyawpitch_active());
340 set_target_hiproll_active(other.target_hiproll_active());
341 set_target_hippitch_active(other.target_hippitch_active());
342 set_target_kneepitch_active(other.target_kneepitch_active());
343 set_target_anklepitch_active(other.target_anklepitch_active());
344 set_target_ankleroll_active(other.target_ankleroll_active());
345 set_target_movement_time(other.target_movement_time());
346 set_target_pliability(other.target_pliability());
347 set_target_leg_at_goal(other.target_leg_at_goal());
348 set_target_leg_stop(other.target_leg_stop());
349 return *this;
350 }
351
356 inline bool operator == (const wb_hal_legtarget &rhs)
357 {
358 if (
359 target_leg() == rhs.target_leg()
360 && target_hipyawpitch() == rhs.target_hipyawpitch()
361 && target_hiproll() == rhs.target_hiproll()
362 && target_hippitch() == rhs.target_hippitch()
363 && target_kneepitch() == rhs.target_kneepitch()
364 && target_anklepitch() == rhs.target_anklepitch()
365 && target_ankleroll() == rhs.target_ankleroll()
366 && target_hipyawpitchstiffness() == rhs.target_hipyawpitchstiffness()
367 && target_hiprollstiffness() == rhs.target_hiprollstiffness()
368 && target_hippitchstiffness() == rhs.target_hippitchstiffness()
369 && target_kneepitchstiffness() == rhs.target_kneepitchstiffness()
370 && target_anklepitchstiffness() == rhs.target_anklepitchstiffness()
371 && target_anklerollstiffness() == rhs.target_anklerollstiffness()
372 && target_hipyawpitch_active() == rhs.target_hipyawpitch_active()
373 && target_hiproll_active() == rhs.target_hiproll_active()
374 && target_hippitch_active() == rhs.target_hippitch_active()
375 && target_kneepitch_active() == rhs.target_kneepitch_active()
376 && target_anklepitch_active() == rhs.target_anklepitch_active()
377 && target_ankleroll_active() == rhs.target_ankleroll_active()
378 && target_movement_time() == rhs.target_movement_time()
379 && target_pliability() == rhs.target_pliability()
380 && target_leg_at_goal() == rhs.target_leg_at_goal()
381 && target_leg_stop() == rhs.target_leg_stop()
382 )
383 {
384 return true;
385 } else {
386 return false;
387 }
388 }
389
391 inline bool operator != (const wb_hal_legtarget &rhs)
392 {
393 return !((*this) == rhs);
394 }
395
396
397#endif // __cplusplus
398};
399
400
401
402#endif //wb_hal_legtarget_h
HalLegTarget c struct.
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool hipyawpitch_active
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t anklepitch
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool int32_t uint8_t pliability
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t kneepitch
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool anklepitch_active
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t anklepitchstiffness
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool int32_t movement_time
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool hippitch_active
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool kneepitch_active
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t anklerollstiffness
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t hiprollstiffness
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool int32_t uint8_t bool leg_at_goal
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool hiproll_active
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t hippitch
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t hiproll
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t hipyawpitch
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t ankleroll
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t hipyawpitchstiffness
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool ankleroll_active
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t kneepitchstiffness
target_hipyawpitch target_hippitch target_anklepitch target_leg target_hiprollstiffness target_kneepitchstiffness target_anklerollstiffness int16_t int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t hippitchstiffness
PROPERTY(int32_t, target_movement_time) PROPERTY(int16_t
Control Message: The elapsed time, in mSec, in which the movement should be completed.
#define LEFT_LEG
/file wb_hal_legtarget.h