Fawkes API Fawkes Development Version
DynamixelServoInterface.h
1
2/***************************************************************************
3 * DynamixelServoInterface.h - Fawkes BlackBoard Interface - DynamixelServoInterface
4 *
5 * Templated created: Thu Oct 12 10:49:19 2006
6 * Copyright 2015 Tim Niemueller, Nicolas Limpert
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _INTERFACES_DYNAMIXELSERVOINTERFACE_H_
25#define _INTERFACES_DYNAMIXELSERVOINTERFACE_H_
26
27#include <interface/interface.h>
28#include <interface/message.h>
29#include <interface/field_iterator.h>
30
31namespace fawkes {
32
34{
35 /// @cond INTERNALS
36 INTERFACE_MGMT_FRIENDS(DynamixelServoInterface)
37 /// @endcond
38 public:
39 /* constants */
40
41 /** Error code to explain an error */
42 typedef enum {
43 ERROR_NONE = 0 /**< No error occured. */,
44 ERROR_UNSPECIFIC = 1 /**< Some unspecified error occured. */,
45 ERROR_COMMUNICATION = 2 /**<
46 Communication with device failed.
47 */,
49 Desired angle is out of range.
50 */
52 const char * tostring_ErrorCode(ErrorCode value) const;
53
54 /** Mode to be set for the servo */
55 typedef enum {
56 JOINT = 0 /**< Joint mode to move in a range of -2.616 to +2.616 rad. */,
57 WHEEL = 1 /**< Wheel mode to use the servo in a continuously rotating mode.
58 The rotation speed is set by bits 0-9 in the goal speed setting. Bit 10 of the goal speed setting sets the desired rotation direction, 0 for CCW direction turn and 1 for CW direction turn. */
60 const char * tostring_WorkingMode(WorkingMode value) const;
61
62 private:
63 /** Internal data storage, do NOT modify! */
64 typedef struct {
65 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
66 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
67 char model[8]; /**< Model if known */
68 uint32_t model_number; /**< Model number */
69 uint32_t cw_angle_limit; /**< Clockwise angle limit */
70 uint32_t ccw_angle_limit; /**< Counter-clockwise angle limit */
71 uint8_t temperature_limit; /**< Temperature limit */
72 uint32_t max_torque; /**< Max torque */
73 uint8_t cw_margin; /**< CW Compliance Margin */
74 uint8_t ccw_margin; /**< CCW Compliance Margin */
75 uint8_t cw_slope; /**< CW Compliance Slope */
76 uint8_t ccw_slope; /**< CCW Compliance Slope */
77 uint32_t goal_position; /**< Goal position */
78 uint32_t goal_speed; /**< Goal speed */
79 uint32_t torque_limit; /**< Torque limit */
80 uint32_t position; /**< Present position */
81 uint32_t speed; /**< Present speed */
82 uint32_t load; /**< Present load */
83 uint8_t voltage; /**< Present voltage */
84 uint8_t temperature; /**< Present temperature */
85 uint32_t punch; /**< Punch */
86 uint8_t alarm_shutdown; /**< Alarm Shutdown.
87 The bitmask is set as follows (taken from Trossen Robotics PDF "AX-12(English).pdf"):
88 Bit 7: 0
89 Bit 6: If set to 1, torque off when an Instruction Error occurs
90 Bit 5: If set to 1, torque off when an Overload Error occurs
91 Bit 4: If set to 1, torque off when a Checksum Error occurs
92 Bit 3: If set to 1, torque off when a Range Error occurs
93 Bit 2: If set to 1, torque off when an Overheating Error occurs
94 Bit 1: If set to 1, torque off when an Angle Limit Error occurs
95 Bit 0: If set to 1, torque off when an Input Voltage Error occurs
96 */
97 uint8_t error; /**< Raw error code from servo.
98 The bitmask is set as follows (taken from Trossen Robotics PDF "AX-12(English).pdf"):
99 Bit 7: 0
100 Bit 6: Set to 1 if an undefined instruction is sent or an action instruction is sent without a Reg_Write instruction.
101 Bit 5: Set to 1 if the specified maximum torque can't control the applied load.
102 Bit 4: Set to 1 if the checksum of the instruction packet is incorrect.
103 Bit 3: Set to 1 if the instruction sent is out of the defined range.
104 Bit 2: Set to 1 if the internal temperature of the Dynamixel unit is above the operating temperature range as defined in the control table.
105 Bit 1: Set as 1 if the Goal Position is set outside of the range between CW Angle Limit and CCW Angle Limit.
106 Bit 0: Set to 1 if the voltage is out of the operating voltage range as defined in the control table.
107 */
108 bool enable_prevent_alarm_shutdown; /**< Enable alarm shutdown */
109 float angle; /**< Current angle. */
110 bool enabled; /**< Is the servo enabled? */
111 float min_angle; /**< Minimum angle allowed. */
112 float max_angle; /**< Maximum angle allowed. */
113 float max_velocity; /**< Maximum supported velocity. */
114 float velocity; /**< Maximum servo velocity currently reached. */
115 char mode[5]; /**< Working mode, can either be JOINT or WHEEL */
116 float angle_margin; /**<
117 Margin in radians around a target servo value to consider the
118 motion as final.
119 */
120 bool autorecover_enabled; /**< Automatically recover on alarm shutdown */
121 uint32_t msgid; /**< The ID of the message that is currently being
122 processed, or 0 if no message is being processed. */
123 bool final; /**< True, if the last goto command has been finished,
124 false if it is still running */
125 int32_t error_code; /**< Failure code set if
126 final is true. ERROR_NONE if no error occured. */
127 } DynamixelServoInterface_data_t;
128
129 DynamixelServoInterface_data_t *data;
130
131 interface_enum_map_t enum_map_ErrorCode;
132 interface_enum_map_t enum_map_WorkingMode;
133 public:
134 /* messages */
135 class StopMessage : public Message
136 {
137 private:
138 /** Internal data storage, do NOT modify! */
139 typedef struct {
140 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
141 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
142 } StopMessage_data_t;
143
144 StopMessage_data_t *data;
145
146 interface_enum_map_t enum_map_ErrorCode;
147 interface_enum_map_t enum_map_WorkingMode;
148 public:
149 StopMessage();
150 ~StopMessage();
151
152 explicit StopMessage(const StopMessage *m);
153 /* Methods */
154 virtual Message * clone() const;
155 };
156
157 class FlushMessage : public Message
158 {
159 private:
160 /** Internal data storage, do NOT modify! */
161 typedef struct {
162 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
163 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
164 } FlushMessage_data_t;
165
166 FlushMessage_data_t *data;
167
168 interface_enum_map_t enum_map_ErrorCode;
169 interface_enum_map_t enum_map_WorkingMode;
170 public:
171 FlushMessage();
173
174 explicit FlushMessage(const FlushMessage *m);
175 /* Methods */
176 virtual Message * clone() const;
177 };
178
179 class GotoMessage : public Message
180 {
181 private:
182 /** Internal data storage, do NOT modify! */
183 typedef struct {
184 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
185 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
186 float angle; /**< Current angle. */
187 } GotoMessage_data_t;
188
189 GotoMessage_data_t *data;
190
191 interface_enum_map_t enum_map_ErrorCode;
192 interface_enum_map_t enum_map_WorkingMode;
193 public:
194 GotoMessage(const float ini_angle);
195 GotoMessage();
196 ~GotoMessage();
197
198 explicit GotoMessage(const GotoMessage *m);
199 /* Methods */
200 float angle() const;
201 void set_angle(const float new_angle);
202 size_t maxlenof_angle() const;
203 virtual Message * clone() const;
204 };
205
207 {
208 private:
209 /** Internal data storage, do NOT modify! */
210 typedef struct {
211 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
212 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
213 float time_sec; /**< Time in seconds when to reach
214 the final position. */
215 float angle; /**< Current angle. */
216 } TimedGotoMessage_data_t;
217
218 TimedGotoMessage_data_t *data;
219
220 interface_enum_map_t enum_map_ErrorCode;
221 interface_enum_map_t enum_map_WorkingMode;
222 public:
223 TimedGotoMessage(const float ini_time_sec, const float ini_angle);
226
227 explicit TimedGotoMessage(const TimedGotoMessage *m);
228 /* Methods */
229 float time_sec() const;
230 void set_time_sec(const float new_time_sec);
231 size_t maxlenof_time_sec() const;
232 float angle() const;
233 void set_angle(const float new_angle);
234 size_t maxlenof_angle() const;
235 virtual Message * clone() const;
236 };
237
238 class SetModeMessage : public Message
239 {
240 private:
241 /** Internal data storage, do NOT modify! */
242 typedef struct {
243 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
244 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
245 uint8_t mode; /**< New mode, see the enum WorkingMode in this interface */
246 } SetModeMessage_data_t;
247
248 SetModeMessage_data_t *data;
249
250 interface_enum_map_t enum_map_ErrorCode;
251 interface_enum_map_t enum_map_WorkingMode;
252 public:
253 SetModeMessage(const uint8_t ini_mode);
256
257 explicit SetModeMessage(const SetModeMessage *m);
258 /* Methods */
259 uint8_t mode() const;
260 void set_mode(const uint8_t new_mode);
261 size_t maxlenof_mode() const;
262 virtual Message * clone() const;
263 };
264
266 {
267 private:
268 /** Internal data storage, do NOT modify! */
269 typedef struct {
270 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
271 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
272 uint16_t speed; /**< New speed. Used when the servo is in wheel mode. Bits 0-9 determine the rotation speed and bit 10 determines the rotation direction (0 for ccw and 1 for cw) */
273 } SetSpeedMessage_data_t;
274
275 SetSpeedMessage_data_t *data;
276
277 interface_enum_map_t enum_map_ErrorCode;
278 interface_enum_map_t enum_map_WorkingMode;
279 public:
280 SetSpeedMessage(const uint16_t ini_speed);
283
284 explicit SetSpeedMessage(const SetSpeedMessage *m);
285 /* Methods */
286 uint16_t speed() const;
287 void set_speed(const uint16_t new_speed);
288 size_t maxlenof_speed() const;
289 virtual Message * clone() const;
290 };
291
293 {
294 private:
295 /** Internal data storage, do NOT modify! */
296 typedef struct {
297 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
298 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
299 bool enabled; /**< Is the servo enabled? */
300 } SetEnabledMessage_data_t;
301
302 SetEnabledMessage_data_t *data;
303
304 interface_enum_map_t enum_map_ErrorCode;
305 interface_enum_map_t enum_map_WorkingMode;
306 public:
307 SetEnabledMessage(const bool ini_enabled);
310
311 explicit SetEnabledMessage(const SetEnabledMessage *m);
312 /* Methods */
313 bool is_enabled() const;
314 void set_enabled(const bool new_enabled);
315 size_t maxlenof_enabled() const;
316 virtual Message * clone() const;
317 };
318
320 {
321 private:
322 /** Internal data storage, do NOT modify! */
323 typedef struct {
324 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
325 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
326 float velocity; /**< Maximum servo velocity currently reached. */
327 } SetVelocityMessage_data_t;
328
329 SetVelocityMessage_data_t *data;
330
331 interface_enum_map_t enum_map_ErrorCode;
332 interface_enum_map_t enum_map_WorkingMode;
333 public:
334 SetVelocityMessage(const float ini_velocity);
337
338 explicit SetVelocityMessage(const SetVelocityMessage *m);
339 /* Methods */
340 float velocity() const;
341 void set_velocity(const float new_velocity);
342 size_t maxlenof_velocity() const;
343 virtual Message * clone() const;
344 };
345
347 {
348 private:
349 /** Internal data storage, do NOT modify! */
350 typedef struct {
351 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
352 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
353 float angle_margin; /**<
354 Margin in radians around a target servo value to consider the
355 motion as final.
356 */
357 } SetMarginMessage_data_t;
358
359 SetMarginMessage_data_t *data;
360
361 interface_enum_map_t enum_map_ErrorCode;
362 interface_enum_map_t enum_map_WorkingMode;
363 public:
364 SetMarginMessage(const float ini_angle_margin);
367
368 explicit SetMarginMessage(const SetMarginMessage *m);
369 /* Methods */
370 float angle_margin() const;
371 void set_angle_margin(const float new_angle_margin);
372 size_t maxlenof_angle_margin() const;
373 virtual Message * clone() const;
374 };
375
377 {
378 private:
379 /** Internal data storage, do NOT modify! */
380 typedef struct {
381 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
382 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
383 uint8_t cw_margin; /**< New CW compliance margin */
384 uint8_t ccw_margin; /**< New CCW compliance margin */
385 uint8_t cw_slope; /**< New CW compliance slope */
386 uint8_t ccw_slope; /**< New LED enabled value */
387 } SetComplianceValuesMessage_data_t;
388
389 SetComplianceValuesMessage_data_t *data;
390
391 interface_enum_map_t enum_map_ErrorCode;
392 interface_enum_map_t enum_map_WorkingMode;
393 public:
394 SetComplianceValuesMessage(const uint8_t ini_cw_margin, const uint8_t ini_ccw_margin, const uint8_t ini_cw_slope, const uint8_t ini_ccw_slope);
397
399 /* Methods */
400 uint8_t cw_margin() const;
401 void set_cw_margin(const uint8_t new_cw_margin);
402 size_t maxlenof_cw_margin() const;
403 uint8_t ccw_margin() const;
404 void set_ccw_margin(const uint8_t new_ccw_margin);
405 size_t maxlenof_ccw_margin() const;
406 uint8_t cw_slope() const;
407 void set_cw_slope(const uint8_t new_cw_slope);
408 size_t maxlenof_cw_slope() const;
409 uint8_t ccw_slope() const;
410 void set_ccw_slope(const uint8_t new_ccw_slope);
411 size_t maxlenof_ccw_slope() const;
412 virtual Message * clone() const;
413 };
414
416 {
417 private:
418 /** Internal data storage, do NOT modify! */
419 typedef struct {
420 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
421 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
422 uint32_t goal_speed; /**< New goal speed */
423 } SetGoalSpeedMessage_data_t;
424
425 SetGoalSpeedMessage_data_t *data;
426
427 interface_enum_map_t enum_map_ErrorCode;
428 interface_enum_map_t enum_map_WorkingMode;
429 public:
430 SetGoalSpeedMessage(const uint32_t ini_goal_speed);
433
434 explicit SetGoalSpeedMessage(const SetGoalSpeedMessage *m);
435 /* Methods */
436 uint32_t goal_speed() const;
437 void set_goal_speed(const uint32_t new_goal_speed);
438 size_t maxlenof_goal_speed() const;
439 virtual Message * clone() const;
440 };
441
443 {
444 private:
445 /** Internal data storage, do NOT modify! */
446 typedef struct {
447 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
448 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
449 uint32_t torque_limit; /**< New torque limit */
450 } SetTorqueLimitMessage_data_t;
451
452 SetTorqueLimitMessage_data_t *data;
453
454 interface_enum_map_t enum_map_ErrorCode;
455 interface_enum_map_t enum_map_WorkingMode;
456 public:
457 SetTorqueLimitMessage(const uint32_t ini_torque_limit);
460
462 /* Methods */
463 uint32_t torque_limit() const;
464 void set_torque_limit(const uint32_t new_torque_limit);
465 size_t maxlenof_torque_limit() const;
466 virtual Message * clone() const;
467 };
468
470 {
471 private:
472 /** Internal data storage, do NOT modify! */
473 typedef struct {
474 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
475 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
476 uint32_t punch; /**< New punch */
477 } SetPunchMessage_data_t;
478
479 SetPunchMessage_data_t *data;
480
481 interface_enum_map_t enum_map_ErrorCode;
482 interface_enum_map_t enum_map_WorkingMode;
483 public:
484 SetPunchMessage(const uint32_t ini_punch);
487
488 explicit SetPunchMessage(const SetPunchMessage *m);
489 /* Methods */
490 uint32_t punch() const;
491 void set_punch(const uint32_t new_punch);
492 size_t maxlenof_punch() const;
493 virtual Message * clone() const;
494 };
495
497 {
498 private:
499 /** Internal data storage, do NOT modify! */
500 typedef struct {
501 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
502 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
503 uint32_t position; /**< New position */
504 } GotoPositionMessage_data_t;
505
506 GotoPositionMessage_data_t *data;
507
508 interface_enum_map_t enum_map_ErrorCode;
509 interface_enum_map_t enum_map_WorkingMode;
510 public:
511 GotoPositionMessage(const uint32_t ini_position);
514
515 explicit GotoPositionMessage(const GotoPositionMessage *m);
516 /* Methods */
517 uint32_t position() const;
518 void set_position(const uint32_t new_position);
519 size_t maxlenof_position() const;
520 virtual Message * clone() const;
521 };
522
524 {
525 private:
526 /** Internal data storage, do NOT modify! */
527 typedef struct {
528 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
529 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
530 uint32_t angle_limit_cw; /**< New cw angle limit */
531 uint32_t angle_limit_ccw; /**< New ccw angle limit */
532 } SetAngleLimitsMessage_data_t;
533
534 SetAngleLimitsMessage_data_t *data;
535
536 interface_enum_map_t enum_map_ErrorCode;
537 interface_enum_map_t enum_map_WorkingMode;
538 public:
539 SetAngleLimitsMessage(const uint32_t ini_angle_limit_cw, const uint32_t ini_angle_limit_ccw);
542
544 /* Methods */
545 uint32_t angle_limit_cw() const;
546 void set_angle_limit_cw(const uint32_t new_angle_limit_cw);
547 size_t maxlenof_angle_limit_cw() const;
548 uint32_t angle_limit_ccw() const;
549 void set_angle_limit_ccw(const uint32_t new_angle_limit_ccw);
550 size_t maxlenof_angle_limit_ccw() const;
551 virtual Message * clone() const;
552 };
553
555 {
556 private:
557 /** Internal data storage, do NOT modify! */
558 typedef struct {
559 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
560 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
561 } ResetRawErrorMessage_data_t;
562
563 ResetRawErrorMessage_data_t *data;
564
565 interface_enum_map_t enum_map_ErrorCode;
566 interface_enum_map_t enum_map_WorkingMode;
567 public:
570
572 /* Methods */
573 virtual Message * clone() const;
574 };
575
577 {
578 private:
579 /** Internal data storage, do NOT modify! */
580 typedef struct {
581 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
582 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
583 bool enable_prevent_alarm_shutdown; /**< Enable alarm shutdown */
584 } SetPreventAlarmShutdownMessage_data_t;
585
586 SetPreventAlarmShutdownMessage_data_t *data;
587
588 interface_enum_map_t enum_map_ErrorCode;
589 interface_enum_map_t enum_map_WorkingMode;
590 public:
591 SetPreventAlarmShutdownMessage(const bool ini_enable_prevent_alarm_shutdown);
594
596 /* Methods */
598 void set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown);
600 virtual Message * clone() const;
601 };
602
604 {
605 private:
606 /** Internal data storage, do NOT modify! */
607 typedef struct {
608 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
609 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
610 bool autorecover_enabled; /**< Automatically recover on alarm shutdown */
611 } SetAutorecoverEnabledMessage_data_t;
612
613 SetAutorecoverEnabledMessage_data_t *data;
614
615 interface_enum_map_t enum_map_ErrorCode;
616 interface_enum_map_t enum_map_WorkingMode;
617 public:
618 SetAutorecoverEnabledMessage(const bool ini_autorecover_enabled);
621
623 /* Methods */
624 bool is_autorecover_enabled() const;
625 void set_autorecover_enabled(const bool new_autorecover_enabled);
626 size_t maxlenof_autorecover_enabled() const;
627 virtual Message * clone() const;
628 };
629
630 class RecoverMessage : public Message
631 {
632 private:
633 /** Internal data storage, do NOT modify! */
634 typedef struct {
635 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
636 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
637 } RecoverMessage_data_t;
638
639 RecoverMessage_data_t *data;
640
641 interface_enum_map_t enum_map_ErrorCode;
642 interface_enum_map_t enum_map_WorkingMode;
643 public:
646
647 explicit RecoverMessage(const RecoverMessage *m);
648 /* Methods */
649 virtual Message * clone() const;
650 };
651
652 virtual bool message_valid(const Message *message) const;
653 private:
656
657 public:
658 /* Methods */
659 char * model() const;
660 void set_model(const char * new_model);
661 size_t maxlenof_model() const;
662 uint32_t model_number() const;
663 void set_model_number(const uint32_t new_model_number);
664 size_t maxlenof_model_number() const;
665 uint32_t cw_angle_limit() const;
666 void set_cw_angle_limit(const uint32_t new_cw_angle_limit);
667 size_t maxlenof_cw_angle_limit() const;
668 uint32_t ccw_angle_limit() const;
669 void set_ccw_angle_limit(const uint32_t new_ccw_angle_limit);
670 size_t maxlenof_ccw_angle_limit() const;
671 uint8_t temperature_limit() const;
672 void set_temperature_limit(const uint8_t new_temperature_limit);
673 size_t maxlenof_temperature_limit() const;
674 uint32_t max_torque() const;
675 void set_max_torque(const uint32_t new_max_torque);
676 size_t maxlenof_max_torque() const;
677 uint8_t cw_margin() const;
678 void set_cw_margin(const uint8_t new_cw_margin);
679 size_t maxlenof_cw_margin() const;
680 uint8_t ccw_margin() const;
681 void set_ccw_margin(const uint8_t new_ccw_margin);
682 size_t maxlenof_ccw_margin() const;
683 uint8_t cw_slope() const;
684 void set_cw_slope(const uint8_t new_cw_slope);
685 size_t maxlenof_cw_slope() const;
686 uint8_t ccw_slope() const;
687 void set_ccw_slope(const uint8_t new_ccw_slope);
688 size_t maxlenof_ccw_slope() const;
689 uint32_t goal_position() const;
690 void set_goal_position(const uint32_t new_goal_position);
691 size_t maxlenof_goal_position() const;
692 uint32_t goal_speed() const;
693 void set_goal_speed(const uint32_t new_goal_speed);
694 size_t maxlenof_goal_speed() const;
695 uint32_t torque_limit() const;
696 void set_torque_limit(const uint32_t new_torque_limit);
697 size_t maxlenof_torque_limit() const;
698 uint32_t position() const;
699 void set_position(const uint32_t new_position);
700 size_t maxlenof_position() const;
701 uint32_t speed() const;
702 void set_speed(const uint32_t new_speed);
703 size_t maxlenof_speed() const;
704 uint32_t load() const;
705 void set_load(const uint32_t new_load);
706 size_t maxlenof_load() const;
707 uint8_t voltage() const;
708 void set_voltage(const uint8_t new_voltage);
709 size_t maxlenof_voltage() const;
710 uint8_t temperature() const;
711 void set_temperature(const uint8_t new_temperature);
712 size_t maxlenof_temperature() const;
713 uint32_t punch() const;
714 void set_punch(const uint32_t new_punch);
715 size_t maxlenof_punch() const;
716 uint8_t alarm_shutdown() const;
717 void set_alarm_shutdown(const uint8_t new_alarm_shutdown);
718 size_t maxlenof_alarm_shutdown() const;
719 uint8_t error() const;
720 void set_error(const uint8_t new_error);
721 size_t maxlenof_error() const;
723 void set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown);
725 float angle() const;
726 void set_angle(const float new_angle);
727 size_t maxlenof_angle() const;
728 bool is_enabled() const;
729 void set_enabled(const bool new_enabled);
730 size_t maxlenof_enabled() const;
731 float min_angle() const;
732 void set_min_angle(const float new_min_angle);
733 size_t maxlenof_min_angle() const;
734 float max_angle() const;
735 void set_max_angle(const float new_max_angle);
736 size_t maxlenof_max_angle() const;
737 float max_velocity() const;
738 void set_max_velocity(const float new_max_velocity);
739 size_t maxlenof_max_velocity() const;
740 float velocity() const;
741 void set_velocity(const float new_velocity);
742 size_t maxlenof_velocity() const;
743 char * mode() const;
744 void set_mode(const char * new_mode);
745 size_t maxlenof_mode() const;
746 float angle_margin() const;
747 void set_angle_margin(const float new_angle_margin);
748 size_t maxlenof_angle_margin() const;
749 bool is_autorecover_enabled() const;
750 void set_autorecover_enabled(const bool new_autorecover_enabled);
751 size_t maxlenof_autorecover_enabled() const;
752 uint32_t msgid() const;
753 void set_msgid(const uint32_t new_msgid);
754 size_t maxlenof_msgid() const;
755 bool is_final() const;
756 void set_final(const bool new_final);
757 size_t maxlenof_final() const;
758 ErrorCode error_code() const;
759 void set_error_code(const ErrorCode new_error_code);
760 size_t maxlenof_error_code() const;
761 virtual Message * create_message(const char *type) const;
762
763 virtual void copy_values(const Interface *other);
764 virtual const char * enum_tostring(const char *enumtype, int val) const;
765
766};
767
768} // end namespace fawkes
769
770#endif
FlushMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
GotoMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_angle(const float new_angle)
Set angle value.
size_t maxlenof_angle() const
Get maximum length of angle value.
GotoPositionMessage Fawkes BlackBoard Interface Message.
void set_position(const uint32_t new_position)
Set position value.
size_t maxlenof_position() const
Get maximum length of position value.
virtual Message * clone() const
Clone this message.
RecoverMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
ResetRawErrorMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
SetAngleLimitsMessage Fawkes BlackBoard Interface Message.
uint32_t angle_limit_cw() const
Get angle_limit_cw value.
uint32_t angle_limit_ccw() const
Get angle_limit_ccw value.
size_t maxlenof_angle_limit_cw() const
Get maximum length of angle_limit_cw value.
void set_angle_limit_ccw(const uint32_t new_angle_limit_ccw)
Set angle_limit_ccw value.
size_t maxlenof_angle_limit_ccw() const
Get maximum length of angle_limit_ccw value.
void set_angle_limit_cw(const uint32_t new_angle_limit_cw)
Set angle_limit_cw value.
virtual Message * clone() const
Clone this message.
SetAutorecoverEnabledMessage Fawkes BlackBoard Interface Message.
void set_autorecover_enabled(const bool new_autorecover_enabled)
Set autorecover_enabled value.
size_t maxlenof_autorecover_enabled() const
Get maximum length of autorecover_enabled value.
SetComplianceValuesMessage Fawkes BlackBoard Interface Message.
void set_ccw_margin(const uint8_t new_ccw_margin)
Set ccw_margin value.
size_t maxlenof_ccw_slope() const
Get maximum length of ccw_slope value.
size_t maxlenof_ccw_margin() const
Get maximum length of ccw_margin value.
size_t maxlenof_cw_slope() const
Get maximum length of cw_slope value.
size_t maxlenof_cw_margin() const
Get maximum length of cw_margin value.
void set_cw_slope(const uint8_t new_cw_slope)
Set cw_slope value.
void set_ccw_slope(const uint8_t new_ccw_slope)
Set ccw_slope value.
void set_cw_margin(const uint8_t new_cw_margin)
Set cw_margin value.
SetEnabledMessage Fawkes BlackBoard Interface Message.
void set_enabled(const bool new_enabled)
Set enabled value.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
virtual Message * clone() const
Clone this message.
SetGoalSpeedMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_goal_speed() const
Get maximum length of goal_speed value.
void set_goal_speed(const uint32_t new_goal_speed)
Set goal_speed value.
virtual Message * clone() const
Clone this message.
SetMarginMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_angle_margin() const
Get maximum length of angle_margin value.
virtual Message * clone() const
Clone this message.
void set_angle_margin(const float new_angle_margin)
Set angle_margin value.
SetModeMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_mode() const
Get maximum length of mode value.
void set_mode(const uint8_t new_mode)
Set mode value.
virtual Message * clone() const
Clone this message.
SetPreventAlarmShutdownMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_enable_prevent_alarm_shutdown() const
Get maximum length of enable_prevent_alarm_shutdown value.
bool is_enable_prevent_alarm_shutdown() const
Get enable_prevent_alarm_shutdown value.
void set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown)
Set enable_prevent_alarm_shutdown value.
SetPunchMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_punch() const
Get maximum length of punch value.
virtual Message * clone() const
Clone this message.
void set_punch(const uint32_t new_punch)
Set punch value.
SetSpeedMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
size_t maxlenof_speed() const
Get maximum length of speed value.
void set_speed(const uint16_t new_speed)
Set speed value.
SetTorqueLimitMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_torque_limit(const uint32_t new_torque_limit)
Set torque_limit value.
size_t maxlenof_torque_limit() const
Get maximum length of torque_limit value.
SetVelocityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_velocity() const
Get maximum length of velocity value.
virtual Message * clone() const
Clone this message.
void set_velocity(const float new_velocity)
Set velocity value.
StopMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
TimedGotoMessage Fawkes BlackBoard Interface Message.
void set_time_sec(const float new_time_sec)
Set time_sec value.
void set_angle(const float new_angle)
Set angle value.
size_t maxlenof_angle() const
Get maximum length of angle value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_time_sec() const
Get maximum length of time_sec value.
DynamixelServoInterface Fawkes BlackBoard Interface.
uint8_t voltage() const
Get voltage value.
size_t maxlenof_ccw_slope() const
Get maximum length of ccw_slope value.
size_t maxlenof_position() const
Get maximum length of position value.
void set_temperature_limit(const uint8_t new_temperature_limit)
Set temperature_limit value.
size_t maxlenof_speed() const
Get maximum length of speed value.
size_t maxlenof_enable_prevent_alarm_shutdown() const
Get maximum length of enable_prevent_alarm_shutdown value.
uint32_t punch() const
Get punch value.
const char * tostring_ErrorCode(ErrorCode value) const
Convert ErrorCode constant to string.
uint8_t ccw_slope() const
Get ccw_slope value.
size_t maxlenof_min_angle() const
Get maximum length of min_angle value.
void set_alarm_shutdown(const uint8_t new_alarm_shutdown)
Set alarm_shutdown value.
void set_error_code(const ErrorCode new_error_code)
Set error_code value.
size_t maxlenof_ccw_margin() const
Get maximum length of ccw_margin value.
void set_cw_slope(const uint8_t new_cw_slope)
Set cw_slope value.
size_t maxlenof_cw_angle_limit() const
Get maximum length of cw_angle_limit value.
bool is_final() const
Get final value.
size_t maxlenof_autorecover_enabled() const
Get maximum length of autorecover_enabled value.
bool is_autorecover_enabled() const
Get autorecover_enabled value.
bool is_enabled() const
Get enabled value.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
size_t maxlenof_error() const
Get maximum length of error value.
float velocity() const
Get velocity value.
float angle() const
Get angle value.
uint32_t goal_position() const
Get goal_position value.
size_t maxlenof_alarm_shutdown() const
Get maximum length of alarm_shutdown value.
size_t maxlenof_voltage() const
Get maximum length of voltage value.
uint8_t ccw_margin() const
Get ccw_margin value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
size_t maxlenof_goal_speed() const
Get maximum length of goal_speed value.
void set_cw_margin(const uint8_t new_cw_margin)
Set cw_margin value.
size_t maxlenof_velocity() const
Get maximum length of velocity value.
void set_ccw_margin(const uint8_t new_ccw_margin)
Set ccw_margin value.
void set_temperature(const uint8_t new_temperature)
Set temperature value.
uint32_t goal_speed() const
Get goal_speed value.
uint32_t ccw_angle_limit() const
Get ccw_angle_limit value.
size_t maxlenof_max_velocity() const
Get maximum length of max_velocity value.
float max_velocity() const
Get max_velocity value.
uint32_t speed() const
Get speed value.
ErrorCode
Error code to explain an error.
@ ERROR_ANGLE_OUTOFRANGE
Desired angle is out of range.
@ ERROR_COMMUNICATION
Communication with device failed.
@ ERROR_UNSPECIFIC
Some unspecified error occured.
void set_min_angle(const float new_min_angle)
Set min_angle value.
uint32_t cw_angle_limit() const
Get cw_angle_limit value.
void set_max_velocity(const float new_max_velocity)
Set max_velocity value.
void set_speed(const uint32_t new_speed)
Set speed value.
void set_torque_limit(const uint32_t new_torque_limit)
Set torque_limit value.
uint32_t msgid() const
Get msgid value.
uint8_t temperature_limit() const
Get temperature_limit value.
void set_voltage(const uint8_t new_voltage)
Set voltage value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
size_t maxlenof_temperature_limit() const
Get maximum length of temperature_limit value.
size_t maxlenof_torque_limit() const
Get maximum length of torque_limit value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
void set_angle(const float new_angle)
Set angle value.
size_t maxlenof_mode() const
Get maximum length of mode value.
void set_mode(const char *new_mode)
Set mode value.
void set_max_torque(const uint32_t new_max_torque)
Set max_torque value.
size_t maxlenof_model_number() const
Get maximum length of model_number value.
uint32_t torque_limit() const
Get torque_limit value.
size_t maxlenof_load() const
Get maximum length of load value.
void set_error(const uint8_t new_error)
Set error value.
float min_angle() const
Get min_angle value.
void set_position(const uint32_t new_position)
Set position value.
char * mode() const
Get mode value.
ErrorCode error_code() const
Get error_code value.
bool is_enable_prevent_alarm_shutdown() const
Get enable_prevent_alarm_shutdown value.
size_t maxlenof_cw_slope() const
Get maximum length of cw_slope value.
uint8_t error() const
Get error value.
size_t maxlenof_punch() const
Get maximum length of punch value.
size_t maxlenof_angle_margin() const
Get maximum length of angle_margin value.
size_t maxlenof_ccw_angle_limit() const
Get maximum length of ccw_angle_limit value.
size_t maxlenof_max_torque() const
Get maximum length of max_torque value.
uint32_t model_number() const
Get model_number value.
uint32_t load() const
Get load value.
void set_enabled(const bool new_enabled)
Set enabled value.
char * model() const
Get model value.
void set_goal_speed(const uint32_t new_goal_speed)
Set goal_speed value.
size_t maxlenof_goal_position() const
Get maximum length of goal_position value.
size_t maxlenof_angle() const
Get maximum length of angle value.
size_t maxlenof_cw_margin() const
Get maximum length of cw_margin value.
uint8_t alarm_shutdown() const
Get alarm_shutdown value.
void set_angle_margin(const float new_angle_margin)
Set angle_margin value.
float max_angle() const
Get max_angle value.
void set_ccw_angle_limit(const uint32_t new_ccw_angle_limit)
Set ccw_angle_limit value.
size_t maxlenof_model() const
Get maximum length of model value.
void set_model_number(const uint32_t new_model_number)
Set model_number value.
virtual Message * create_message(const char *type) const
Create message based on type name.
void set_final(const bool new_final)
Set final value.
uint8_t cw_slope() const
Get cw_slope value.
uint8_t cw_margin() const
Get cw_margin value.
const char * tostring_WorkingMode(WorkingMode value) const
Convert WorkingMode constant to string.
WorkingMode
Mode to be set for the servo.
@ JOINT
Joint mode to move in a range of -2.616 to +2.616 rad.
@ WHEEL
Wheel mode to use the servo in a continuously rotating mode.
void set_velocity(const float new_velocity)
Set velocity value.
uint32_t position() const
Get position value.
void set_load(const uint32_t new_load)
Set load value.
size_t maxlenof_max_angle() const
Get maximum length of max_angle value.
size_t maxlenof_final() const
Get maximum length of final value.
void set_autorecover_enabled(const bool new_autorecover_enabled)
Set autorecover_enabled value.
uint32_t max_torque() const
Get max_torque value.
void set_ccw_slope(const uint8_t new_ccw_slope)
Set ccw_slope value.
void set_goal_position(const uint32_t new_goal_position)
Set goal_position value.
void set_max_angle(const float new_max_angle)
Set max_angle value.
void set_punch(const uint32_t new_punch)
Set punch value.
void set_model(const char *new_model)
Set model value.
void set_cw_angle_limit(const uint32_t new_cw_angle_limit)
Set cw_angle_limit value.
size_t maxlenof_temperature() const
Get maximum length of temperature value.
uint8_t temperature() const
Get temperature value.
float angle_margin() const
Get angle_margin value.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
void set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown)
Set enable_prevent_alarm_shutdown value.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
const char * type() const
Get type of interface.
Definition: interface.cpp:652
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
Fawkes library namespace.
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
Definition: types.h:54