gusimplewhiteboard
wb_hal_armtarget.h
Go to the documentation of this file.
1
9#ifndef wb_hal_armtarget_h
10#define wb_hal_armtarget_h
11
12#include <gu_util.h>
13#include <stdint.h>
14
15#define LEFT_ARM 0
16#define RIGHT_ARM 1
17
24#define SHOULDER_PITCH_LIMIT_DOWN_DEG 119.5f
25#define SHOULDER_PITCH_LIMIT_UP_DEG -SHOULDER_PITCH_LIMIT_DOWN_DEG
26
27#define LEFT_SHOULDER_ROLL_OUT_DEG 76.0f
28#define LEFT_SHOULDER_ROLL_IN_DEG -18.0f
29#define RIGHT_SHOULDER_ROLL_OUT_DEG -LEFT_SHOULDER_ROLL_OUT_DEG
30#define RIGHT_SHOULDER_ROLL_IN_DEG -LEFT_SHOULDER_ROLL_IN_DEG
31
32#define LEFT_ELBOW_ROLL_STRAIGHT_DEG -2.0f
33#define LEFT_ELBOW_ROLL_BENT_DEG -88.5f
34#define RIGHT_ELBOW_ROLL_STRAIGHT_DEG -LEFT_ELBOW_ROLL_STRAIGHT_DEG
35#define RIGHT_ELBOW_ROLL_BENT_DEG -LEFT_ELBOW_ROLL_BENT_DEG
36
37#define LEFT_ELBOW_YAW_RIGHT_DEG 119.5f
38#define LEFT_ELBOW_YAW_LEFT_DEG -LEFT_ELBOW_YAW_RIGHT_DEG
39#define RIGHT_ELBOW_YAW_RIGHT_DEG LEFT_ELBOW_YAW_RIGHT_DEG
40#define RIGHT_ELBOW_YAW_LEFT_DEG -LEFT_ELBOW_YAW_RIGHT_DEG
41
42#define LEFT_WRIST_YAW_RIGHT_DEG 104.5f
43#define LEFT_WRIST_YAW_LEFT_DEG -LEFT_WRIST_YAW_RIGHT_DEG
44#define RIGHT_WRIST_YAW_RIGHT_DEG LEFT_WRIST_YAW_RIGHT_DEG
45#define RIGHT_WRIST_YAW_LEFT_DEG -LEFT_WRIST_YAW_RIGHT_DEG
46
48#define SHOULDER_PITCH_LIMIT_DOWN_RAD 2.0857f
49#define SHOULDER_PITCH_LIMIT_UP_RAD -SHOULDER_PITCH_LIMIT_DOWN_RAD
50
51#define LEFT_SHOULDER_ROLL_OUT_RAD 1.3265f
52#define LEFT_SHOULDER_ROLL_IN_RAD -0.3142f
53#define RIGHT_SHOULDER_ROLL_OUT_RAD -LEFT_SHOULDER_ROLL_OUT_RAD
54#define RIGHT_SHOULDER_ROLL_IN_RAD -LEFT_SHOULDER_ROLL_IN_RAD
55
56#define LEFT_ELBOW_ROLL_STRAIGHT_RAD -0.0349f
57#define LEFT_ELBOW_ROLL_BENT_RAD -1.5446f
58#define RIGHT_ELBOW_ROLL_STRAIGHT_RAD -LEFT_ELBOW_ROLL_STRAIGHT_RAD
59#define RIGHT_ELBOW_ROLL_BENT_RAD -LEFT_ELBOW_ROLL_BENT_RAD
60
61#define LEFT_ELBOW_YAW_RIGHT_RAD 2.0857f
62#define LEFT_ELBOW_YAW_LEFT_RAD -LEFT_ELBOW_YAW_RIGHT_RAD
63#define RIGHT_ELBOW_YAW_RIGHT_RAD LEFT_ELBOW_YAW_RIGHT_RAD
64#define RIGHT_ELBOW_YAW_LEFT_RAD -LEFT_ELBOW_YAW_RIGHT_RAD
65
66#define LEFT_WRIST_YAW_RIGHT_RAD 1.8238f
67#define LEFT_WRIST_YAW_LEFT_RAD -LEFT_WRIST_YAW_RIGHT_RAD
68#define RIGHT_WRIST_YAW_RIGHT_RAD LEFT_WRIST_YAW_RIGHT_RAD
69#define RIGHT_WRIST_YAW_LEFT_RAD -LEFT_WRIST_YAW_RIGHT_RAD
70
86{
93 PROPERTY(int32_t, target_movement_time)
94
95
96 PROPERTY(int16_t, target_shoulderpitch)
97
98
99 PROPERTY(int16_t, target_shoulderroll)
100
102 PROPERTY(int16_t, target_elbowroll)
103
105 PROPERTY(int16_t, target_elbowyaw)
106
108 PROPERTY(int16_t, target_wristyaw)
109
115 PROPERTY(uint8_t, target_arm)
116
121 PROPERTY(uint8_t, target_hand)
122
124 PROPERTY(uint8_t, target_shoulderpitchstiffness)
125
127 PROPERTY(uint8_t, target_shoulderrollstiffness)
128
130 PROPERTY(uint8_t, target_elbowrollstiffness)
131
133 PROPERTY(uint8_t, target_elbowyawstiffness)
134
136 PROPERTY(uint8_t, target_wristyawstiffness)
137
139 PROPERTY(uint8_t, target_handstiffness)
140
148 PROPERTY(uint8_t, target_pliability)
149
162 BIT_PROPERTY(target_shoulderpitch_active)
163
168 BIT_PROPERTY(target_shoulderroll_active)
169
174 BIT_PROPERTY(target_elbowroll_active)
175
180 BIT_PROPERTY(target_elbowyaw_active)
181
186 BIT_PROPERTY(target_wrist_active)
187
192 BIT_PROPERTY(target_hand_active)
193
201 BIT_PROPERTY(target_arm_at_goal)
202
209 BIT_PROPERTY(target_arm_stop)
210
211
212
213#ifdef __cplusplus
245 wb_hal_armtarget(uint8_t arm = LEFT_ARM,
246 int16_t shoulderpitch = 0,
247 int16_t shoulderroll = 0,
248 int16_t elbowroll = 0,
249 int16_t elbowyaw = 0,
250 int16_t wristyaw = 0,
251 uint8_t hand = 0,
255 uint8_t elbowyawstiffness = 0,
256 uint8_t wristyawstiffness = 0,
257 uint8_t handstiffness = 0,
260 bool elbowroll_active = true,
261 bool elbowyaw_active = true,
262 bool wrist_active = true,
263 bool hand_active = true,
264 int32_t movement_time = INT_MAX, // Ensures sudden movements do not take place
265 uint8_t pliability = 0,
266 bool arm_at_goal = false,
267 bool arm_stop = false)
268 {
269 set_target_arm(arm);
270 set_target_shoulderpitch(shoulderpitch);
271 set_target_shoulderroll(shoulderroll);
272 set_target_elbowroll(elbowroll);
273 set_target_elbowyaw(elbowyaw);
274 set_target_wristyaw(wristyaw);
275 set_target_hand(hand);
276 set_target_shoulderpitchstiffness(shoulderpitchstiffness);
277 set_target_shoulderrollstiffness(shoulderrollstiffness);
278 set_target_elbowrollstiffness(elbowrollstiffness);
279 set_target_elbowyawstiffness(elbowyawstiffness);
280 set_target_wristyawstiffness(wristyawstiffness);
281 set_target_handstiffness(handstiffness);
282 set_target_shoulderpitch_active(shoulderpitch_active);
283 set_target_shoulderroll_active(shoulderroll_active);
284 set_target_elbowroll_active(elbowroll_active);
285 set_target_elbowyaw_active(elbowyaw_active);
286 set_target_wrist_active(wrist_active);
287 set_target_hand_active(hand_active);
288 set_target_movement_time(movement_time);
289 set_target_pliability(pliability);
290 set_target_arm_at_goal(arm_at_goal);
291 set_target_arm_stop(arm_stop);
292 }
293
296 {
297 set_target_arm(other.target_arm());
298 set_target_shoulderpitch(other.target_shoulderpitch());
299 set_target_shoulderroll(other.target_shoulderroll());
300 set_target_elbowroll(other.target_elbowroll());
301 set_target_elbowyaw(other.target_elbowyaw());
302 set_target_wristyaw(other.target_wristyaw());
303 set_target_hand(other.target_hand());
304 set_target_shoulderpitchstiffness(other.target_shoulderpitchstiffness());
305 set_target_shoulderrollstiffness(other.target_shoulderrollstiffness());
306 set_target_elbowrollstiffness(other.target_elbowrollstiffness());
307 set_target_elbowyawstiffness(other.target_elbowyawstiffness());
308 set_target_wristyawstiffness(other.target_wristyawstiffness());
309 set_target_handstiffness(other.target_handstiffness());
310 set_target_shoulderpitch_active(other.target_shoulderpitch_active());
311 set_target_shoulderroll_active(other.target_shoulderroll_active());
312 set_target_elbowroll_active(other.target_elbowroll_active());
313 set_target_elbowyaw_active(other.target_elbowyaw_active());
314 set_target_wrist_active(other.target_wrist_active());
315 set_target_hand_active(other.target_hand_active());
316 set_target_movement_time(other.target_movement_time());
317 set_target_pliability(other.target_pliability());
318 set_target_arm_at_goal(other.target_arm_at_goal());
319 set_target_arm_stop(other.target_arm_stop());
320 }
321
323 wb_hal_armtarget &operator = (const wb_hal_armtarget &other)
324 {
325 set_target_arm(other.target_arm());
326 set_target_shoulderpitch(other.target_shoulderpitch());
327 set_target_shoulderroll(other.target_shoulderroll());
328 set_target_elbowroll(other.target_elbowroll());
329 set_target_elbowyaw(other.target_elbowyaw());
330 set_target_wristyaw(other.target_wristyaw());
331 set_target_hand(other.target_hand());
332 set_target_shoulderpitchstiffness(other.target_shoulderpitchstiffness());
333 set_target_shoulderrollstiffness(other.target_shoulderrollstiffness());
334 set_target_elbowrollstiffness(other.target_elbowrollstiffness());
335 set_target_elbowyawstiffness(other.target_elbowyawstiffness());
336 set_target_wristyawstiffness(other.target_wristyawstiffness());
337 set_target_handstiffness(other.target_handstiffness());
338 set_target_shoulderpitch_active(other.target_shoulderpitch_active());
339 set_target_shoulderroll_active(other.target_shoulderroll_active());
340 set_target_elbowroll_active(other.target_elbowroll_active());
341 set_target_elbowyaw_active(other.target_elbowyaw_active());
342 set_target_wrist_active(other.target_wrist_active());
343 set_target_hand_active(other.target_hand_active());
344 set_target_movement_time(other.target_movement_time());
345 set_target_pliability(other.target_pliability());
346 set_target_arm_at_goal(other.target_arm_at_goal());
347 set_target_arm_stop(other.target_arm_stop());
348 return *this;
349 }
350
355 inline bool operator == (const wb_hal_armtarget &rhs)
356 {
357 if (
358 target_arm() == rhs.target_arm()
359 && target_shoulderpitch() == rhs.target_shoulderpitch()
360 && target_shoulderroll() == rhs.target_shoulderroll()
361 && target_elbowroll() == rhs.target_elbowroll()
362 && target_elbowyaw() == rhs.target_elbowyaw()
363 && target_wristyaw() == rhs.target_wristyaw()
364 && target_hand() == rhs.target_hand()
365 && target_shoulderpitchstiffness() == rhs.target_shoulderpitchstiffness()
366 && target_shoulderrollstiffness() == rhs.target_shoulderrollstiffness()
367 && target_elbowrollstiffness() == rhs.target_elbowrollstiffness()
368 && target_elbowyawstiffness() == rhs.target_elbowyawstiffness()
369 && target_wristyawstiffness() == rhs.target_wristyawstiffness()
370 && target_handstiffness() == rhs.target_handstiffness()
371 && target_shoulderpitch_active() == rhs.target_shoulderpitch_active()
372 && target_shoulderroll_active() == rhs.target_shoulderroll_active()
373 && target_elbowroll_active() == rhs.target_elbowroll_active()
374 && target_elbowyaw_active() == rhs.target_elbowyaw_active()
375 && target_wrist_active() == rhs.target_wrist_active()
376 && target_hand_active() == rhs.target_hand_active()
377 && target_movement_time() == rhs.target_movement_time()
378 && target_pliability() == rhs.target_pliability()
379 && target_arm_at_goal() == rhs.target_arm_at_goal()
380 && target_arm_stop() == rhs.target_arm_stop()
381 )
382 {
383 return true;
384 } else {
385 return false;
386 }
387 }
388
390 inline bool operator != (const wb_hal_armtarget &rhs)
391 {
392 return !((*this) == rhs);
393 }
394
395
396#endif // __cplusplus
397};
398
399
400
401#endif //wb_hal_armtarget_h
HalArmTarget c struct.
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t wristyaw
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t wristyawstiffness
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t elbowyawstiffness
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_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_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t elbowyaw
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t shoulderrollstiffness
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t shoulderpitch
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool int32_t uint8_t bool arm_at_goal
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool hand_active
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool shoulderroll_active
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t elbowroll
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool wrist_active
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t handstiffness
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool shoulderpitch_active
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t shoulderroll
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool bool bool int32_t movement_time
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool bool elbowyaw_active
PROPERTY(int32_t, target_movement_time) PROPERTY(int16_t
Control Message: The elapsed time, in mSec, in which the movement should be completed.
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t uint8_t bool bool bool elbowroll_active
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t hand
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t shoulderpitchstiffness
target_shoulderpitch target_elbowroll target_wristyaw target_hand target_shoulderrollstiffness target_elbowyawstiffness target_handstiffness int16_t int16_t int16_t int16_t int16_t uint8_t uint8_t uint8_t uint8_t elbowrollstiffness
#define LEFT_ARM
/file wb_hal_armtarget.h