Fawkes API  Fawkes Development Version
DynamixelServoInterface.cpp
1 
2 /***************************************************************************
3  * DynamixelServoInterface.cpp - 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 #include <interfaces/DynamixelServoInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <map>
29 #include <string>
30 #include <cstring>
31 #include <cstdlib>
32 
33 namespace fawkes {
34 
35 /** @class DynamixelServoInterface <interfaces/DynamixelServoInterface.h>
36  * DynamixelServoInterface Fawkes BlackBoard Interface.
37  *
38  Interface to access Robotis Dynamixel Servos.
39 
40  * @ingroup FawkesInterfaces
41  */
42 
43 
44 
45 /** Constructor */
46 DynamixelServoInterface::DynamixelServoInterface() : Interface()
47 {
48  data_size = sizeof(DynamixelServoInterface_data_t);
49  data_ptr = malloc(data_size);
50  data = (DynamixelServoInterface_data_t *)data_ptr;
51  data_ts = (interface_data_ts_t *)data_ptr;
52  memset(data_ptr, 0, data_size);
53  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
54  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
55  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
56  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
57  enum_map_WorkingMode[(int)JOINT] = "JOINT";
58  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
59  add_fieldinfo(IFT_STRING, "model", 8, data->model);
60  add_fieldinfo(IFT_UINT32, "model_number", 1, &data->model_number);
61  add_fieldinfo(IFT_UINT32, "cw_angle_limit", 1, &data->cw_angle_limit);
62  add_fieldinfo(IFT_UINT32, "ccw_angle_limit", 1, &data->ccw_angle_limit);
63  add_fieldinfo(IFT_UINT8, "temperature_limit", 1, &data->temperature_limit);
64  add_fieldinfo(IFT_UINT32, "max_torque", 1, &data->max_torque);
65  add_fieldinfo(IFT_UINT8, "cw_margin", 1, &data->cw_margin);
66  add_fieldinfo(IFT_UINT8, "ccw_margin", 1, &data->ccw_margin);
67  add_fieldinfo(IFT_UINT8, "cw_slope", 1, &data->cw_slope);
68  add_fieldinfo(IFT_UINT8, "ccw_slope", 1, &data->ccw_slope);
69  add_fieldinfo(IFT_UINT32, "goal_position", 1, &data->goal_position);
70  add_fieldinfo(IFT_UINT32, "goal_speed", 1, &data->goal_speed);
71  add_fieldinfo(IFT_UINT32, "torque_limit", 1, &data->torque_limit);
72  add_fieldinfo(IFT_UINT32, "position", 1, &data->position);
73  add_fieldinfo(IFT_UINT32, "speed", 1, &data->speed);
74  add_fieldinfo(IFT_UINT32, "load", 1, &data->load);
75  add_fieldinfo(IFT_UINT8, "voltage", 1, &data->voltage);
76  add_fieldinfo(IFT_UINT8, "temperature", 1, &data->temperature);
77  add_fieldinfo(IFT_UINT32, "punch", 1, &data->punch);
78  add_fieldinfo(IFT_UINT8, "alarm_shutdown", 1, &data->alarm_shutdown);
79  add_fieldinfo(IFT_UINT8, "error", 1, &data->error);
80  add_fieldinfo(IFT_BOOL, "enable_prevent_alarm_shutdown", 1, &data->enable_prevent_alarm_shutdown);
81  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
82  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
83  add_fieldinfo(IFT_FLOAT, "min_angle", 1, &data->min_angle);
84  add_fieldinfo(IFT_FLOAT, "max_angle", 1, &data->max_angle);
85  add_fieldinfo(IFT_FLOAT, "max_velocity", 1, &data->max_velocity);
86  add_fieldinfo(IFT_FLOAT, "velocity", 1, &data->velocity);
87  add_fieldinfo(IFT_STRING, "mode", 5, data->mode);
88  add_fieldinfo(IFT_FLOAT, "angle_margin", 1, &data->angle_margin);
89  add_fieldinfo(IFT_BOOL, "autorecover_enabled", 1, &data->autorecover_enabled);
90  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
91  add_fieldinfo(IFT_BOOL, "final", 1, &data->final);
92  add_fieldinfo(IFT_ENUM, "error_code", 1, &data->error_code, "ErrorCode", &enum_map_ErrorCode);
93  add_messageinfo("StopMessage");
94  add_messageinfo("FlushMessage");
95  add_messageinfo("GotoMessage");
96  add_messageinfo("TimedGotoMessage");
97  add_messageinfo("SetModeMessage");
98  add_messageinfo("SetSpeedMessage");
99  add_messageinfo("SetEnabledMessage");
100  add_messageinfo("SetVelocityMessage");
101  add_messageinfo("SetMarginMessage");
102  add_messageinfo("SetComplianceValuesMessage");
103  add_messageinfo("SetGoalSpeedMessage");
104  add_messageinfo("SetTorqueLimitMessage");
105  add_messageinfo("SetPunchMessage");
106  add_messageinfo("GotoPositionMessage");
107  add_messageinfo("SetAngleLimitsMessage");
108  add_messageinfo("ResetRawErrorMessage");
109  add_messageinfo("SetPreventAlarmShutdownMessage");
110  add_messageinfo("SetAutorecoverEnabledMessage");
111  add_messageinfo("RecoverMessage");
112  unsigned char tmp_hash[] = {0x18, 0x72, 0x74, 0xa6, 0x80, 0xfa, 0x62, 0xa2, 0x56, 0x91, 0x21, 0xfc, 0x48, 0xd5, 0xe0, 0x5f};
113  set_hash(tmp_hash);
114 }
115 
116 /** Destructor */
117 DynamixelServoInterface::~DynamixelServoInterface()
118 {
119  free(data_ptr);
120 }
121 /** Convert ErrorCode constant to string.
122  * @param value value to convert to string
123  * @return constant value as string.
124  */
125 const char *
126 DynamixelServoInterface::tostring_ErrorCode(ErrorCode value) const
127 {
128  switch (value) {
129  case ERROR_NONE: return "ERROR_NONE";
130  case ERROR_UNSPECIFIC: return "ERROR_UNSPECIFIC";
131  case ERROR_COMMUNICATION: return "ERROR_COMMUNICATION";
132  case ERROR_ANGLE_OUTOFRANGE: return "ERROR_ANGLE_OUTOFRANGE";
133  default: return "UNKNOWN";
134  }
135 }
136 /** Convert WorkingMode constant to string.
137  * @param value value to convert to string
138  * @return constant value as string.
139  */
140 const char *
141 DynamixelServoInterface::tostring_WorkingMode(WorkingMode value) const
142 {
143  switch (value) {
144  case JOINT: return "JOINT";
145  case WHEEL: return "WHEEL";
146  default: return "UNKNOWN";
147  }
148 }
149 /* Methods */
150 /** Get model value.
151  * Model if known
152  * @return model value
153  */
154 char *
155 DynamixelServoInterface::model() const
156 {
157  return data->model;
158 }
159 
160 /** Get maximum length of model value.
161  * @return length of model value, can be length of the array or number of
162  * maximum number of characters for a string
163  */
164 size_t
165 DynamixelServoInterface::maxlenof_model() const
166 {
167  return 8;
168 }
169 
170 /** Set model value.
171  * Model if known
172  * @param new_model new model value
173  */
174 void
175 DynamixelServoInterface::set_model(const char * new_model)
176 {
177  strncpy(data->model, new_model, sizeof(data->model)-1);
178  data->model[sizeof(data->model)-1] = 0;
179  data_changed = true;
180 }
181 
182 /** Get model_number value.
183  * Model number
184  * @return model_number value
185  */
186 uint32_t
187 DynamixelServoInterface::model_number() const
188 {
189  return data->model_number;
190 }
191 
192 /** Get maximum length of model_number value.
193  * @return length of model_number value, can be length of the array or number of
194  * maximum number of characters for a string
195  */
196 size_t
197 DynamixelServoInterface::maxlenof_model_number() const
198 {
199  return 1;
200 }
201 
202 /** Set model_number value.
203  * Model number
204  * @param new_model_number new model_number value
205  */
206 void
207 DynamixelServoInterface::set_model_number(const uint32_t new_model_number)
208 {
209  data->model_number = new_model_number;
210  data_changed = true;
211 }
212 
213 /** Get cw_angle_limit value.
214  * Clockwise angle limit
215  * @return cw_angle_limit value
216  */
217 uint32_t
218 DynamixelServoInterface::cw_angle_limit() const
219 {
220  return data->cw_angle_limit;
221 }
222 
223 /** Get maximum length of cw_angle_limit value.
224  * @return length of cw_angle_limit value, can be length of the array or number of
225  * maximum number of characters for a string
226  */
227 size_t
228 DynamixelServoInterface::maxlenof_cw_angle_limit() const
229 {
230  return 1;
231 }
232 
233 /** Set cw_angle_limit value.
234  * Clockwise angle limit
235  * @param new_cw_angle_limit new cw_angle_limit value
236  */
237 void
238 DynamixelServoInterface::set_cw_angle_limit(const uint32_t new_cw_angle_limit)
239 {
240  data->cw_angle_limit = new_cw_angle_limit;
241  data_changed = true;
242 }
243 
244 /** Get ccw_angle_limit value.
245  * Counter-clockwise angle limit
246  * @return ccw_angle_limit value
247  */
248 uint32_t
249 DynamixelServoInterface::ccw_angle_limit() const
250 {
251  return data->ccw_angle_limit;
252 }
253 
254 /** Get maximum length of ccw_angle_limit value.
255  * @return length of ccw_angle_limit value, can be length of the array or number of
256  * maximum number of characters for a string
257  */
258 size_t
259 DynamixelServoInterface::maxlenof_ccw_angle_limit() const
260 {
261  return 1;
262 }
263 
264 /** Set ccw_angle_limit value.
265  * Counter-clockwise angle limit
266  * @param new_ccw_angle_limit new ccw_angle_limit value
267  */
268 void
269 DynamixelServoInterface::set_ccw_angle_limit(const uint32_t new_ccw_angle_limit)
270 {
271  data->ccw_angle_limit = new_ccw_angle_limit;
272  data_changed = true;
273 }
274 
275 /** Get temperature_limit value.
276  * Temperature limit
277  * @return temperature_limit value
278  */
279 uint8_t
280 DynamixelServoInterface::temperature_limit() const
281 {
282  return data->temperature_limit;
283 }
284 
285 /** Get maximum length of temperature_limit value.
286  * @return length of temperature_limit value, can be length of the array or number of
287  * maximum number of characters for a string
288  */
289 size_t
290 DynamixelServoInterface::maxlenof_temperature_limit() const
291 {
292  return 1;
293 }
294 
295 /** Set temperature_limit value.
296  * Temperature limit
297  * @param new_temperature_limit new temperature_limit value
298  */
299 void
300 DynamixelServoInterface::set_temperature_limit(const uint8_t new_temperature_limit)
301 {
302  data->temperature_limit = new_temperature_limit;
303  data_changed = true;
304 }
305 
306 /** Get max_torque value.
307  * Max torque
308  * @return max_torque value
309  */
310 uint32_t
311 DynamixelServoInterface::max_torque() const
312 {
313  return data->max_torque;
314 }
315 
316 /** Get maximum length of max_torque value.
317  * @return length of max_torque value, can be length of the array or number of
318  * maximum number of characters for a string
319  */
320 size_t
321 DynamixelServoInterface::maxlenof_max_torque() const
322 {
323  return 1;
324 }
325 
326 /** Set max_torque value.
327  * Max torque
328  * @param new_max_torque new max_torque value
329  */
330 void
331 DynamixelServoInterface::set_max_torque(const uint32_t new_max_torque)
332 {
333  data->max_torque = new_max_torque;
334  data_changed = true;
335 }
336 
337 /** Get cw_margin value.
338  * CW Compliance Margin
339  * @return cw_margin value
340  */
341 uint8_t
342 DynamixelServoInterface::cw_margin() const
343 {
344  return data->cw_margin;
345 }
346 
347 /** Get maximum length of cw_margin value.
348  * @return length of cw_margin value, can be length of the array or number of
349  * maximum number of characters for a string
350  */
351 size_t
352 DynamixelServoInterface::maxlenof_cw_margin() const
353 {
354  return 1;
355 }
356 
357 /** Set cw_margin value.
358  * CW Compliance Margin
359  * @param new_cw_margin new cw_margin value
360  */
361 void
362 DynamixelServoInterface::set_cw_margin(const uint8_t new_cw_margin)
363 {
364  data->cw_margin = new_cw_margin;
365  data_changed = true;
366 }
367 
368 /** Get ccw_margin value.
369  * CCW Compliance Margin
370  * @return ccw_margin value
371  */
372 uint8_t
373 DynamixelServoInterface::ccw_margin() const
374 {
375  return data->ccw_margin;
376 }
377 
378 /** Get maximum length of ccw_margin value.
379  * @return length of ccw_margin value, can be length of the array or number of
380  * maximum number of characters for a string
381  */
382 size_t
383 DynamixelServoInterface::maxlenof_ccw_margin() const
384 {
385  return 1;
386 }
387 
388 /** Set ccw_margin value.
389  * CCW Compliance Margin
390  * @param new_ccw_margin new ccw_margin value
391  */
392 void
393 DynamixelServoInterface::set_ccw_margin(const uint8_t new_ccw_margin)
394 {
395  data->ccw_margin = new_ccw_margin;
396  data_changed = true;
397 }
398 
399 /** Get cw_slope value.
400  * CW Compliance Slope
401  * @return cw_slope value
402  */
403 uint8_t
404 DynamixelServoInterface::cw_slope() const
405 {
406  return data->cw_slope;
407 }
408 
409 /** Get maximum length of cw_slope value.
410  * @return length of cw_slope value, can be length of the array or number of
411  * maximum number of characters for a string
412  */
413 size_t
414 DynamixelServoInterface::maxlenof_cw_slope() const
415 {
416  return 1;
417 }
418 
419 /** Set cw_slope value.
420  * CW Compliance Slope
421  * @param new_cw_slope new cw_slope value
422  */
423 void
424 DynamixelServoInterface::set_cw_slope(const uint8_t new_cw_slope)
425 {
426  data->cw_slope = new_cw_slope;
427  data_changed = true;
428 }
429 
430 /** Get ccw_slope value.
431  * CCW Compliance Slope
432  * @return ccw_slope value
433  */
434 uint8_t
435 DynamixelServoInterface::ccw_slope() const
436 {
437  return data->ccw_slope;
438 }
439 
440 /** Get maximum length of ccw_slope value.
441  * @return length of ccw_slope value, can be length of the array or number of
442  * maximum number of characters for a string
443  */
444 size_t
445 DynamixelServoInterface::maxlenof_ccw_slope() const
446 {
447  return 1;
448 }
449 
450 /** Set ccw_slope value.
451  * CCW Compliance Slope
452  * @param new_ccw_slope new ccw_slope value
453  */
454 void
455 DynamixelServoInterface::set_ccw_slope(const uint8_t new_ccw_slope)
456 {
457  data->ccw_slope = new_ccw_slope;
458  data_changed = true;
459 }
460 
461 /** Get goal_position value.
462  * Goal position
463  * @return goal_position value
464  */
465 uint32_t
466 DynamixelServoInterface::goal_position() const
467 {
468  return data->goal_position;
469 }
470 
471 /** Get maximum length of goal_position value.
472  * @return length of goal_position value, can be length of the array or number of
473  * maximum number of characters for a string
474  */
475 size_t
476 DynamixelServoInterface::maxlenof_goal_position() const
477 {
478  return 1;
479 }
480 
481 /** Set goal_position value.
482  * Goal position
483  * @param new_goal_position new goal_position value
484  */
485 void
486 DynamixelServoInterface::set_goal_position(const uint32_t new_goal_position)
487 {
488  data->goal_position = new_goal_position;
489  data_changed = true;
490 }
491 
492 /** Get goal_speed value.
493  * Goal speed
494  * @return goal_speed value
495  */
496 uint32_t
497 DynamixelServoInterface::goal_speed() const
498 {
499  return data->goal_speed;
500 }
501 
502 /** Get maximum length of goal_speed value.
503  * @return length of goal_speed value, can be length of the array or number of
504  * maximum number of characters for a string
505  */
506 size_t
507 DynamixelServoInterface::maxlenof_goal_speed() const
508 {
509  return 1;
510 }
511 
512 /** Set goal_speed value.
513  * Goal speed
514  * @param new_goal_speed new goal_speed value
515  */
516 void
517 DynamixelServoInterface::set_goal_speed(const uint32_t new_goal_speed)
518 {
519  data->goal_speed = new_goal_speed;
520  data_changed = true;
521 }
522 
523 /** Get torque_limit value.
524  * Torque limit
525  * @return torque_limit value
526  */
527 uint32_t
528 DynamixelServoInterface::torque_limit() const
529 {
530  return data->torque_limit;
531 }
532 
533 /** Get maximum length of torque_limit value.
534  * @return length of torque_limit value, can be length of the array or number of
535  * maximum number of characters for a string
536  */
537 size_t
538 DynamixelServoInterface::maxlenof_torque_limit() const
539 {
540  return 1;
541 }
542 
543 /** Set torque_limit value.
544  * Torque limit
545  * @param new_torque_limit new torque_limit value
546  */
547 void
548 DynamixelServoInterface::set_torque_limit(const uint32_t new_torque_limit)
549 {
550  data->torque_limit = new_torque_limit;
551  data_changed = true;
552 }
553 
554 /** Get position value.
555  * Present position
556  * @return position value
557  */
558 uint32_t
559 DynamixelServoInterface::position() const
560 {
561  return data->position;
562 }
563 
564 /** Get maximum length of position value.
565  * @return length of position value, can be length of the array or number of
566  * maximum number of characters for a string
567  */
568 size_t
569 DynamixelServoInterface::maxlenof_position() const
570 {
571  return 1;
572 }
573 
574 /** Set position value.
575  * Present position
576  * @param new_position new position value
577  */
578 void
579 DynamixelServoInterface::set_position(const uint32_t new_position)
580 {
581  data->position = new_position;
582  data_changed = true;
583 }
584 
585 /** Get speed value.
586  * Present speed
587  * @return speed value
588  */
589 uint32_t
590 DynamixelServoInterface::speed() const
591 {
592  return data->speed;
593 }
594 
595 /** Get maximum length of speed value.
596  * @return length of speed value, can be length of the array or number of
597  * maximum number of characters for a string
598  */
599 size_t
600 DynamixelServoInterface::maxlenof_speed() const
601 {
602  return 1;
603 }
604 
605 /** Set speed value.
606  * Present speed
607  * @param new_speed new speed value
608  */
609 void
610 DynamixelServoInterface::set_speed(const uint32_t new_speed)
611 {
612  data->speed = new_speed;
613  data_changed = true;
614 }
615 
616 /** Get load value.
617  * Present load
618  * @return load value
619  */
620 uint32_t
621 DynamixelServoInterface::load() const
622 {
623  return data->load;
624 }
625 
626 /** Get maximum length of load value.
627  * @return length of load value, can be length of the array or number of
628  * maximum number of characters for a string
629  */
630 size_t
631 DynamixelServoInterface::maxlenof_load() const
632 {
633  return 1;
634 }
635 
636 /** Set load value.
637  * Present load
638  * @param new_load new load value
639  */
640 void
641 DynamixelServoInterface::set_load(const uint32_t new_load)
642 {
643  data->load = new_load;
644  data_changed = true;
645 }
646 
647 /** Get voltage value.
648  * Present voltage
649  * @return voltage value
650  */
651 uint8_t
652 DynamixelServoInterface::voltage() const
653 {
654  return data->voltage;
655 }
656 
657 /** Get maximum length of voltage value.
658  * @return length of voltage value, can be length of the array or number of
659  * maximum number of characters for a string
660  */
661 size_t
662 DynamixelServoInterface::maxlenof_voltage() const
663 {
664  return 1;
665 }
666 
667 /** Set voltage value.
668  * Present voltage
669  * @param new_voltage new voltage value
670  */
671 void
672 DynamixelServoInterface::set_voltage(const uint8_t new_voltage)
673 {
674  data->voltage = new_voltage;
675  data_changed = true;
676 }
677 
678 /** Get temperature value.
679  * Present temperature
680  * @return temperature value
681  */
682 uint8_t
683 DynamixelServoInterface::temperature() const
684 {
685  return data->temperature;
686 }
687 
688 /** Get maximum length of temperature value.
689  * @return length of temperature value, can be length of the array or number of
690  * maximum number of characters for a string
691  */
692 size_t
693 DynamixelServoInterface::maxlenof_temperature() const
694 {
695  return 1;
696 }
697 
698 /** Set temperature value.
699  * Present temperature
700  * @param new_temperature new temperature value
701  */
702 void
703 DynamixelServoInterface::set_temperature(const uint8_t new_temperature)
704 {
705  data->temperature = new_temperature;
706  data_changed = true;
707 }
708 
709 /** Get punch value.
710  * Punch
711  * @return punch value
712  */
713 uint32_t
714 DynamixelServoInterface::punch() const
715 {
716  return data->punch;
717 }
718 
719 /** Get maximum length of punch value.
720  * @return length of punch value, can be length of the array or number of
721  * maximum number of characters for a string
722  */
723 size_t
724 DynamixelServoInterface::maxlenof_punch() const
725 {
726  return 1;
727 }
728 
729 /** Set punch value.
730  * Punch
731  * @param new_punch new punch value
732  */
733 void
734 DynamixelServoInterface::set_punch(const uint32_t new_punch)
735 {
736  data->punch = new_punch;
737  data_changed = true;
738 }
739 
740 /** Get alarm_shutdown value.
741  * Alarm Shutdown.
742  The bitmask is set as follows (taken from Trossen Robotics PDF "AX-12(English).pdf"):
743  Bit 7: 0
744  Bit 6: If set to 1, torque off when an Instruction Error occurs
745  Bit 5: If set to 1, torque off when an Overload Error occurs
746  Bit 4: If set to 1, torque off when a Checksum Error occurs
747  Bit 3: If set to 1, torque off when a Range Error occurs
748  Bit 2: If set to 1, torque off when an Overheating Error occurs
749  Bit 1: If set to 1, torque off when an Angle Limit Error occurs
750  Bit 0: If set to 1, torque off when an Input Voltage Error occurs
751 
752  * @return alarm_shutdown value
753  */
754 uint8_t
755 DynamixelServoInterface::alarm_shutdown() const
756 {
757  return data->alarm_shutdown;
758 }
759 
760 /** Get maximum length of alarm_shutdown value.
761  * @return length of alarm_shutdown value, can be length of the array or number of
762  * maximum number of characters for a string
763  */
764 size_t
765 DynamixelServoInterface::maxlenof_alarm_shutdown() const
766 {
767  return 1;
768 }
769 
770 /** Set alarm_shutdown value.
771  * Alarm Shutdown.
772  The bitmask is set as follows (taken from Trossen Robotics PDF "AX-12(English).pdf"):
773  Bit 7: 0
774  Bit 6: If set to 1, torque off when an Instruction Error occurs
775  Bit 5: If set to 1, torque off when an Overload Error occurs
776  Bit 4: If set to 1, torque off when a Checksum Error occurs
777  Bit 3: If set to 1, torque off when a Range Error occurs
778  Bit 2: If set to 1, torque off when an Overheating Error occurs
779  Bit 1: If set to 1, torque off when an Angle Limit Error occurs
780  Bit 0: If set to 1, torque off when an Input Voltage Error occurs
781 
782  * @param new_alarm_shutdown new alarm_shutdown value
783  */
784 void
785 DynamixelServoInterface::set_alarm_shutdown(const uint8_t new_alarm_shutdown)
786 {
787  data->alarm_shutdown = new_alarm_shutdown;
788  data_changed = true;
789 }
790 
791 /** Get error value.
792  * Raw error code from servo.
793  The bitmask is set as follows (taken from Trossen Robotics PDF "AX-12(English).pdf"):
794  Bit 7: 0
795  Bit 6: Set to 1 if an undefined instruction is sent or an action instruction is sent without a Reg_Write instruction.
796  Bit 5: Set to 1 if the specified maximum torque can't control the applied load.
797  Bit 4: Set to 1 if the checksum of the instruction packet is incorrect.
798  Bit 3: Set to 1 if the instruction sent is out of the defined range.
799  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.
800  Bit 1: Set as 1 if the Goal Position is set outside of the range between CW Angle Limit and CCW Angle Limit.
801  Bit 0: Set to 1 if the voltage is out of the operating voltage range as defined in the control table.
802 
803  * @return error value
804  */
805 uint8_t
806 DynamixelServoInterface::error() const
807 {
808  return data->error;
809 }
810 
811 /** Get maximum length of error value.
812  * @return length of error value, can be length of the array or number of
813  * maximum number of characters for a string
814  */
815 size_t
816 DynamixelServoInterface::maxlenof_error() const
817 {
818  return 1;
819 }
820 
821 /** Set error value.
822  * Raw error code from servo.
823  The bitmask is set as follows (taken from Trossen Robotics PDF "AX-12(English).pdf"):
824  Bit 7: 0
825  Bit 6: Set to 1 if an undefined instruction is sent or an action instruction is sent without a Reg_Write instruction.
826  Bit 5: Set to 1 if the specified maximum torque can't control the applied load.
827  Bit 4: Set to 1 if the checksum of the instruction packet is incorrect.
828  Bit 3: Set to 1 if the instruction sent is out of the defined range.
829  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.
830  Bit 1: Set as 1 if the Goal Position is set outside of the range between CW Angle Limit and CCW Angle Limit.
831  Bit 0: Set to 1 if the voltage is out of the operating voltage range as defined in the control table.
832 
833  * @param new_error new error value
834  */
835 void
836 DynamixelServoInterface::set_error(const uint8_t new_error)
837 {
838  data->error = new_error;
839  data_changed = true;
840 }
841 
842 /** Get enable_prevent_alarm_shutdown value.
843  * Enable alarm shutdown
844  * @return enable_prevent_alarm_shutdown value
845  */
846 bool
847 DynamixelServoInterface::is_enable_prevent_alarm_shutdown() const
848 {
849  return data->enable_prevent_alarm_shutdown;
850 }
851 
852 /** Get maximum length of enable_prevent_alarm_shutdown value.
853  * @return length of enable_prevent_alarm_shutdown value, can be length of the array or number of
854  * maximum number of characters for a string
855  */
856 size_t
857 DynamixelServoInterface::maxlenof_enable_prevent_alarm_shutdown() const
858 {
859  return 1;
860 }
861 
862 /** Set enable_prevent_alarm_shutdown value.
863  * Enable alarm shutdown
864  * @param new_enable_prevent_alarm_shutdown new enable_prevent_alarm_shutdown value
865  */
866 void
867 DynamixelServoInterface::set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown)
868 {
869  data->enable_prevent_alarm_shutdown = new_enable_prevent_alarm_shutdown;
870  data_changed = true;
871 }
872 
873 /** Get angle value.
874  * Current angle.
875  * @return angle value
876  */
877 float
878 DynamixelServoInterface::angle() const
879 {
880  return data->angle;
881 }
882 
883 /** Get maximum length of angle value.
884  * @return length of angle value, can be length of the array or number of
885  * maximum number of characters for a string
886  */
887 size_t
888 DynamixelServoInterface::maxlenof_angle() const
889 {
890  return 1;
891 }
892 
893 /** Set angle value.
894  * Current angle.
895  * @param new_angle new angle value
896  */
897 void
898 DynamixelServoInterface::set_angle(const float new_angle)
899 {
900  data->angle = new_angle;
901  data_changed = true;
902 }
903 
904 /** Get enabled value.
905  * Is the servo enabled?
906  * @return enabled value
907  */
908 bool
909 DynamixelServoInterface::is_enabled() const
910 {
911  return data->enabled;
912 }
913 
914 /** Get maximum length of enabled value.
915  * @return length of enabled value, can be length of the array or number of
916  * maximum number of characters for a string
917  */
918 size_t
919 DynamixelServoInterface::maxlenof_enabled() const
920 {
921  return 1;
922 }
923 
924 /** Set enabled value.
925  * Is the servo enabled?
926  * @param new_enabled new enabled value
927  */
928 void
929 DynamixelServoInterface::set_enabled(const bool new_enabled)
930 {
931  data->enabled = new_enabled;
932  data_changed = true;
933 }
934 
935 /** Get min_angle value.
936  * Minimum angle allowed.
937  * @return min_angle value
938  */
939 float
940 DynamixelServoInterface::min_angle() const
941 {
942  return data->min_angle;
943 }
944 
945 /** Get maximum length of min_angle value.
946  * @return length of min_angle value, can be length of the array or number of
947  * maximum number of characters for a string
948  */
949 size_t
950 DynamixelServoInterface::maxlenof_min_angle() const
951 {
952  return 1;
953 }
954 
955 /** Set min_angle value.
956  * Minimum angle allowed.
957  * @param new_min_angle new min_angle value
958  */
959 void
960 DynamixelServoInterface::set_min_angle(const float new_min_angle)
961 {
962  data->min_angle = new_min_angle;
963  data_changed = true;
964 }
965 
966 /** Get max_angle value.
967  * Maximum angle allowed.
968  * @return max_angle value
969  */
970 float
971 DynamixelServoInterface::max_angle() const
972 {
973  return data->max_angle;
974 }
975 
976 /** Get maximum length of max_angle value.
977  * @return length of max_angle value, can be length of the array or number of
978  * maximum number of characters for a string
979  */
980 size_t
981 DynamixelServoInterface::maxlenof_max_angle() const
982 {
983  return 1;
984 }
985 
986 /** Set max_angle value.
987  * Maximum angle allowed.
988  * @param new_max_angle new max_angle value
989  */
990 void
991 DynamixelServoInterface::set_max_angle(const float new_max_angle)
992 {
993  data->max_angle = new_max_angle;
994  data_changed = true;
995 }
996 
997 /** Get max_velocity value.
998  * Maximum supported velocity.
999  * @return max_velocity value
1000  */
1001 float
1002 DynamixelServoInterface::max_velocity() const
1003 {
1004  return data->max_velocity;
1005 }
1006 
1007 /** Get maximum length of max_velocity value.
1008  * @return length of max_velocity value, can be length of the array or number of
1009  * maximum number of characters for a string
1010  */
1011 size_t
1012 DynamixelServoInterface::maxlenof_max_velocity() const
1013 {
1014  return 1;
1015 }
1016 
1017 /** Set max_velocity value.
1018  * Maximum supported velocity.
1019  * @param new_max_velocity new max_velocity value
1020  */
1021 void
1022 DynamixelServoInterface::set_max_velocity(const float new_max_velocity)
1023 {
1024  data->max_velocity = new_max_velocity;
1025  data_changed = true;
1026 }
1027 
1028 /** Get velocity value.
1029  * Maximum servo velocity currently reached.
1030  * @return velocity value
1031  */
1032 float
1033 DynamixelServoInterface::velocity() const
1034 {
1035  return data->velocity;
1036 }
1037 
1038 /** Get maximum length of velocity value.
1039  * @return length of velocity value, can be length of the array or number of
1040  * maximum number of characters for a string
1041  */
1042 size_t
1043 DynamixelServoInterface::maxlenof_velocity() const
1044 {
1045  return 1;
1046 }
1047 
1048 /** Set velocity value.
1049  * Maximum servo velocity currently reached.
1050  * @param new_velocity new velocity value
1051  */
1052 void
1053 DynamixelServoInterface::set_velocity(const float new_velocity)
1054 {
1055  data->velocity = new_velocity;
1056  data_changed = true;
1057 }
1058 
1059 /** Get mode value.
1060  * Working mode, can either be JOINT or WHEEL
1061  * @return mode value
1062  */
1063 char *
1064 DynamixelServoInterface::mode() const
1065 {
1066  return data->mode;
1067 }
1068 
1069 /** Get maximum length of mode value.
1070  * @return length of mode value, can be length of the array or number of
1071  * maximum number of characters for a string
1072  */
1073 size_t
1074 DynamixelServoInterface::maxlenof_mode() const
1075 {
1076  return 5;
1077 }
1078 
1079 /** Set mode value.
1080  * Working mode, can either be JOINT or WHEEL
1081  * @param new_mode new mode value
1082  */
1083 void
1084 DynamixelServoInterface::set_mode(const char * new_mode)
1085 {
1086  strncpy(data->mode, new_mode, sizeof(data->mode)-1);
1087  data->mode[sizeof(data->mode)-1] = 0;
1088  data_changed = true;
1089 }
1091 /** Get angle_margin value.
1092  *
1093  Margin in radians around a target servo value to consider the
1094  motion as final.
1095 
1096  * @return angle_margin value
1097  */
1098 float
1099 DynamixelServoInterface::angle_margin() const
1100 {
1101  return data->angle_margin;
1102 }
1103 
1104 /** Get maximum length of angle_margin value.
1105  * @return length of angle_margin value, can be length of the array or number of
1106  * maximum number of characters for a string
1107  */
1108 size_t
1109 DynamixelServoInterface::maxlenof_angle_margin() const
1110 {
1111  return 1;
1112 }
1113 
1114 /** Set angle_margin value.
1115  *
1116  Margin in radians around a target servo value to consider the
1117  motion as final.
1118 
1119  * @param new_angle_margin new angle_margin value
1120  */
1121 void
1122 DynamixelServoInterface::set_angle_margin(const float new_angle_margin)
1123 {
1124  data->angle_margin = new_angle_margin;
1125  data_changed = true;
1126 }
1127 
1128 /** Get autorecover_enabled value.
1129  * Automatically recover on alarm shutdown
1130  * @return autorecover_enabled value
1131  */
1132 bool
1133 DynamixelServoInterface::is_autorecover_enabled() const
1134 {
1135  return data->autorecover_enabled;
1136 }
1137 
1138 /** Get maximum length of autorecover_enabled value.
1139  * @return length of autorecover_enabled value, can be length of the array or number of
1140  * maximum number of characters for a string
1141  */
1142 size_t
1143 DynamixelServoInterface::maxlenof_autorecover_enabled() const
1144 {
1145  return 1;
1146 }
1147 
1148 /** Set autorecover_enabled value.
1149  * Automatically recover on alarm shutdown
1150  * @param new_autorecover_enabled new autorecover_enabled value
1151  */
1152 void
1153 DynamixelServoInterface::set_autorecover_enabled(const bool new_autorecover_enabled)
1154 {
1155  data->autorecover_enabled = new_autorecover_enabled;
1156  data_changed = true;
1157 }
1158 
1159 /** Get msgid value.
1160  * The ID of the message that is currently being
1161  processed, or 0 if no message is being processed.
1162  * @return msgid value
1163  */
1164 uint32_t
1165 DynamixelServoInterface::msgid() const
1166 {
1167  return data->msgid;
1168 }
1169 
1170 /** Get maximum length of msgid value.
1171  * @return length of msgid value, can be length of the array or number of
1172  * maximum number of characters for a string
1173  */
1174 size_t
1175 DynamixelServoInterface::maxlenof_msgid() const
1176 {
1177  return 1;
1178 }
1179 
1180 /** Set msgid value.
1181  * The ID of the message that is currently being
1182  processed, or 0 if no message is being processed.
1183  * @param new_msgid new msgid value
1184  */
1185 void
1186 DynamixelServoInterface::set_msgid(const uint32_t new_msgid)
1187 {
1188  data->msgid = new_msgid;
1189  data_changed = true;
1190 }
1191 
1192 /** Get final value.
1193  * True, if the last goto command has been finished,
1194  false if it is still running
1195  * @return final value
1196  */
1197 bool
1198 DynamixelServoInterface::is_final() const
1199 {
1200  return data->final;
1201 }
1202 
1203 /** Get maximum length of final value.
1204  * @return length of final value, can be length of the array or number of
1205  * maximum number of characters for a string
1206  */
1207 size_t
1208 DynamixelServoInterface::maxlenof_final() const
1209 {
1210  return 1;
1211 }
1212 
1213 /** Set final value.
1214  * True, if the last goto command has been finished,
1215  false if it is still running
1216  * @param new_final new final value
1217  */
1218 void
1219 DynamixelServoInterface::set_final(const bool new_final)
1220 {
1221  data->final = new_final;
1222  data_changed = true;
1223 }
1224 
1225 /** Get error_code value.
1226  * Failure code set if
1227  final is true. ERROR_NONE if no error occured.
1228  * @return error_code value
1229  */
1231 DynamixelServoInterface::error_code() const
1232 {
1233  return (DynamixelServoInterface::ErrorCode)data->error_code;
1234 }
1235 
1236 /** Get maximum length of error_code value.
1237  * @return length of error_code value, can be length of the array or number of
1238  * maximum number of characters for a string
1239  */
1240 size_t
1241 DynamixelServoInterface::maxlenof_error_code() const
1242 {
1243  return 1;
1244 }
1245 
1246 /** Set error_code value.
1247  * Failure code set if
1248  final is true. ERROR_NONE if no error occured.
1249  * @param new_error_code new error_code value
1250  */
1251 void
1252 DynamixelServoInterface::set_error_code(const ErrorCode new_error_code)
1253 {
1254  data->error_code = new_error_code;
1255  data_changed = true;
1256 }
1257 
1258 /* =========== message create =========== */
1259 Message *
1260 DynamixelServoInterface::create_message(const char *type) const
1261 {
1262  if ( strncmp("StopMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1263  return new StopMessage();
1264  } else if ( strncmp("FlushMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1265  return new FlushMessage();
1266  } else if ( strncmp("GotoMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1267  return new GotoMessage();
1268  } else if ( strncmp("TimedGotoMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1269  return new TimedGotoMessage();
1270  } else if ( strncmp("SetModeMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1271  return new SetModeMessage();
1272  } else if ( strncmp("SetSpeedMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1273  return new SetSpeedMessage();
1274  } else if ( strncmp("SetEnabledMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1275  return new SetEnabledMessage();
1276  } else if ( strncmp("SetVelocityMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1277  return new SetVelocityMessage();
1278  } else if ( strncmp("SetMarginMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1279  return new SetMarginMessage();
1280  } else if ( strncmp("SetComplianceValuesMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1281  return new SetComplianceValuesMessage();
1282  } else if ( strncmp("SetGoalSpeedMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1283  return new SetGoalSpeedMessage();
1284  } else if ( strncmp("SetTorqueLimitMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1285  return new SetTorqueLimitMessage();
1286  } else if ( strncmp("SetPunchMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1287  return new SetPunchMessage();
1288  } else if ( strncmp("GotoPositionMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1289  return new GotoPositionMessage();
1290  } else if ( strncmp("SetAngleLimitsMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1291  return new SetAngleLimitsMessage();
1292  } else if ( strncmp("ResetRawErrorMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1293  return new ResetRawErrorMessage();
1294  } else if ( strncmp("SetPreventAlarmShutdownMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1295  return new SetPreventAlarmShutdownMessage();
1296  } else if ( strncmp("SetAutorecoverEnabledMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1297  return new SetAutorecoverEnabledMessage();
1298  } else if ( strncmp("RecoverMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
1299  return new RecoverMessage();
1300  } else {
1301  throw UnknownTypeException("The given type '%s' does not match any known "
1302  "message type for this interface type.", type);
1303  }
1304 }
1305 
1306 
1307 /** Copy values from other interface.
1308  * @param other other interface to copy values from
1309  */
1310 void
1311 DynamixelServoInterface::copy_values(const Interface *other)
1312 {
1313  const DynamixelServoInterface *oi = dynamic_cast<const DynamixelServoInterface *>(other);
1314  if (oi == NULL) {
1315  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
1316  type(), other->type());
1317  }
1318  memcpy(data, oi->data, sizeof(DynamixelServoInterface_data_t));
1319 }
1320 
1321 const char *
1322 DynamixelServoInterface::enum_tostring(const char *enumtype, int val) const
1323 {
1324  if (strcmp(enumtype, "ErrorCode") == 0) {
1325  return tostring_ErrorCode((ErrorCode)val);
1326  }
1327  if (strcmp(enumtype, "WorkingMode") == 0) {
1328  return tostring_WorkingMode((WorkingMode)val);
1329  }
1330  throw UnknownTypeException("Unknown enum type %s", enumtype);
1331 }
1332 
1333 /* =========== messages =========== */
1334 /** @class DynamixelServoInterface::StopMessage <interfaces/DynamixelServoInterface.h>
1335  * StopMessage Fawkes BlackBoard Interface Message.
1336  *
1337 
1338  */
1339 
1340 
1341 /** Constructor */
1342 DynamixelServoInterface::StopMessage::StopMessage() : Message("StopMessage")
1343 {
1344  data_size = sizeof(StopMessage_data_t);
1345  data_ptr = malloc(data_size);
1346  memset(data_ptr, 0, data_size);
1347  data = (StopMessage_data_t *)data_ptr;
1349  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1350  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1351  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1352  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1353  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1354  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1355 }
1356 
1357 /** Destructor */
1359 {
1360  free(data_ptr);
1361 }
1362 
1363 /** Copy constructor.
1364  * @param m message to copy from
1365  */
1367 {
1368  data_size = m->data_size;
1369  data_ptr = malloc(data_size);
1370  memcpy(data_ptr, m->data_ptr, data_size);
1371  data = (StopMessage_data_t *)data_ptr;
1373 }
1374 
1375 /* Methods */
1376 /** Clone this message.
1377  * Produces a message of the same type as this message and copies the
1378  * data to the new message.
1379  * @return clone of this message
1380  */
1381 Message *
1383 {
1384  return new DynamixelServoInterface::StopMessage(this);
1385 }
1386 /** @class DynamixelServoInterface::FlushMessage <interfaces/DynamixelServoInterface.h>
1387  * FlushMessage Fawkes BlackBoard Interface Message.
1388  *
1389 
1390  */
1391 
1392 
1393 /** Constructor */
1395 {
1396  data_size = sizeof(FlushMessage_data_t);
1397  data_ptr = malloc(data_size);
1398  memset(data_ptr, 0, data_size);
1399  data = (FlushMessage_data_t *)data_ptr;
1401  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1402  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1403  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1404  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1405  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1406  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1407 }
1408 
1409 /** Destructor */
1411 {
1412  free(data_ptr);
1413 }
1414 
1415 /** Copy constructor.
1416  * @param m message to copy from
1417  */
1419 {
1420  data_size = m->data_size;
1421  data_ptr = malloc(data_size);
1422  memcpy(data_ptr, m->data_ptr, data_size);
1423  data = (FlushMessage_data_t *)data_ptr;
1425 }
1426 
1427 /* Methods */
1428 /** Clone this message.
1429  * Produces a message of the same type as this message and copies the
1430  * data to the new message.
1431  * @return clone of this message
1432  */
1433 Message *
1435 {
1436  return new DynamixelServoInterface::FlushMessage(this);
1437 }
1438 /** @class DynamixelServoInterface::GotoMessage <interfaces/DynamixelServoInterface.h>
1439  * GotoMessage Fawkes BlackBoard Interface Message.
1440  *
1441 
1442  */
1443 
1444 
1445 /** Constructor with initial values.
1446  * @param ini_angle initial value for angle
1447  */
1448 DynamixelServoInterface::GotoMessage::GotoMessage(const float ini_angle) : Message("GotoMessage")
1449 {
1450  data_size = sizeof(GotoMessage_data_t);
1451  data_ptr = malloc(data_size);
1452  memset(data_ptr, 0, data_size);
1453  data = (GotoMessage_data_t *)data_ptr;
1455  data->angle = ini_angle;
1456  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1457  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1458  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1459  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1460  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1461  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1462  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
1463 }
1464 /** Constructor */
1466 {
1467  data_size = sizeof(GotoMessage_data_t);
1468  data_ptr = malloc(data_size);
1469  memset(data_ptr, 0, data_size);
1470  data = (GotoMessage_data_t *)data_ptr;
1472  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1473  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1474  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1475  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1476  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1477  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1478  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
1479 }
1480 
1481 /** Destructor */
1483 {
1484  free(data_ptr);
1485 }
1486 
1487 /** Copy constructor.
1488  * @param m message to copy from
1489  */
1491 {
1492  data_size = m->data_size;
1493  data_ptr = malloc(data_size);
1494  memcpy(data_ptr, m->data_ptr, data_size);
1495  data = (GotoMessage_data_t *)data_ptr;
1497 }
1498 
1499 /* Methods */
1500 /** Get angle value.
1501  * Current angle.
1502  * @return angle value
1503  */
1504 float
1506 {
1507  return data->angle;
1508 }
1509 
1510 /** Get maximum length of angle value.
1511  * @return length of angle value, can be length of the array or number of
1512  * maximum number of characters for a string
1513  */
1514 size_t
1516 {
1517  return 1;
1518 }
1519 
1520 /** Set angle value.
1521  * Current angle.
1522  * @param new_angle new angle value
1523  */
1524 void
1526 {
1527  data->angle = new_angle;
1528 }
1529 
1530 /** Clone this message.
1531  * Produces a message of the same type as this message and copies the
1532  * data to the new message.
1533  * @return clone of this message
1534  */
1535 Message *
1537 {
1538  return new DynamixelServoInterface::GotoMessage(this);
1539 }
1540 /** @class DynamixelServoInterface::TimedGotoMessage <interfaces/DynamixelServoInterface.h>
1541  * TimedGotoMessage Fawkes BlackBoard Interface Message.
1542  *
1543 
1544  */
1545 
1546 
1547 /** Constructor with initial values.
1548  * @param ini_time_sec initial value for time_sec
1549  * @param ini_angle initial value for angle
1550  */
1551 DynamixelServoInterface::TimedGotoMessage::TimedGotoMessage(const float ini_time_sec, const float ini_angle) : Message("TimedGotoMessage")
1552 {
1553  data_size = sizeof(TimedGotoMessage_data_t);
1554  data_ptr = malloc(data_size);
1555  memset(data_ptr, 0, data_size);
1556  data = (TimedGotoMessage_data_t *)data_ptr;
1558  data->time_sec = ini_time_sec;
1559  data->angle = ini_angle;
1560  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1561  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1562  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1563  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1564  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1565  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1566  add_fieldinfo(IFT_FLOAT, "time_sec", 1, &data->time_sec);
1567  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
1568 }
1569 /** Constructor */
1571 {
1572  data_size = sizeof(TimedGotoMessage_data_t);
1573  data_ptr = malloc(data_size);
1574  memset(data_ptr, 0, data_size);
1575  data = (TimedGotoMessage_data_t *)data_ptr;
1577  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1578  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1579  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1580  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1581  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1582  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1583  add_fieldinfo(IFT_FLOAT, "time_sec", 1, &data->time_sec);
1584  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
1585 }
1586 
1587 /** Destructor */
1589 {
1590  free(data_ptr);
1591 }
1592 
1593 /** Copy constructor.
1594  * @param m message to copy from
1595  */
1597 {
1598  data_size = m->data_size;
1599  data_ptr = malloc(data_size);
1600  memcpy(data_ptr, m->data_ptr, data_size);
1601  data = (TimedGotoMessage_data_t *)data_ptr;
1603 }
1604 
1605 /* Methods */
1606 /** Get time_sec value.
1607  * Time in seconds when to reach
1608  the final position.
1609  * @return time_sec value
1610  */
1611 float
1613 {
1614  return data->time_sec;
1615 }
1616 
1617 /** Get maximum length of time_sec value.
1618  * @return length of time_sec value, can be length of the array or number of
1619  * maximum number of characters for a string
1620  */
1621 size_t
1623 {
1624  return 1;
1625 }
1626 
1627 /** Set time_sec value.
1628  * Time in seconds when to reach
1629  the final position.
1630  * @param new_time_sec new time_sec value
1631  */
1632 void
1634 {
1635  data->time_sec = new_time_sec;
1636 }
1637 
1638 /** Get angle value.
1639  * Current angle.
1640  * @return angle value
1641  */
1642 float
1644 {
1645  return data->angle;
1646 }
1647 
1648 /** Get maximum length of angle value.
1649  * @return length of angle value, can be length of the array or number of
1650  * maximum number of characters for a string
1651  */
1652 size_t
1654 {
1655  return 1;
1656 }
1657 
1658 /** Set angle value.
1659  * Current angle.
1660  * @param new_angle new angle value
1661  */
1662 void
1664 {
1665  data->angle = new_angle;
1666 }
1667 
1668 /** Clone this message.
1669  * Produces a message of the same type as this message and copies the
1670  * data to the new message.
1671  * @return clone of this message
1672  */
1673 Message *
1675 {
1677 }
1678 /** @class DynamixelServoInterface::SetModeMessage <interfaces/DynamixelServoInterface.h>
1679  * SetModeMessage Fawkes BlackBoard Interface Message.
1680  *
1681 
1682  */
1683 
1684 
1685 /** Constructor with initial values.
1686  * @param ini_mode initial value for mode
1687  */
1688 DynamixelServoInterface::SetModeMessage::SetModeMessage(const uint8_t ini_mode) : Message("SetModeMessage")
1689 {
1690  data_size = sizeof(SetModeMessage_data_t);
1691  data_ptr = malloc(data_size);
1692  memset(data_ptr, 0, data_size);
1693  data = (SetModeMessage_data_t *)data_ptr;
1695  data->mode = ini_mode;
1696  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1697  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1698  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1699  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1700  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1701  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1702  add_fieldinfo(IFT_UINT8, "mode", 1, &data->mode);
1703 }
1704 /** Constructor */
1706 {
1707  data_size = sizeof(SetModeMessage_data_t);
1708  data_ptr = malloc(data_size);
1709  memset(data_ptr, 0, data_size);
1710  data = (SetModeMessage_data_t *)data_ptr;
1712  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1713  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1714  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1715  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1716  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1717  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1718  add_fieldinfo(IFT_UINT8, "mode", 1, &data->mode);
1719 }
1720 
1721 /** Destructor */
1723 {
1724  free(data_ptr);
1725 }
1726 
1727 /** Copy constructor.
1728  * @param m message to copy from
1729  */
1731 {
1732  data_size = m->data_size;
1733  data_ptr = malloc(data_size);
1734  memcpy(data_ptr, m->data_ptr, data_size);
1735  data = (SetModeMessage_data_t *)data_ptr;
1737 }
1738 
1739 /* Methods */
1740 /** Get mode value.
1741  * New mode, see the enum WorkingMode in this interface
1742  * @return mode value
1743  */
1744 uint8_t
1746 {
1747  return data->mode;
1748 }
1749 
1750 /** Get maximum length of mode value.
1751  * @return length of mode value, can be length of the array or number of
1752  * maximum number of characters for a string
1753  */
1754 size_t
1756 {
1757  return 1;
1758 }
1759 
1760 /** Set mode value.
1761  * New mode, see the enum WorkingMode in this interface
1762  * @param new_mode new mode value
1763  */
1764 void
1766 {
1767  data->mode = new_mode;
1768 }
1769 
1770 /** Clone this message.
1771  * Produces a message of the same type as this message and copies the
1772  * data to the new message.
1773  * @return clone of this message
1774  */
1775 Message *
1777 {
1778  return new DynamixelServoInterface::SetModeMessage(this);
1779 }
1780 /** @class DynamixelServoInterface::SetSpeedMessage <interfaces/DynamixelServoInterface.h>
1781  * SetSpeedMessage Fawkes BlackBoard Interface Message.
1782  *
1783 
1784  */
1785 
1786 
1787 /** Constructor with initial values.
1788  * @param ini_speed initial value for speed
1789  */
1790 DynamixelServoInterface::SetSpeedMessage::SetSpeedMessage(const uint16_t ini_speed) : Message("SetSpeedMessage")
1791 {
1792  data_size = sizeof(SetSpeedMessage_data_t);
1793  data_ptr = malloc(data_size);
1794  memset(data_ptr, 0, data_size);
1795  data = (SetSpeedMessage_data_t *)data_ptr;
1797  data->speed = ini_speed;
1798  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1799  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1800  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1801  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1802  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1803  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1804  add_fieldinfo(IFT_UINT16, "speed", 1, &data->speed);
1805 }
1806 /** Constructor */
1808 {
1809  data_size = sizeof(SetSpeedMessage_data_t);
1810  data_ptr = malloc(data_size);
1811  memset(data_ptr, 0, data_size);
1812  data = (SetSpeedMessage_data_t *)data_ptr;
1814  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1815  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1816  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1817  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1818  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1819  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1820  add_fieldinfo(IFT_UINT16, "speed", 1, &data->speed);
1821 }
1822 
1823 /** Destructor */
1825 {
1826  free(data_ptr);
1827 }
1828 
1829 /** Copy constructor.
1830  * @param m message to copy from
1831  */
1833 {
1834  data_size = m->data_size;
1835  data_ptr = malloc(data_size);
1836  memcpy(data_ptr, m->data_ptr, data_size);
1837  data = (SetSpeedMessage_data_t *)data_ptr;
1839 }
1840 
1841 /* Methods */
1842 /** Get speed value.
1843  * 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)
1844  * @return speed value
1845  */
1846 uint16_t
1848 {
1849  return data->speed;
1850 }
1851 
1852 /** Get maximum length of speed value.
1853  * @return length of speed value, can be length of the array or number of
1854  * maximum number of characters for a string
1855  */
1856 size_t
1858 {
1859  return 1;
1860 }
1861 
1862 /** Set speed value.
1863  * 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)
1864  * @param new_speed new speed value
1865  */
1866 void
1868 {
1869  data->speed = new_speed;
1870 }
1871 
1872 /** Clone this message.
1873  * Produces a message of the same type as this message and copies the
1874  * data to the new message.
1875  * @return clone of this message
1876  */
1877 Message *
1879 {
1881 }
1882 /** @class DynamixelServoInterface::SetEnabledMessage <interfaces/DynamixelServoInterface.h>
1883  * SetEnabledMessage Fawkes BlackBoard Interface Message.
1884  *
1885 
1886  */
1887 
1888 
1889 /** Constructor with initial values.
1890  * @param ini_enabled initial value for enabled
1891  */
1892 DynamixelServoInterface::SetEnabledMessage::SetEnabledMessage(const bool ini_enabled) : Message("SetEnabledMessage")
1893 {
1894  data_size = sizeof(SetEnabledMessage_data_t);
1895  data_ptr = malloc(data_size);
1896  memset(data_ptr, 0, data_size);
1897  data = (SetEnabledMessage_data_t *)data_ptr;
1899  data->enabled = ini_enabled;
1900  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1901  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1902  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1903  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1904  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1905  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1906  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
1907 }
1908 /** Constructor */
1910 {
1911  data_size = sizeof(SetEnabledMessage_data_t);
1912  data_ptr = malloc(data_size);
1913  memset(data_ptr, 0, data_size);
1914  data = (SetEnabledMessage_data_t *)data_ptr;
1916  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
1917  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
1918  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
1919  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
1920  enum_map_WorkingMode[(int)JOINT] = "JOINT";
1921  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
1922  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
1923 }
1924 
1925 /** Destructor */
1927 {
1928  free(data_ptr);
1929 }
1930 
1931 /** Copy constructor.
1932  * @param m message to copy from
1933  */
1935 {
1936  data_size = m->data_size;
1937  data_ptr = malloc(data_size);
1938  memcpy(data_ptr, m->data_ptr, data_size);
1939  data = (SetEnabledMessage_data_t *)data_ptr;
1941 }
1942 
1943 /* Methods */
1944 /** Get enabled value.
1945  * Is the servo enabled?
1946  * @return enabled value
1947  */
1948 bool
1950 {
1951  return data->enabled;
1952 }
1953 
1954 /** Get maximum length of enabled value.
1955  * @return length of enabled value, can be length of the array or number of
1956  * maximum number of characters for a string
1957  */
1958 size_t
1960 {
1961  return 1;
1962 }
1963 
1964 /** Set enabled value.
1965  * Is the servo enabled?
1966  * @param new_enabled new enabled value
1967  */
1968 void
1970 {
1971  data->enabled = new_enabled;
1972 }
1973 
1974 /** Clone this message.
1975  * Produces a message of the same type as this message and copies the
1976  * data to the new message.
1977  * @return clone of this message
1978  */
1979 Message *
1981 {
1983 }
1984 /** @class DynamixelServoInterface::SetVelocityMessage <interfaces/DynamixelServoInterface.h>
1985  * SetVelocityMessage Fawkes BlackBoard Interface Message.
1986  *
1987 
1988  */
1989 
1990 
1991 /** Constructor with initial values.
1992  * @param ini_velocity initial value for velocity
1993  */
1994 DynamixelServoInterface::SetVelocityMessage::SetVelocityMessage(const float ini_velocity) : Message("SetVelocityMessage")
1995 {
1996  data_size = sizeof(SetVelocityMessage_data_t);
1997  data_ptr = malloc(data_size);
1998  memset(data_ptr, 0, data_size);
1999  data = (SetVelocityMessage_data_t *)data_ptr;
2001  data->velocity = ini_velocity;
2002  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2003  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2004  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2005  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2006  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2007  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2008  add_fieldinfo(IFT_FLOAT, "velocity", 1, &data->velocity);
2009 }
2010 /** Constructor */
2012 {
2013  data_size = sizeof(SetVelocityMessage_data_t);
2014  data_ptr = malloc(data_size);
2015  memset(data_ptr, 0, data_size);
2016  data = (SetVelocityMessage_data_t *)data_ptr;
2018  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2019  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2020  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2021  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2022  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2023  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2024  add_fieldinfo(IFT_FLOAT, "velocity", 1, &data->velocity);
2025 }
2026 
2027 /** Destructor */
2029 {
2030  free(data_ptr);
2031 }
2032 
2033 /** Copy constructor.
2034  * @param m message to copy from
2035  */
2037 {
2038  data_size = m->data_size;
2039  data_ptr = malloc(data_size);
2040  memcpy(data_ptr, m->data_ptr, data_size);
2041  data = (SetVelocityMessage_data_t *)data_ptr;
2043 }
2044 
2045 /* Methods */
2046 /** Get velocity value.
2047  * Maximum servo velocity currently reached.
2048  * @return velocity value
2049  */
2050 float
2052 {
2053  return data->velocity;
2054 }
2055 
2056 /** Get maximum length of velocity value.
2057  * @return length of velocity value, can be length of the array or number of
2058  * maximum number of characters for a string
2059  */
2060 size_t
2062 {
2063  return 1;
2064 }
2065 
2066 /** Set velocity value.
2067  * Maximum servo velocity currently reached.
2068  * @param new_velocity new velocity value
2069  */
2070 void
2072 {
2073  data->velocity = new_velocity;
2074 }
2075 
2076 /** Clone this message.
2077  * Produces a message of the same type as this message and copies the
2078  * data to the new message.
2079  * @return clone of this message
2080  */
2081 Message *
2083 {
2085 }
2086 /** @class DynamixelServoInterface::SetMarginMessage <interfaces/DynamixelServoInterface.h>
2087  * SetMarginMessage Fawkes BlackBoard Interface Message.
2088  *
2089 
2090  */
2091 
2092 
2093 /** Constructor with initial values.
2094  * @param ini_angle_margin initial value for angle_margin
2095  */
2096 DynamixelServoInterface::SetMarginMessage::SetMarginMessage(const float ini_angle_margin) : Message("SetMarginMessage")
2097 {
2098  data_size = sizeof(SetMarginMessage_data_t);
2099  data_ptr = malloc(data_size);
2100  memset(data_ptr, 0, data_size);
2101  data = (SetMarginMessage_data_t *)data_ptr;
2103  data->angle_margin = ini_angle_margin;
2104  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2105  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2106  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2107  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2108  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2109  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2110  add_fieldinfo(IFT_FLOAT, "angle_margin", 1, &data->angle_margin);
2111 }
2112 /** Constructor */
2114 {
2115  data_size = sizeof(SetMarginMessage_data_t);
2116  data_ptr = malloc(data_size);
2117  memset(data_ptr, 0, data_size);
2118  data = (SetMarginMessage_data_t *)data_ptr;
2120  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2121  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2122  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2123  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2124  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2125  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2126  add_fieldinfo(IFT_FLOAT, "angle_margin", 1, &data->angle_margin);
2127 }
2128 
2129 /** Destructor */
2131 {
2132  free(data_ptr);
2133 }
2134 
2135 /** Copy constructor.
2136  * @param m message to copy from
2137  */
2139 {
2140  data_size = m->data_size;
2141  data_ptr = malloc(data_size);
2142  memcpy(data_ptr, m->data_ptr, data_size);
2143  data = (SetMarginMessage_data_t *)data_ptr;
2145 }
2146 
2147 /* Methods */
2148 /** Get angle_margin value.
2149  *
2150  Margin in radians around a target servo value to consider the
2151  motion as final.
2152 
2153  * @return angle_margin value
2154  */
2155 float
2157 {
2158  return data->angle_margin;
2159 }
2160 
2161 /** Get maximum length of angle_margin value.
2162  * @return length of angle_margin value, can be length of the array or number of
2163  * maximum number of characters for a string
2164  */
2165 size_t
2167 {
2168  return 1;
2169 }
2170 
2171 /** Set angle_margin value.
2172  *
2173  Margin in radians around a target servo value to consider the
2174  motion as final.
2175 
2176  * @param new_angle_margin new angle_margin value
2177  */
2178 void
2180 {
2181  data->angle_margin = new_angle_margin;
2182 }
2183 
2184 /** Clone this message.
2185  * Produces a message of the same type as this message and copies the
2186  * data to the new message.
2187  * @return clone of this message
2188  */
2189 Message *
2191 {
2193 }
2194 /** @class DynamixelServoInterface::SetComplianceValuesMessage <interfaces/DynamixelServoInterface.h>
2195  * SetComplianceValuesMessage Fawkes BlackBoard Interface Message.
2196  *
2197 
2198  */
2199 
2200 
2201 /** Constructor with initial values.
2202  * @param ini_cw_margin initial value for cw_margin
2203  * @param ini_ccw_margin initial value for ccw_margin
2204  * @param ini_cw_slope initial value for cw_slope
2205  * @param ini_ccw_slope initial value for ccw_slope
2206  */
2207 DynamixelServoInterface::SetComplianceValuesMessage::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) : Message("SetComplianceValuesMessage")
2208 {
2209  data_size = sizeof(SetComplianceValuesMessage_data_t);
2210  data_ptr = malloc(data_size);
2211  memset(data_ptr, 0, data_size);
2212  data = (SetComplianceValuesMessage_data_t *)data_ptr;
2214  data->cw_margin = ini_cw_margin;
2215  data->ccw_margin = ini_ccw_margin;
2216  data->cw_slope = ini_cw_slope;
2217  data->ccw_slope = ini_ccw_slope;
2218  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2219  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2220  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2221  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2222  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2223  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2224  add_fieldinfo(IFT_UINT8, "cw_margin", 1, &data->cw_margin);
2225  add_fieldinfo(IFT_UINT8, "ccw_margin", 1, &data->ccw_margin);
2226  add_fieldinfo(IFT_UINT8, "cw_slope", 1, &data->cw_slope);
2227  add_fieldinfo(IFT_UINT8, "ccw_slope", 1, &data->ccw_slope);
2228 }
2229 /** Constructor */
2231 {
2232  data_size = sizeof(SetComplianceValuesMessage_data_t);
2233  data_ptr = malloc(data_size);
2234  memset(data_ptr, 0, data_size);
2235  data = (SetComplianceValuesMessage_data_t *)data_ptr;
2237  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2238  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2239  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2240  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2241  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2242  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2243  add_fieldinfo(IFT_UINT8, "cw_margin", 1, &data->cw_margin);
2244  add_fieldinfo(IFT_UINT8, "ccw_margin", 1, &data->ccw_margin);
2245  add_fieldinfo(IFT_UINT8, "cw_slope", 1, &data->cw_slope);
2246  add_fieldinfo(IFT_UINT8, "ccw_slope", 1, &data->ccw_slope);
2247 }
2248 
2249 /** Destructor */
2251 {
2252  free(data_ptr);
2253 }
2254 
2255 /** Copy constructor.
2256  * @param m message to copy from
2257  */
2259 {
2260  data_size = m->data_size;
2261  data_ptr = malloc(data_size);
2262  memcpy(data_ptr, m->data_ptr, data_size);
2263  data = (SetComplianceValuesMessage_data_t *)data_ptr;
2265 }
2266 
2267 /* Methods */
2268 /** Get cw_margin value.
2269  * New CW compliance margin
2270  * @return cw_margin value
2271  */
2272 uint8_t
2274 {
2275  return data->cw_margin;
2276 }
2277 
2278 /** Get maximum length of cw_margin value.
2279  * @return length of cw_margin value, can be length of the array or number of
2280  * maximum number of characters for a string
2281  */
2282 size_t
2284 {
2285  return 1;
2286 }
2287 
2288 /** Set cw_margin value.
2289  * New CW compliance margin
2290  * @param new_cw_margin new cw_margin value
2291  */
2292 void
2294 {
2295  data->cw_margin = new_cw_margin;
2296 }
2297 
2298 /** Get ccw_margin value.
2299  * New CCW compliance margin
2300  * @return ccw_margin value
2301  */
2302 uint8_t
2304 {
2305  return data->ccw_margin;
2306 }
2307 
2308 /** Get maximum length of ccw_margin value.
2309  * @return length of ccw_margin value, can be length of the array or number of
2310  * maximum number of characters for a string
2311  */
2312 size_t
2314 {
2315  return 1;
2316 }
2317 
2318 /** Set ccw_margin value.
2319  * New CCW compliance margin
2320  * @param new_ccw_margin new ccw_margin value
2321  */
2322 void
2324 {
2325  data->ccw_margin = new_ccw_margin;
2326 }
2327 
2328 /** Get cw_slope value.
2329  * New CW compliance slope
2330  * @return cw_slope value
2331  */
2332 uint8_t
2334 {
2335  return data->cw_slope;
2336 }
2337 
2338 /** Get maximum length of cw_slope value.
2339  * @return length of cw_slope value, can be length of the array or number of
2340  * maximum number of characters for a string
2341  */
2342 size_t
2344 {
2345  return 1;
2346 }
2347 
2348 /** Set cw_slope value.
2349  * New CW compliance slope
2350  * @param new_cw_slope new cw_slope value
2351  */
2352 void
2354 {
2355  data->cw_slope = new_cw_slope;
2356 }
2357 
2358 /** Get ccw_slope value.
2359  * New LED enabled value
2360  * @return ccw_slope value
2361  */
2362 uint8_t
2364 {
2365  return data->ccw_slope;
2366 }
2367 
2368 /** Get maximum length of ccw_slope value.
2369  * @return length of ccw_slope value, can be length of the array or number of
2370  * maximum number of characters for a string
2371  */
2372 size_t
2374 {
2375  return 1;
2376 }
2377 
2378 /** Set ccw_slope value.
2379  * New LED enabled value
2380  * @param new_ccw_slope new ccw_slope value
2381  */
2382 void
2384 {
2385  data->ccw_slope = new_ccw_slope;
2386 }
2387 
2388 /** Clone this message.
2389  * Produces a message of the same type as this message and copies the
2390  * data to the new message.
2391  * @return clone of this message
2392  */
2393 Message *
2395 {
2397 }
2398 /** @class DynamixelServoInterface::SetGoalSpeedMessage <interfaces/DynamixelServoInterface.h>
2399  * SetGoalSpeedMessage Fawkes BlackBoard Interface Message.
2400  *
2401 
2402  */
2403 
2404 
2405 /** Constructor with initial values.
2406  * @param ini_goal_speed initial value for goal_speed
2407  */
2408 DynamixelServoInterface::SetGoalSpeedMessage::SetGoalSpeedMessage(const uint32_t ini_goal_speed) : Message("SetGoalSpeedMessage")
2409 {
2410  data_size = sizeof(SetGoalSpeedMessage_data_t);
2411  data_ptr = malloc(data_size);
2412  memset(data_ptr, 0, data_size);
2413  data = (SetGoalSpeedMessage_data_t *)data_ptr;
2415  data->goal_speed = ini_goal_speed;
2416  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2417  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2418  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2419  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2420  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2421  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2422  add_fieldinfo(IFT_UINT32, "goal_speed", 1, &data->goal_speed);
2423 }
2424 /** Constructor */
2426 {
2427  data_size = sizeof(SetGoalSpeedMessage_data_t);
2428  data_ptr = malloc(data_size);
2429  memset(data_ptr, 0, data_size);
2430  data = (SetGoalSpeedMessage_data_t *)data_ptr;
2432  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2433  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2434  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2435  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2436  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2437  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2438  add_fieldinfo(IFT_UINT32, "goal_speed", 1, &data->goal_speed);
2439 }
2440 
2441 /** Destructor */
2443 {
2444  free(data_ptr);
2445 }
2446 
2447 /** Copy constructor.
2448  * @param m message to copy from
2449  */
2451 {
2452  data_size = m->data_size;
2453  data_ptr = malloc(data_size);
2454  memcpy(data_ptr, m->data_ptr, data_size);
2455  data = (SetGoalSpeedMessage_data_t *)data_ptr;
2457 }
2458 
2459 /* Methods */
2460 /** Get goal_speed value.
2461  * New goal speed
2462  * @return goal_speed value
2463  */
2464 uint32_t
2466 {
2467  return data->goal_speed;
2468 }
2469 
2470 /** Get maximum length of goal_speed value.
2471  * @return length of goal_speed value, can be length of the array or number of
2472  * maximum number of characters for a string
2473  */
2474 size_t
2476 {
2477  return 1;
2478 }
2479 
2480 /** Set goal_speed value.
2481  * New goal speed
2482  * @param new_goal_speed new goal_speed value
2483  */
2484 void
2486 {
2487  data->goal_speed = new_goal_speed;
2488 }
2489 
2490 /** Clone this message.
2491  * Produces a message of the same type as this message and copies the
2492  * data to the new message.
2493  * @return clone of this message
2494  */
2495 Message *
2497 {
2499 }
2500 /** @class DynamixelServoInterface::SetTorqueLimitMessage <interfaces/DynamixelServoInterface.h>
2501  * SetTorqueLimitMessage Fawkes BlackBoard Interface Message.
2502  *
2503 
2504  */
2505 
2506 
2507 /** Constructor with initial values.
2508  * @param ini_torque_limit initial value for torque_limit
2509  */
2510 DynamixelServoInterface::SetTorqueLimitMessage::SetTorqueLimitMessage(const uint32_t ini_torque_limit) : Message("SetTorqueLimitMessage")
2511 {
2512  data_size = sizeof(SetTorqueLimitMessage_data_t);
2513  data_ptr = malloc(data_size);
2514  memset(data_ptr, 0, data_size);
2515  data = (SetTorqueLimitMessage_data_t *)data_ptr;
2517  data->torque_limit = ini_torque_limit;
2518  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2519  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2520  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2521  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2522  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2523  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2524  add_fieldinfo(IFT_UINT32, "torque_limit", 1, &data->torque_limit);
2525 }
2526 /** Constructor */
2528 {
2529  data_size = sizeof(SetTorqueLimitMessage_data_t);
2530  data_ptr = malloc(data_size);
2531  memset(data_ptr, 0, data_size);
2532  data = (SetTorqueLimitMessage_data_t *)data_ptr;
2534  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2535  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2536  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2537  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2538  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2539  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2540  add_fieldinfo(IFT_UINT32, "torque_limit", 1, &data->torque_limit);
2541 }
2542 
2543 /** Destructor */
2545 {
2546  free(data_ptr);
2547 }
2548 
2549 /** Copy constructor.
2550  * @param m message to copy from
2551  */
2553 {
2554  data_size = m->data_size;
2555  data_ptr = malloc(data_size);
2556  memcpy(data_ptr, m->data_ptr, data_size);
2557  data = (SetTorqueLimitMessage_data_t *)data_ptr;
2559 }
2560 
2561 /* Methods */
2562 /** Get torque_limit value.
2563  * New torque limit
2564  * @return torque_limit value
2565  */
2566 uint32_t
2568 {
2569  return data->torque_limit;
2570 }
2571 
2572 /** Get maximum length of torque_limit value.
2573  * @return length of torque_limit value, can be length of the array or number of
2574  * maximum number of characters for a string
2575  */
2576 size_t
2578 {
2579  return 1;
2580 }
2581 
2582 /** Set torque_limit value.
2583  * New torque limit
2584  * @param new_torque_limit new torque_limit value
2585  */
2586 void
2588 {
2589  data->torque_limit = new_torque_limit;
2590 }
2591 
2592 /** Clone this message.
2593  * Produces a message of the same type as this message and copies the
2594  * data to the new message.
2595  * @return clone of this message
2596  */
2597 Message *
2599 {
2601 }
2602 /** @class DynamixelServoInterface::SetPunchMessage <interfaces/DynamixelServoInterface.h>
2603  * SetPunchMessage Fawkes BlackBoard Interface Message.
2604  *
2605 
2606  */
2607 
2608 
2609 /** Constructor with initial values.
2610  * @param ini_punch initial value for punch
2611  */
2612 DynamixelServoInterface::SetPunchMessage::SetPunchMessage(const uint32_t ini_punch) : Message("SetPunchMessage")
2613 {
2614  data_size = sizeof(SetPunchMessage_data_t);
2615  data_ptr = malloc(data_size);
2616  memset(data_ptr, 0, data_size);
2617  data = (SetPunchMessage_data_t *)data_ptr;
2619  data->punch = ini_punch;
2620  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2621  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2622  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2623  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2624  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2625  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2626  add_fieldinfo(IFT_UINT32, "punch", 1, &data->punch);
2627 }
2628 /** Constructor */
2630 {
2631  data_size = sizeof(SetPunchMessage_data_t);
2632  data_ptr = malloc(data_size);
2633  memset(data_ptr, 0, data_size);
2634  data = (SetPunchMessage_data_t *)data_ptr;
2636  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2637  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2638  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2639  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2640  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2641  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2642  add_fieldinfo(IFT_UINT32, "punch", 1, &data->punch);
2643 }
2644 
2645 /** Destructor */
2647 {
2648  free(data_ptr);
2649 }
2650 
2651 /** Copy constructor.
2652  * @param m message to copy from
2653  */
2655 {
2656  data_size = m->data_size;
2657  data_ptr = malloc(data_size);
2658  memcpy(data_ptr, m->data_ptr, data_size);
2659  data = (SetPunchMessage_data_t *)data_ptr;
2661 }
2662 
2663 /* Methods */
2664 /** Get punch value.
2665  * New punch
2666  * @return punch value
2667  */
2668 uint32_t
2670 {
2671  return data->punch;
2672 }
2673 
2674 /** Get maximum length of punch value.
2675  * @return length of punch value, can be length of the array or number of
2676  * maximum number of characters for a string
2677  */
2678 size_t
2680 {
2681  return 1;
2682 }
2683 
2684 /** Set punch value.
2685  * New punch
2686  * @param new_punch new punch value
2687  */
2688 void
2690 {
2691  data->punch = new_punch;
2692 }
2693 
2694 /** Clone this message.
2695  * Produces a message of the same type as this message and copies the
2696  * data to the new message.
2697  * @return clone of this message
2698  */
2699 Message *
2701 {
2703 }
2704 /** @class DynamixelServoInterface::GotoPositionMessage <interfaces/DynamixelServoInterface.h>
2705  * GotoPositionMessage Fawkes BlackBoard Interface Message.
2706  *
2707 
2708  */
2709 
2710 
2711 /** Constructor with initial values.
2712  * @param ini_position initial value for position
2713  */
2714 DynamixelServoInterface::GotoPositionMessage::GotoPositionMessage(const uint32_t ini_position) : Message("GotoPositionMessage")
2715 {
2716  data_size = sizeof(GotoPositionMessage_data_t);
2717  data_ptr = malloc(data_size);
2718  memset(data_ptr, 0, data_size);
2719  data = (GotoPositionMessage_data_t *)data_ptr;
2721  data->position = ini_position;
2722  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2723  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2724  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2725  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2726  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2727  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2728  add_fieldinfo(IFT_UINT32, "position", 1, &data->position);
2729 }
2730 /** Constructor */
2732 {
2733  data_size = sizeof(GotoPositionMessage_data_t);
2734  data_ptr = malloc(data_size);
2735  memset(data_ptr, 0, data_size);
2736  data = (GotoPositionMessage_data_t *)data_ptr;
2738  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2739  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2740  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2741  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2742  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2743  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2744  add_fieldinfo(IFT_UINT32, "position", 1, &data->position);
2745 }
2746 
2747 /** Destructor */
2749 {
2750  free(data_ptr);
2751 }
2752 
2753 /** Copy constructor.
2754  * @param m message to copy from
2755  */
2757 {
2758  data_size = m->data_size;
2759  data_ptr = malloc(data_size);
2760  memcpy(data_ptr, m->data_ptr, data_size);
2761  data = (GotoPositionMessage_data_t *)data_ptr;
2763 }
2764 
2765 /* Methods */
2766 /** Get position value.
2767  * New position
2768  * @return position value
2769  */
2770 uint32_t
2772 {
2773  return data->position;
2774 }
2775 
2776 /** Get maximum length of position value.
2777  * @return length of position value, can be length of the array or number of
2778  * maximum number of characters for a string
2779  */
2780 size_t
2782 {
2783  return 1;
2784 }
2785 
2786 /** Set position value.
2787  * New position
2788  * @param new_position new position value
2789  */
2790 void
2792 {
2793  data->position = new_position;
2794 }
2795 
2796 /** Clone this message.
2797  * Produces a message of the same type as this message and copies the
2798  * data to the new message.
2799  * @return clone of this message
2800  */
2801 Message *
2803 {
2805 }
2806 /** @class DynamixelServoInterface::SetAngleLimitsMessage <interfaces/DynamixelServoInterface.h>
2807  * SetAngleLimitsMessage Fawkes BlackBoard Interface Message.
2808  *
2809 
2810  */
2811 
2812 
2813 /** Constructor with initial values.
2814  * @param ini_angle_limit_cw initial value for angle_limit_cw
2815  * @param ini_angle_limit_ccw initial value for angle_limit_ccw
2816  */
2817 DynamixelServoInterface::SetAngleLimitsMessage::SetAngleLimitsMessage(const uint32_t ini_angle_limit_cw, const uint32_t ini_angle_limit_ccw) : Message("SetAngleLimitsMessage")
2818 {
2819  data_size = sizeof(SetAngleLimitsMessage_data_t);
2820  data_ptr = malloc(data_size);
2821  memset(data_ptr, 0, data_size);
2822  data = (SetAngleLimitsMessage_data_t *)data_ptr;
2824  data->angle_limit_cw = ini_angle_limit_cw;
2825  data->angle_limit_ccw = ini_angle_limit_ccw;
2826  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2827  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2828  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2829  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2830  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2831  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2832  add_fieldinfo(IFT_UINT32, "angle_limit_cw", 1, &data->angle_limit_cw);
2833  add_fieldinfo(IFT_UINT32, "angle_limit_ccw", 1, &data->angle_limit_ccw);
2834 }
2835 /** Constructor */
2837 {
2838  data_size = sizeof(SetAngleLimitsMessage_data_t);
2839  data_ptr = malloc(data_size);
2840  memset(data_ptr, 0, data_size);
2841  data = (SetAngleLimitsMessage_data_t *)data_ptr;
2843  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2844  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2845  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2846  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2847  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2848  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2849  add_fieldinfo(IFT_UINT32, "angle_limit_cw", 1, &data->angle_limit_cw);
2850  add_fieldinfo(IFT_UINT32, "angle_limit_ccw", 1, &data->angle_limit_ccw);
2851 }
2852 
2853 /** Destructor */
2855 {
2856  free(data_ptr);
2857 }
2858 
2859 /** Copy constructor.
2860  * @param m message to copy from
2861  */
2863 {
2864  data_size = m->data_size;
2865  data_ptr = malloc(data_size);
2866  memcpy(data_ptr, m->data_ptr, data_size);
2867  data = (SetAngleLimitsMessage_data_t *)data_ptr;
2869 }
2870 
2871 /* Methods */
2872 /** Get angle_limit_cw value.
2873  * New cw angle limit
2874  * @return angle_limit_cw value
2875  */
2876 uint32_t
2878 {
2879  return data->angle_limit_cw;
2880 }
2881 
2882 /** Get maximum length of angle_limit_cw value.
2883  * @return length of angle_limit_cw value, can be length of the array or number of
2884  * maximum number of characters for a string
2885  */
2886 size_t
2888 {
2889  return 1;
2890 }
2891 
2892 /** Set angle_limit_cw value.
2893  * New cw angle limit
2894  * @param new_angle_limit_cw new angle_limit_cw value
2895  */
2896 void
2898 {
2899  data->angle_limit_cw = new_angle_limit_cw;
2900 }
2901 
2902 /** Get angle_limit_ccw value.
2903  * New ccw angle limit
2904  * @return angle_limit_ccw value
2905  */
2906 uint32_t
2908 {
2909  return data->angle_limit_ccw;
2910 }
2911 
2912 /** Get maximum length of angle_limit_ccw value.
2913  * @return length of angle_limit_ccw value, can be length of the array or number of
2914  * maximum number of characters for a string
2915  */
2916 size_t
2918 {
2919  return 1;
2920 }
2921 
2922 /** Set angle_limit_ccw value.
2923  * New ccw angle limit
2924  * @param new_angle_limit_ccw new angle_limit_ccw value
2925  */
2926 void
2928 {
2929  data->angle_limit_ccw = new_angle_limit_ccw;
2930 }
2931 
2932 /** Clone this message.
2933  * Produces a message of the same type as this message and copies the
2934  * data to the new message.
2935  * @return clone of this message
2936  */
2937 Message *
2939 {
2941 }
2942 /** @class DynamixelServoInterface::ResetRawErrorMessage <interfaces/DynamixelServoInterface.h>
2943  * ResetRawErrorMessage Fawkes BlackBoard Interface Message.
2944  *
2945 
2946  */
2947 
2948 
2949 /** Constructor */
2951 {
2952  data_size = sizeof(ResetRawErrorMessage_data_t);
2953  data_ptr = malloc(data_size);
2954  memset(data_ptr, 0, data_size);
2955  data = (ResetRawErrorMessage_data_t *)data_ptr;
2957  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
2958  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
2959  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
2960  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
2961  enum_map_WorkingMode[(int)JOINT] = "JOINT";
2962  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
2963 }
2964 
2965 /** Destructor */
2967 {
2968  free(data_ptr);
2969 }
2970 
2971 /** Copy constructor.
2972  * @param m message to copy from
2973  */
2975 {
2976  data_size = m->data_size;
2977  data_ptr = malloc(data_size);
2978  memcpy(data_ptr, m->data_ptr, data_size);
2979  data = (ResetRawErrorMessage_data_t *)data_ptr;
2981 }
2982 
2983 /* Methods */
2984 /** Clone this message.
2985  * Produces a message of the same type as this message and copies the
2986  * data to the new message.
2987  * @return clone of this message
2988  */
2989 Message *
2991 {
2993 }
2994 /** @class DynamixelServoInterface::SetPreventAlarmShutdownMessage <interfaces/DynamixelServoInterface.h>
2995  * SetPreventAlarmShutdownMessage Fawkes BlackBoard Interface Message.
2996  *
2997 
2998  */
2999 
3000 
3001 /** Constructor with initial values.
3002  * @param ini_enable_prevent_alarm_shutdown initial value for enable_prevent_alarm_shutdown
3003  */
3004 DynamixelServoInterface::SetPreventAlarmShutdownMessage::SetPreventAlarmShutdownMessage(const bool ini_enable_prevent_alarm_shutdown) : Message("SetPreventAlarmShutdownMessage")
3005 {
3006  data_size = sizeof(SetPreventAlarmShutdownMessage_data_t);
3007  data_ptr = malloc(data_size);
3008  memset(data_ptr, 0, data_size);
3009  data = (SetPreventAlarmShutdownMessage_data_t *)data_ptr;
3011  data->enable_prevent_alarm_shutdown = ini_enable_prevent_alarm_shutdown;
3012  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
3013  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
3014  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
3015  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
3016  enum_map_WorkingMode[(int)JOINT] = "JOINT";
3017  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
3018  add_fieldinfo(IFT_BOOL, "enable_prevent_alarm_shutdown", 1, &data->enable_prevent_alarm_shutdown);
3019 }
3020 /** Constructor */
3022 {
3023  data_size = sizeof(SetPreventAlarmShutdownMessage_data_t);
3024  data_ptr = malloc(data_size);
3025  memset(data_ptr, 0, data_size);
3026  data = (SetPreventAlarmShutdownMessage_data_t *)data_ptr;
3028  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
3029  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
3030  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
3031  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
3032  enum_map_WorkingMode[(int)JOINT] = "JOINT";
3033  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
3034  add_fieldinfo(IFT_BOOL, "enable_prevent_alarm_shutdown", 1, &data->enable_prevent_alarm_shutdown);
3035 }
3036 
3037 /** Destructor */
3039 {
3040  free(data_ptr);
3041 }
3042 
3043 /** Copy constructor.
3044  * @param m message to copy from
3045  */
3047 {
3048  data_size = m->data_size;
3049  data_ptr = malloc(data_size);
3050  memcpy(data_ptr, m->data_ptr, data_size);
3051  data = (SetPreventAlarmShutdownMessage_data_t *)data_ptr;
3053 }
3054 
3055 /* Methods */
3056 /** Get enable_prevent_alarm_shutdown value.
3057  * Enable alarm shutdown
3058  * @return enable_prevent_alarm_shutdown value
3059  */
3060 bool
3062 {
3063  return data->enable_prevent_alarm_shutdown;
3064 }
3065 
3066 /** Get maximum length of enable_prevent_alarm_shutdown value.
3067  * @return length of enable_prevent_alarm_shutdown value, can be length of the array or number of
3068  * maximum number of characters for a string
3069  */
3070 size_t
3072 {
3073  return 1;
3074 }
3075 
3076 /** Set enable_prevent_alarm_shutdown value.
3077  * Enable alarm shutdown
3078  * @param new_enable_prevent_alarm_shutdown new enable_prevent_alarm_shutdown value
3079  */
3080 void
3082 {
3083  data->enable_prevent_alarm_shutdown = new_enable_prevent_alarm_shutdown;
3084 }
3085 
3086 /** Clone this message.
3087  * Produces a message of the same type as this message and copies the
3088  * data to the new message.
3089  * @return clone of this message
3090  */
3091 Message *
3093 {
3095 }
3096 /** @class DynamixelServoInterface::SetAutorecoverEnabledMessage <interfaces/DynamixelServoInterface.h>
3097  * SetAutorecoverEnabledMessage Fawkes BlackBoard Interface Message.
3098  *
3099 
3100  */
3101 
3102 
3103 /** Constructor with initial values.
3104  * @param ini_autorecover_enabled initial value for autorecover_enabled
3105  */
3106 DynamixelServoInterface::SetAutorecoverEnabledMessage::SetAutorecoverEnabledMessage(const bool ini_autorecover_enabled) : Message("SetAutorecoverEnabledMessage")
3107 {
3108  data_size = sizeof(SetAutorecoverEnabledMessage_data_t);
3109  data_ptr = malloc(data_size);
3110  memset(data_ptr, 0, data_size);
3111  data = (SetAutorecoverEnabledMessage_data_t *)data_ptr;
3113  data->autorecover_enabled = ini_autorecover_enabled;
3114  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
3115  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
3116  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
3117  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
3118  enum_map_WorkingMode[(int)JOINT] = "JOINT";
3119  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
3120  add_fieldinfo(IFT_BOOL, "autorecover_enabled", 1, &data->autorecover_enabled);
3121 }
3122 /** Constructor */
3124 {
3125  data_size = sizeof(SetAutorecoverEnabledMessage_data_t);
3126  data_ptr = malloc(data_size);
3127  memset(data_ptr, 0, data_size);
3128  data = (SetAutorecoverEnabledMessage_data_t *)data_ptr;
3130  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
3131  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
3132  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
3133  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
3134  enum_map_WorkingMode[(int)JOINT] = "JOINT";
3135  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
3136  add_fieldinfo(IFT_BOOL, "autorecover_enabled", 1, &data->autorecover_enabled);
3137 }
3138 
3139 /** Destructor */
3141 {
3142  free(data_ptr);
3143 }
3144 
3145 /** Copy constructor.
3146  * @param m message to copy from
3147  */
3149 {
3150  data_size = m->data_size;
3151  data_ptr = malloc(data_size);
3152  memcpy(data_ptr, m->data_ptr, data_size);
3153  data = (SetAutorecoverEnabledMessage_data_t *)data_ptr;
3155 }
3156 
3157 /* Methods */
3158 /** Get autorecover_enabled value.
3159  * Automatically recover on alarm shutdown
3160  * @return autorecover_enabled value
3161  */
3162 bool
3164 {
3165  return data->autorecover_enabled;
3166 }
3167 
3168 /** Get maximum length of autorecover_enabled value.
3169  * @return length of autorecover_enabled value, can be length of the array or number of
3170  * maximum number of characters for a string
3171  */
3172 size_t
3174 {
3175  return 1;
3176 }
3177 
3178 /** Set autorecover_enabled value.
3179  * Automatically recover on alarm shutdown
3180  * @param new_autorecover_enabled new autorecover_enabled value
3181  */
3182 void
3184 {
3185  data->autorecover_enabled = new_autorecover_enabled;
3186 }
3187 
3188 /** Clone this message.
3189  * Produces a message of the same type as this message and copies the
3190  * data to the new message.
3191  * @return clone of this message
3192  */
3193 Message *
3195 {
3197 }
3198 /** @class DynamixelServoInterface::RecoverMessage <interfaces/DynamixelServoInterface.h>
3199  * RecoverMessage Fawkes BlackBoard Interface Message.
3200  *
3201 
3202  */
3203 
3204 
3205 /** Constructor */
3207 {
3208  data_size = sizeof(RecoverMessage_data_t);
3209  data_ptr = malloc(data_size);
3210  memset(data_ptr, 0, data_size);
3211  data = (RecoverMessage_data_t *)data_ptr;
3213  enum_map_ErrorCode[(int)ERROR_NONE] = "ERROR_NONE";
3214  enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] = "ERROR_UNSPECIFIC";
3215  enum_map_ErrorCode[(int)ERROR_COMMUNICATION] = "ERROR_COMMUNICATION";
3216  enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] = "ERROR_ANGLE_OUTOFRANGE";
3217  enum_map_WorkingMode[(int)JOINT] = "JOINT";
3218  enum_map_WorkingMode[(int)WHEEL] = "WHEEL";
3219 }
3220 
3221 /** Destructor */
3223 {
3224  free(data_ptr);
3225 }
3226 
3227 /** Copy constructor.
3228  * @param m message to copy from
3229  */
3231 {
3232  data_size = m->data_size;
3233  data_ptr = malloc(data_size);
3234  memcpy(data_ptr, m->data_ptr, data_size);
3235  data = (RecoverMessage_data_t *)data_ptr;
3237 }
3238 
3239 /* Methods */
3240 /** Clone this message.
3241  * Produces a message of the same type as this message and copies the
3242  * data to the new message.
3243  * @return clone of this message
3244  */
3245 Message *
3247 {
3248  return new DynamixelServoInterface::RecoverMessage(this);
3249 }
3250 /** Check if message is valid and can be enqueued.
3251  * @param message Message to check
3252  * @return true if the message is valid, false otherwise.
3253  */
3254 bool
3255 DynamixelServoInterface::message_valid(const Message *message) const
3256 {
3257  const StopMessage *m0 = dynamic_cast<const StopMessage *>(message);
3258  if ( m0 != NULL ) {
3259  return true;
3260  }
3261  const FlushMessage *m1 = dynamic_cast<const FlushMessage *>(message);
3262  if ( m1 != NULL ) {
3263  return true;
3264  }
3265  const GotoMessage *m2 = dynamic_cast<const GotoMessage *>(message);
3266  if ( m2 != NULL ) {
3267  return true;
3268  }
3269  const TimedGotoMessage *m3 = dynamic_cast<const TimedGotoMessage *>(message);
3270  if ( m3 != NULL ) {
3271  return true;
3272  }
3273  const SetModeMessage *m4 = dynamic_cast<const SetModeMessage *>(message);
3274  if ( m4 != NULL ) {
3275  return true;
3276  }
3277  const SetSpeedMessage *m5 = dynamic_cast<const SetSpeedMessage *>(message);
3278  if ( m5 != NULL ) {
3279  return true;
3280  }
3281  const SetEnabledMessage *m6 = dynamic_cast<const SetEnabledMessage *>(message);
3282  if ( m6 != NULL ) {
3283  return true;
3284  }
3285  const SetVelocityMessage *m7 = dynamic_cast<const SetVelocityMessage *>(message);
3286  if ( m7 != NULL ) {
3287  return true;
3288  }
3289  const SetMarginMessage *m8 = dynamic_cast<const SetMarginMessage *>(message);
3290  if ( m8 != NULL ) {
3291  return true;
3292  }
3293  const SetComplianceValuesMessage *m9 = dynamic_cast<const SetComplianceValuesMessage *>(message);
3294  if ( m9 != NULL ) {
3295  return true;
3296  }
3297  const SetGoalSpeedMessage *m10 = dynamic_cast<const SetGoalSpeedMessage *>(message);
3298  if ( m10 != NULL ) {
3299  return true;
3300  }
3301  const SetTorqueLimitMessage *m11 = dynamic_cast<const SetTorqueLimitMessage *>(message);
3302  if ( m11 != NULL ) {
3303  return true;
3304  }
3305  const SetPunchMessage *m12 = dynamic_cast<const SetPunchMessage *>(message);
3306  if ( m12 != NULL ) {
3307  return true;
3308  }
3309  const GotoPositionMessage *m13 = dynamic_cast<const GotoPositionMessage *>(message);
3310  if ( m13 != NULL ) {
3311  return true;
3312  }
3313  const SetAngleLimitsMessage *m14 = dynamic_cast<const SetAngleLimitsMessage *>(message);
3314  if ( m14 != NULL ) {
3315  return true;
3316  }
3317  const ResetRawErrorMessage *m15 = dynamic_cast<const ResetRawErrorMessage *>(message);
3318  if ( m15 != NULL ) {
3319  return true;
3320  }
3321  const SetPreventAlarmShutdownMessage *m16 = dynamic_cast<const SetPreventAlarmShutdownMessage *>(message);
3322  if ( m16 != NULL ) {
3323  return true;
3324  }
3325  const SetAutorecoverEnabledMessage *m17 = dynamic_cast<const SetAutorecoverEnabledMessage *>(message);
3326  if ( m17 != NULL ) {
3327  return true;
3328  }
3329  const RecoverMessage *m18 = dynamic_cast<const RecoverMessage *>(message);
3330  if ( m18 != NULL ) {
3331  return true;
3332  }
3333  return false;
3334 }
3335 
3336 /// @cond INTERNALS
3337 EXPORT_INTERFACE(DynamixelServoInterface)
3338 /// @endcond
3339 
3340 
3341 } // end namespace fawkes
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage
Definition: DynamixelServoInterface.h:588
fawkes::DynamixelServoInterface::SetTorqueLimitMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2604
fawkes::Interface::data_ptr
void * data_ptr
Definition: interface.h:224
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::set_cw_slope
void set_cw_slope(const uint8_t new_cw_slope)
Set cw_slope value.
Definition: DynamixelServoInterface.cpp:2359
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage
Definition: DynamixelServoInterface.h:615
fawkes::DynamixelServoInterface::SetSpeedMessage::maxlenof_speed
size_t maxlenof_speed() const
Get maximum length of speed value.
Definition: DynamixelServoInterface.cpp:1863
fawkes::DynamixelServoInterface::GotoMessage
Definition: DynamixelServoInterface.h:191
fawkes::DynamixelServoInterface::ERROR_ANGLE_OUTOFRANGE
@ ERROR_ANGLE_OUTOFRANGE
Desired angle is out of range.
Definition: DynamixelServoInterface.h:66
fawkes::IFT_UINT8
@ IFT_UINT8
8 bit unsigned integer field
Definition: types.h:53
fawkes::DynamixelServoInterface::SetMarginMessage::set_angle_margin
void set_angle_margin(const float new_angle_margin)
Set angle_margin value.
Definition: DynamixelServoInterface.cpp:2185
fawkes::DynamixelServoInterface::ERROR_COMMUNICATION
@ ERROR_COMMUNICATION
Communication with device failed.
Definition: DynamixelServoInterface.h:63
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::~SetAngleLimitsMessage
~SetAngleLimitsMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2860
fawkes::DynamixelServoInterface::SetEnabledMessage::is_enabled
bool is_enabled() const
Get enabled value.
Definition: DynamixelServoInterface.cpp:1955
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::cw_margin
uint8_t cw_margin() const
Get cw_margin value.
Definition: DynamixelServoInterface.cpp:2279
fawkes::DynamixelServoInterface::SetMarginMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2196
fawkes::DynamixelServoInterface::TimedGotoMessage::~TimedGotoMessage
~TimedGotoMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1594
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::set_ccw_margin
void set_ccw_margin(const uint8_t new_ccw_margin)
Set ccw_margin value.
Definition: DynamixelServoInterface.cpp:2329
fawkes::DynamixelServoInterface::GotoPositionMessage::set_position
void set_position(const uint32_t new_position)
Set position value.
Definition: DynamixelServoInterface.cpp:2797
fawkes::DynamixelServoInterface::SetVelocityMessage::velocity
float velocity() const
Get velocity value.
Definition: DynamixelServoInterface.cpp:2057
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:3200
fawkes::DynamixelServoInterface::FlushMessage::~FlushMessage
~FlushMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1416
fawkes::DynamixelServoInterface::ERROR_NONE
@ ERROR_NONE
No error occured.
Definition: DynamixelServoInterface.h:61
fawkes::Message
Definition: message.h:41
fawkes::DynamixelServoInterface::SetModeMessage::maxlenof_mode
size_t maxlenof_mode() const
Get maximum length of mode value.
Definition: DynamixelServoInterface.cpp:1761
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage::is_autorecover_enabled
bool is_autorecover_enabled() const
Get autorecover_enabled value.
Definition: DynamixelServoInterface.cpp:3169
fawkes::DynamixelServoInterface::StopMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1388
fawkes::DynamixelServoInterface::SetVelocityMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2088
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::set_angle_limit_cw
void set_angle_limit_cw(const uint32_t new_angle_limit_cw)
Set angle_limit_cw value.
Definition: DynamixelServoInterface.cpp:2903
fawkes::DynamixelServoInterface::GotoPositionMessage::maxlenof_position
size_t maxlenof_position() const
Get maximum length of position value.
Definition: DynamixelServoInterface.cpp:2787
fawkes::Message::data_ptr
void * data_ptr
Definition: message.h:125
fawkes::DynamixelServoInterface::SetVelocityMessage::~SetVelocityMessage
~SetVelocityMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2034
fawkes::IFT_BOOL
@ IFT_BOOL
boolean field
Definition: types.h:51
fawkes::DynamixelServoInterface::FlushMessage
Definition: DynamixelServoInterface.h:169
fawkes::DynamixelServoInterface::SetGoalSpeedMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2502
fawkes::DynamixelServoInterface::SetComplianceValuesMessage
Definition: DynamixelServoInterface.h:388
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2400
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::SetComplianceValuesMessage
SetComplianceValuesMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2236
fawkes::DynamixelServoInterface::SetMarginMessage::SetMarginMessage
SetMarginMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2119
fawkes::IFT_FLOAT
@ IFT_FLOAT
float field
Definition: types.h:60
fawkes::Message::data_ts
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:135
fawkes::IFT_UINT16
@ IFT_UINT16
16 bit unsigned integer field
Definition: types.h:55
fawkes::IFT_UINT32
@ IFT_UINT32
32 bit unsigned integer field
Definition: types.h:57
fawkes::DynamixelServoInterface::TimedGotoMessage::set_time_sec
void set_time_sec(const float new_time_sec)
Set time_sec value.
Definition: DynamixelServoInterface.cpp:1639
fawkes::DynamixelServoInterface::RecoverMessage::RecoverMessage
RecoverMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:3212
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage::set_enable_prevent_alarm_shutdown
void set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown)
Set enable_prevent_alarm_shutdown value.
Definition: DynamixelServoInterface.cpp:3087
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2944
fawkes::DynamixelServoInterface::SetPunchMessage
Definition: DynamixelServoInterface.h:481
fawkes::DynamixelServoInterface::SetPunchMessage::punch
uint32_t punch() const
Get punch value.
Definition: DynamixelServoInterface.cpp:2675
fawkes::DynamixelServoInterface::ERROR_UNSPECIFIC
@ ERROR_UNSPECIFIC
Some unspecified error occured.
Definition: DynamixelServoInterface.h:62
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::set_ccw_slope
void set_ccw_slope(const uint8_t new_ccw_slope)
Set ccw_slope value.
Definition: DynamixelServoInterface.cpp:2389
fawkes::DynamixelServoInterface::SetPunchMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2706
fawkes::DynamixelServoInterface::SetModeMessage::set_mode
void set_mode(const uint8_t new_mode)
Set mode value.
Definition: DynamixelServoInterface.cpp:1771
fawkes::DynamixelServoInterface::SetMarginMessage
Definition: DynamixelServoInterface.h:358
fawkes::DynamixelServoInterface::SetEnabledMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1986
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::maxlenof_ccw_margin
size_t maxlenof_ccw_margin() const
Get maximum length of ccw_margin value.
Definition: DynamixelServoInterface.cpp:2319
fawkes::DynamixelServoInterface::JOINT
@ JOINT
Joint mode to move in a range of -2.616 to +2.616 rad.
Definition: DynamixelServoInterface.h:68
fawkes::Interface::data_ts
interface_data_ts_t * data_ts
Definition: interface.h:228
fawkes::DynamixelServoInterface::TimedGotoMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1680
fawkes::DynamixelServoInterface::StopMessage
Definition: DynamixelServoInterface.h:147
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:3098
fawkes::DynamixelServoInterface::SetPunchMessage::set_punch
void set_punch(const uint32_t new_punch)
Set punch value.
Definition: DynamixelServoInterface.cpp:2695
fawkes::DynamixelServoInterface::SetSpeedMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1884
fawkes::DynamixelServoInterface::StopMessage::StopMessage
StopMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1348
fawkes::DynamixelServoInterface::WHEEL
@ WHEEL
Wheel mode to use the servo in a continuously rotating mode.
Definition: DynamixelServoInterface.h:69
fawkes::DynamixelServoInterface::TimedGotoMessage::time_sec
float time_sec() const
Get time_sec value.
Definition: DynamixelServoInterface.cpp:1618
fawkes::DynamixelServoInterface::StopMessage::~StopMessage
~StopMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1364
fawkes::Message::message_data_ts_t
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:130
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::maxlenof_angle_limit_ccw
size_t maxlenof_angle_limit_ccw() const
Get maximum length of angle_limit_ccw value.
Definition: DynamixelServoInterface.cpp:2923
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::set_cw_margin
void set_cw_margin(const uint8_t new_cw_margin)
Set cw_margin value.
Definition: DynamixelServoInterface.cpp:2299
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::angle_limit_cw
uint32_t angle_limit_cw() const
Get angle_limit_cw value.
Definition: DynamixelServoInterface.cpp:2883
fawkes::DynamixelServoInterface::GotoPositionMessage
Definition: DynamixelServoInterface.h:508
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::cw_slope
uint8_t cw_slope() const
Get cw_slope value.
Definition: DynamixelServoInterface.cpp:2339
fawkes::DynamixelServoInterface::ResetRawErrorMessage
Definition: DynamixelServoInterface.h:566
fawkes::DynamixelServoInterface::GotoPositionMessage::position
uint32_t position() const
Get position value.
Definition: DynamixelServoInterface.cpp:2777
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::~SetComplianceValuesMessage
~SetComplianceValuesMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2256
fawkes::DynamixelServoInterface::GotoPositionMessage::~GotoPositionMessage
~GotoPositionMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2754
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::maxlenof_ccw_slope
size_t maxlenof_ccw_slope() const
Get maximum length of ccw_slope value.
Definition: DynamixelServoInterface.cpp:2379
fawkes::DynamixelServoInterface::SetMarginMessage::~SetMarginMessage
~SetMarginMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2136
fawkes::DynamixelServoInterface::SetModeMessage
Definition: DynamixelServoInterface.h:250
fawkes::DynamixelServoInterface::message_valid
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Definition: DynamixelServoInterface.cpp:3261
fawkes::DynamixelServoInterface::SetTorqueLimitMessage
Definition: DynamixelServoInterface.h:454
fawkes::DynamixelServoInterface::SetAngleLimitsMessage
Definition: DynamixelServoInterface.h:535
fawkes::DynamixelServoInterface::SetSpeedMessage::set_speed
void set_speed(const uint16_t new_speed)
Set speed value.
Definition: DynamixelServoInterface.cpp:1873
fawkes::UnknownTypeException
Definition: software.h:55
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::angle_limit_ccw
uint32_t angle_limit_ccw() const
Get angle_limit_ccw value.
Definition: DynamixelServoInterface.cpp:2913
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage::SetAutorecoverEnabledMessage
SetAutorecoverEnabledMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:3129
fawkes::DynamixelServoInterface::SetModeMessage::mode
uint8_t mode() const
Get mode value.
Definition: DynamixelServoInterface.cpp:1751
fawkes::DynamixelServoInterface::SetEnabledMessage
Definition: DynamixelServoInterface.h:304
fawkes::DynamixelServoInterface::SetPunchMessage::~SetPunchMessage
~SetPunchMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2652
fawkes::DynamixelServoInterface::SetPunchMessage::maxlenof_punch
size_t maxlenof_punch() const
Get maximum length of punch value.
Definition: DynamixelServoInterface.cpp:2685
fawkes
fawkes::DynamixelServoInterface::SetTorqueLimitMessage::set_torque_limit
void set_torque_limit(const uint32_t new_torque_limit)
Set torque_limit value.
Definition: DynamixelServoInterface.cpp:2593
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage::set_autorecover_enabled
void set_autorecover_enabled(const bool new_autorecover_enabled)
Set autorecover_enabled value.
Definition: DynamixelServoInterface.cpp:3189
fawkes::DynamixelServoInterface::SetGoalSpeedMessage::~SetGoalSpeedMessage
~SetGoalSpeedMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2448
fawkes::Message::data_size
unsigned int data_size
Definition: message.h:126
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::ccw_margin
uint8_t ccw_margin() const
Get ccw_margin value.
Definition: DynamixelServoInterface.cpp:2309
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage::~SetPreventAlarmShutdownMessage
~SetPreventAlarmShutdownMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:3044
fawkes::DynamixelServoInterface::SetGoalSpeedMessage
Definition: DynamixelServoInterface.h:427
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::maxlenof_angle_limit_cw
size_t maxlenof_angle_limit_cw() const
Get maximum length of angle_limit_cw value.
Definition: DynamixelServoInterface.cpp:2893
fawkes::DynamixelServoInterface::SetEnabledMessage::maxlenof_enabled
size_t maxlenof_enabled() const
Get maximum length of enabled value.
Definition: DynamixelServoInterface.cpp:1965
fawkes::DynamixelServoInterface::TimedGotoMessage::TimedGotoMessage
TimedGotoMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1576
fawkes::DynamixelServoInterface::SetPunchMessage::SetPunchMessage
SetPunchMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2635
fawkes::DynamixelServoInterface::SetVelocityMessage
Definition: DynamixelServoInterface.h:331
fawkes::DynamixelServoInterface::SetSpeedMessage::SetSpeedMessage
SetSpeedMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1813
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage::maxlenof_enable_prevent_alarm_shutdown
size_t maxlenof_enable_prevent_alarm_shutdown() const
Get maximum length of enable_prevent_alarm_shutdown value.
Definition: DynamixelServoInterface.cpp:3077
fawkes::DynamixelServoInterface::RecoverMessage::~RecoverMessage
~RecoverMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:3228
fawkes::DynamixelServoInterface::SetGoalSpeedMessage::goal_speed
uint32_t goal_speed() const
Get goal_speed value.
Definition: DynamixelServoInterface.cpp:2471
fawkes::DynamixelServoInterface::SetEnabledMessage::SetEnabledMessage
SetEnabledMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1915
fawkes::DynamixelServoInterface::FlushMessage::FlushMessage
FlushMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1400
fawkes::DynamixelServoInterface::SetModeMessage::~SetModeMessage
~SetModeMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1728
fawkes::DynamixelServoInterface::SetModeMessage::SetModeMessage
SetModeMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1711
fawkes::DynamixelServoInterface::SetVelocityMessage::SetVelocityMessage
SetVelocityMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2017
fawkes::DynamixelServoInterface::GotoMessage::~GotoMessage
~GotoMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1488
fawkes::DynamixelServoInterface::SetSpeedMessage
Definition: DynamixelServoInterface.h:277
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::set_angle_limit_ccw
void set_angle_limit_ccw(const uint32_t new_angle_limit_ccw)
Set angle_limit_ccw value.
Definition: DynamixelServoInterface.cpp:2933
fawkes::DynamixelServoInterface::SetTorqueLimitMessage::~SetTorqueLimitMessage
~SetTorqueLimitMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2550
fawkes::DynamixelServoInterface::TimedGotoMessage::maxlenof_angle
size_t maxlenof_angle() const
Get maximum length of angle value.
Definition: DynamixelServoInterface.cpp:1659
fawkes::DynamixelServoInterface::GotoPositionMessage::GotoPositionMessage
GotoPositionMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2737
fawkes::DynamixelServoInterface::SetVelocityMessage::set_velocity
void set_velocity(const float new_velocity)
Set velocity value.
Definition: DynamixelServoInterface.cpp:2077
fawkes::DynamixelServoInterface::SetTorqueLimitMessage::torque_limit
uint32_t torque_limit() const
Get torque_limit value.
Definition: DynamixelServoInterface.cpp:2573
fawkes::DynamixelServoInterface::TimedGotoMessage
Definition: DynamixelServoInterface.h:218
fawkes::Message::add_fieldinfo
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
Definition: message.cpp:406
fawkes::DynamixelServoInterface::GotoMessage::maxlenof_angle
size_t maxlenof_angle() const
Get maximum length of angle value.
Definition: DynamixelServoInterface.cpp:1521
fawkes::DynamixelServoInterface::FlushMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1440
fawkes::DynamixelServoInterface::GotoMessage::GotoMessage
GotoMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:1471
fawkes::DynamixelServoInterface::RecoverMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:3252
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage::SetPreventAlarmShutdownMessage
SetPreventAlarmShutdownMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:3027
fawkes::Interface::data_size
unsigned int data_size
Definition: interface.h:225
fawkes::DynamixelServoInterface::WorkingMode
WorkingMode
Mode to be set for the servo.
Definition: DynamixelServoInterface.h:67
fawkes::DynamixelServoInterface::ErrorCode
ErrorCode
Error code to explain an error.
Definition: DynamixelServoInterface.h:54
fawkes::DynamixelServoInterface::SetAngleLimitsMessage::SetAngleLimitsMessage
SetAngleLimitsMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2842
fawkes::DynamixelServoInterface::SetPreventAlarmShutdownMessage::is_enable_prevent_alarm_shutdown
bool is_enable_prevent_alarm_shutdown() const
Get enable_prevent_alarm_shutdown value.
Definition: DynamixelServoInterface.cpp:3067
fawkes::DynamixelServoInterface::ResetRawErrorMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2996
fawkes::DynamixelServoInterface::SetModeMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1782
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::maxlenof_cw_slope
size_t maxlenof_cw_slope() const
Get maximum length of cw_slope value.
Definition: DynamixelServoInterface.cpp:2349
fawkes::DynamixelServoInterface::SetGoalSpeedMessage::maxlenof_goal_speed
size_t maxlenof_goal_speed() const
Get maximum length of goal_speed value.
Definition: DynamixelServoInterface.cpp:2481
fawkes::DynamixelServoInterface::SetMarginMessage::angle_margin
float angle_margin() const
Get angle_margin value.
Definition: DynamixelServoInterface.cpp:2162
fawkes::DynamixelServoInterface::SetGoalSpeedMessage::SetGoalSpeedMessage
SetGoalSpeedMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2431
fawkes::DynamixelServoInterface::GotoPositionMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:2808
fawkes::DynamixelServoInterface::SetTorqueLimitMessage::SetTorqueLimitMessage
SetTorqueLimitMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2533
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage::~SetAutorecoverEnabledMessage
~SetAutorecoverEnabledMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:3146
fawkes::DynamixelServoInterface::ResetRawErrorMessage::ResetRawErrorMessage
ResetRawErrorMessage()
Constructor.
Definition: DynamixelServoInterface.cpp:2956
fawkes::DynamixelServoInterface::GotoMessage::angle
float angle() const
Get angle value.
Definition: DynamixelServoInterface.cpp:1511
fawkes::DynamixelServoInterface::TimedGotoMessage::set_angle
void set_angle(const float new_angle)
Set angle value.
Definition: DynamixelServoInterface.cpp:1669
fawkes::DynamixelServoInterface::SetTorqueLimitMessage::maxlenof_torque_limit
size_t maxlenof_torque_limit() const
Get maximum length of torque_limit value.
Definition: DynamixelServoInterface.cpp:2583
fawkes::DynamixelServoInterface::GotoMessage::clone
virtual Message * clone() const
Clone this message.
Definition: DynamixelServoInterface.cpp:1542
fawkes::DynamixelServoInterface::SetMarginMessage::maxlenof_angle_margin
size_t maxlenof_angle_margin() const
Get maximum length of angle_margin value.
Definition: DynamixelServoInterface.cpp:2172
fawkes::DynamixelServoInterface::SetSpeedMessage::speed
uint16_t speed() const
Get speed value.
Definition: DynamixelServoInterface.cpp:1853
fawkes::DynamixelServoInterface::GotoMessage::set_angle
void set_angle(const float new_angle)
Set angle value.
Definition: DynamixelServoInterface.cpp:1531
fawkes::DynamixelServoInterface::ResetRawErrorMessage::~ResetRawErrorMessage
~ResetRawErrorMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:2972
fawkes::DynamixelServoInterface::SetVelocityMessage::maxlenof_velocity
size_t maxlenof_velocity() const
Get maximum length of velocity value.
Definition: DynamixelServoInterface.cpp:2067
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::ccw_slope
uint8_t ccw_slope() const
Get ccw_slope value.
Definition: DynamixelServoInterface.cpp:2369
fawkes::DynamixelServoInterface::SetEnabledMessage::set_enabled
void set_enabled(const bool new_enabled)
Set enabled value.
Definition: DynamixelServoInterface.cpp:1975
fawkes::DynamixelServoInterface::SetAutorecoverEnabledMessage::maxlenof_autorecover_enabled
size_t maxlenof_autorecover_enabled() const
Get maximum length of autorecover_enabled value.
Definition: DynamixelServoInterface.cpp:3179
fawkes::DynamixelServoInterface::SetSpeedMessage::~SetSpeedMessage
~SetSpeedMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1830
fawkes::DynamixelServoInterface::RecoverMessage
Definition: DynamixelServoInterface.h:642
fawkes::DynamixelServoInterface::SetGoalSpeedMessage::set_goal_speed
void set_goal_speed(const uint32_t new_goal_speed)
Set goal_speed value.
Definition: DynamixelServoInterface.cpp:2491
fawkes::DynamixelServoInterface::SetEnabledMessage::~SetEnabledMessage
~SetEnabledMessage()
Destructor.
Definition: DynamixelServoInterface.cpp:1932
fawkes::DynamixelServoInterface::TimedGotoMessage::angle
float angle() const
Get angle value.
Definition: DynamixelServoInterface.cpp:1649
fawkes::DynamixelServoInterface::SetComplianceValuesMessage::maxlenof_cw_margin
size_t maxlenof_cw_margin() const
Get maximum length of cw_margin value.
Definition: DynamixelServoInterface.cpp:2289
fawkes::DynamixelServoInterface::TimedGotoMessage::maxlenof_time_sec
size_t maxlenof_time_sec() const
Get maximum length of time_sec value.
Definition: DynamixelServoInterface.cpp:1628