Fawkes API  Fawkes Development Version
MotorInterface.cpp
1 
2 /***************************************************************************
3  * MotorInterface.cpp - Fawkes BlackBoard Interface - MotorInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2007 Martin Liebenberg, Tim Niemueller
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/MotorInterface.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 MotorInterface <interfaces/MotorInterface.h>
36  * MotorInterface Fawkes BlackBoard Interface.
37  * This interface is currently prepared best for a holonomic robot.
38  It will need modifications or a split to support differential drives.
39 
40  * @ingroup FawkesInterfaces
41  */
42 
43 
44 /** MOTOR_ENABLED constant */
45 const uint32_t MotorInterface::MOTOR_ENABLED = 0u;
46 /** MOTOR_DISABLED constant */
47 const uint32_t MotorInterface::MOTOR_DISABLED = 1u;
48 /** DRIVE_MODE_RPM constant */
49 const uint32_t MotorInterface::DRIVE_MODE_RPM = 1u;
50 /** DRIVE_MODE_TRANS constant */
51 const uint32_t MotorInterface::DRIVE_MODE_TRANS = 2u;
52 /** DRIVE_MODE_ROT constant */
53 const uint32_t MotorInterface::DRIVE_MODE_ROT = 3u;
54 /** DRIVE_MODE_TRANS_ROT constant */
55 const uint32_t MotorInterface::DRIVE_MODE_TRANS_ROT = 4u;
56 /** DRIVE_MODE_ORBIT constant */
57 const uint32_t MotorInterface::DRIVE_MODE_ORBIT = 5u;
58 /** DRIVE_MODE_LINE_TRANS_ROT constant */
60 
61 /** Constructor */
62 MotorInterface::MotorInterface() : Interface()
63 {
64  data_size = sizeof(MotorInterface_data_t);
65  data_ptr = malloc(data_size);
66  data = (MotorInterface_data_t *)data_ptr;
67  data_ts = (interface_data_ts_t *)data_ptr;
68  memset(data_ptr, 0, data_size);
69  add_fieldinfo(IFT_UINT32, "motor_state", 1, &data->motor_state);
70  add_fieldinfo(IFT_UINT32, "drive_mode", 1, &data->drive_mode);
71  add_fieldinfo(IFT_INT32, "right_rpm", 1, &data->right_rpm);
72  add_fieldinfo(IFT_INT32, "rear_rpm", 1, &data->rear_rpm);
73  add_fieldinfo(IFT_INT32, "left_rpm", 1, &data->left_rpm);
74  add_fieldinfo(IFT_FLOAT, "odometry_path_length", 1, &data->odometry_path_length);
75  add_fieldinfo(IFT_FLOAT, "odometry_position_x", 1, &data->odometry_position_x);
76  add_fieldinfo(IFT_FLOAT, "odometry_position_y", 1, &data->odometry_position_y);
77  add_fieldinfo(IFT_FLOAT, "odometry_orientation", 1, &data->odometry_orientation);
78  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
79  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
80  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
81  add_fieldinfo(IFT_FLOAT, "des_vx", 1, &data->des_vx);
82  add_fieldinfo(IFT_FLOAT, "des_vy", 1, &data->des_vy);
83  add_fieldinfo(IFT_FLOAT, "des_omega", 1, &data->des_omega);
84  add_fieldinfo(IFT_UINT32, "controller", 1, &data->controller);
85  add_fieldinfo(IFT_STRING, "controller_thread_name", 64, data->controller_thread_name);
86  add_messageinfo("SetMotorStateMessage");
87  add_messageinfo("AcquireControlMessage");
88  add_messageinfo("ResetOdometryMessage");
89  add_messageinfo("SetOdometryMessage");
90  add_messageinfo("DriveRPMMessage");
91  add_messageinfo("GotoMessage");
92  add_messageinfo("TransMessage");
93  add_messageinfo("RotMessage");
94  add_messageinfo("TransRotMessage");
95  add_messageinfo("OrbitMessage");
96  add_messageinfo("LinTransRotMessage");
97  unsigned char tmp_hash[] = {0x62, 0x6c, 0x3f, 0x33, 0x1c, 0x3a, 0x9e, 0x18, 0xd5, 0xee, 0xab, 0x30, 0xfb, 0x10, 0xf0, 0x79};
98  set_hash(tmp_hash);
99 }
100 
101 /** Destructor */
102 MotorInterface::~MotorInterface()
103 {
104  free(data_ptr);
105 }
106 /* Methods */
107 /** Get motor_state value.
108  *
109  The current state of the motor.
110 
111  * @return motor_state value
112  */
113 uint32_t
115 {
116  return data->motor_state;
117 }
118 
119 /** Get maximum length of motor_state value.
120  * @return length of motor_state value, can be length of the array or number of
121  * maximum number of characters for a string
122  */
123 size_t
125 {
126  return 1;
127 }
128 
129 /** Set motor_state value.
130  *
131  The current state of the motor.
132 
133  * @param new_motor_state new motor_state value
134  */
135 void
136 MotorInterface::set_motor_state(const uint32_t new_motor_state)
137 {
138  data->motor_state = new_motor_state;
139  data_changed = true;
140 }
141 
142 /** Get drive_mode value.
143  *
144  The current drive mode of the motor.
145 
146  * @return drive_mode value
147  */
148 uint32_t
150 {
151  return data->drive_mode;
152 }
153 
154 /** Get maximum length of drive_mode value.
155  * @return length of drive_mode value, can be length of the array or number of
156  * maximum number of characters for a string
157  */
158 size_t
160 {
161  return 1;
162 }
163 
164 /** Set drive_mode value.
165  *
166  The current drive mode of the motor.
167 
168  * @param new_drive_mode new drive_mode value
169  */
170 void
171 MotorInterface::set_drive_mode(const uint32_t new_drive_mode)
172 {
173  data->drive_mode = new_drive_mode;
174  data_changed = true;
175 }
176 
177 /** Get right_rpm value.
178  *
179  RPM of the motor on the right front of the robot.
180 
181  * @return right_rpm value
182  */
183 int32_t
185 {
186  return data->right_rpm;
187 }
188 
189 /** Get maximum length of right_rpm value.
190  * @return length of right_rpm value, can be length of the array or number of
191  * maximum number of characters for a string
192  */
193 size_t
195 {
196  return 1;
197 }
198 
199 /** Set right_rpm value.
200  *
201  RPM of the motor on the right front of the robot.
202 
203  * @param new_right_rpm new right_rpm value
204  */
205 void
206 MotorInterface::set_right_rpm(const int32_t new_right_rpm)
207 {
208  data->right_rpm = new_right_rpm;
209  data_changed = true;
210 }
211 
212 /** Get rear_rpm value.
213  *
214  RPM of motor on the rear of the robot.
215 
216  * @return rear_rpm value
217  */
218 int32_t
220 {
221  return data->rear_rpm;
222 }
223 
224 /** Get maximum length of rear_rpm value.
225  * @return length of rear_rpm value, can be length of the array or number of
226  * maximum number of characters for a string
227  */
228 size_t
230 {
231  return 1;
232 }
233 
234 /** Set rear_rpm value.
235  *
236  RPM of motor on the rear of the robot.
237 
238  * @param new_rear_rpm new rear_rpm value
239  */
240 void
241 MotorInterface::set_rear_rpm(const int32_t new_rear_rpm)
242 {
243  data->rear_rpm = new_rear_rpm;
244  data_changed = true;
245 }
246 
247 /** Get left_rpm value.
248  *
249  RPM of the motor on the left front of the robot.
250 
251  * @return left_rpm value
252  */
253 int32_t
255 {
256  return data->left_rpm;
257 }
258 
259 /** Get maximum length of left_rpm value.
260  * @return length of left_rpm value, can be length of the array or number of
261  * maximum number of characters for a string
262  */
263 size_t
265 {
266  return 1;
267 }
268 
269 /** Set left_rpm value.
270  *
271  RPM of the motor on the left front of the robot.
272 
273  * @param new_left_rpm new left_rpm value
274  */
275 void
276 MotorInterface::set_left_rpm(const int32_t new_left_rpm)
277 {
278  data->left_rpm = new_left_rpm;
279  data_changed = true;
280 }
281 
282 /** Get odometry_path_length value.
283  *
284  The actual length of the robot's trajectory since the last ResetOdometry.
285 
286  * @return odometry_path_length value
287  */
288 float
290 {
291  return data->odometry_path_length;
292 }
293 
294 /** Get maximum length of odometry_path_length value.
295  * @return length of odometry_path_length value, can be length of the array or number of
296  * maximum number of characters for a string
297  */
298 size_t
300 {
301  return 1;
302 }
303 
304 /** Set odometry_path_length value.
305  *
306  The actual length of the robot's trajectory since the last ResetOdometry.
307 
308  * @param new_odometry_path_length new odometry_path_length value
309  */
310 void
311 MotorInterface::set_odometry_path_length(const float new_odometry_path_length)
312 {
313  data->odometry_path_length = new_odometry_path_length;
314  data_changed = true;
315 }
316 
317 /** Get odometry_position_x value.
318  *
319  The actual position of the robot relative to the position at the last ResetOdometry.
320 
321  * @return odometry_position_x value
322  */
323 float
325 {
326  return data->odometry_position_x;
327 }
328 
329 /** Get maximum length of odometry_position_x value.
330  * @return length of odometry_position_x value, can be length of the array or number of
331  * maximum number of characters for a string
332  */
333 size_t
335 {
336  return 1;
337 }
338 
339 /** Set odometry_position_x value.
340  *
341  The actual position of the robot relative to the position at the last ResetOdometry.
342 
343  * @param new_odometry_position_x new odometry_position_x value
344  */
345 void
346 MotorInterface::set_odometry_position_x(const float new_odometry_position_x)
347 {
348  data->odometry_position_x = new_odometry_position_x;
349  data_changed = true;
350 }
351 
352 /** Get odometry_position_y value.
353  *
354  The actual position of the robot relative to the position at the last ResetOdometry.
355 
356  * @return odometry_position_y value
357  */
358 float
360 {
361  return data->odometry_position_y;
362 }
363 
364 /** Get maximum length of odometry_position_y value.
365  * @return length of odometry_position_y value, can be length of the array or number of
366  * maximum number of characters for a string
367  */
368 size_t
370 {
371  return 1;
372 }
373 
374 /** Set odometry_position_y value.
375  *
376  The actual position of the robot relative to the position at the last ResetOdometry.
377 
378  * @param new_odometry_position_y new odometry_position_y value
379  */
380 void
381 MotorInterface::set_odometry_position_y(const float new_odometry_position_y)
382 {
383  data->odometry_position_y = new_odometry_position_y;
384  data_changed = true;
385 }
386 
387 /** Get odometry_orientation value.
388  *
389  The actual orientation of the robot relative to the orientation at the last ResetOdometry.
390 
391  * @return odometry_orientation value
392  */
393 float
395 {
396  return data->odometry_orientation;
397 }
398 
399 /** Get maximum length of odometry_orientation value.
400  * @return length of odometry_orientation value, can be length of the array or number of
401  * maximum number of characters for a string
402  */
403 size_t
405 {
406  return 1;
407 }
408 
409 /** Set odometry_orientation value.
410  *
411  The actual orientation of the robot relative to the orientation at the last ResetOdometry.
412 
413  * @param new_odometry_orientation new odometry_orientation value
414  */
415 void
416 MotorInterface::set_odometry_orientation(const float new_odometry_orientation)
417 {
418  data->odometry_orientation = new_odometry_orientation;
419  data_changed = true;
420 }
421 
422 /** Get vx value.
423  *
424  VX of the robot in m/s. Forward.
425 
426  * @return vx value
427  */
428 float
429 MotorInterface::vx() const
430 {
431  return data->vx;
432 }
433 
434 /** Get maximum length of vx value.
435  * @return length of vx value, can be length of the array or number of
436  * maximum number of characters for a string
437  */
438 size_t
440 {
441  return 1;
442 }
443 
444 /** Set vx value.
445  *
446  VX of the robot in m/s. Forward.
447 
448  * @param new_vx new vx value
449  */
450 void
451 MotorInterface::set_vx(const float new_vx)
452 {
453  data->vx = new_vx;
454  data_changed = true;
455 }
456 
457 /** Get vy value.
458  *
459  VY of the robot in m/s. Left.
460 
461  * @return vy value
462  */
463 float
464 MotorInterface::vy() const
465 {
466  return data->vy;
467 }
468 
469 /** Get maximum length of vy value.
470  * @return length of vy value, can be length of the array or number of
471  * maximum number of characters for a string
472  */
473 size_t
475 {
476  return 1;
477 }
478 
479 /** Set vy value.
480  *
481  VY of the robot in m/s. Left.
482 
483  * @param new_vy new vy value
484  */
485 void
486 MotorInterface::set_vy(const float new_vy)
487 {
488  data->vy = new_vy;
489  data_changed = true;
490 }
491 
492 /** Get omega value.
493  *
494  Rotation speed of the robot in rad/s.
495 
496  * @return omega value
497  */
498 float
499 MotorInterface::omega() const
500 {
501  return data->omega;
502 }
503 
504 /** Get maximum length of omega value.
505  * @return length of omega value, can be length of the array or number of
506  * maximum number of characters for a string
507  */
508 size_t
510 {
511  return 1;
512 }
513 
514 /** Set omega value.
515  *
516  Rotation speed of the robot in rad/s.
517 
518  * @param new_omega new omega value
519  */
520 void
521 MotorInterface::set_omega(const float new_omega)
522 {
523  data->omega = new_omega;
524  data_changed = true;
525 }
526 
527 /** Get des_vx value.
528  *
529  Desired VX of the robot in m/s. Forward.
530 
531  * @return des_vx value
532  */
533 float
535 {
536  return data->des_vx;
537 }
538 
539 /** Get maximum length of des_vx value.
540  * @return length of des_vx value, can be length of the array or number of
541  * maximum number of characters for a string
542  */
543 size_t
545 {
546  return 1;
547 }
548 
549 /** Set des_vx value.
550  *
551  Desired VX of the robot in m/s. Forward.
552 
553  * @param new_des_vx new des_vx value
554  */
555 void
556 MotorInterface::set_des_vx(const float new_des_vx)
557 {
558  data->des_vx = new_des_vx;
559  data_changed = true;
560 }
561 
562 /** Get des_vy value.
563  *
564  Desired VY of the robot in m/s. Left.
565 
566  * @return des_vy value
567  */
568 float
570 {
571  return data->des_vy;
572 }
573 
574 /** Get maximum length of des_vy value.
575  * @return length of des_vy value, can be length of the array or number of
576  * maximum number of characters for a string
577  */
578 size_t
580 {
581  return 1;
582 }
583 
584 /** Set des_vy value.
585  *
586  Desired VY of the robot in m/s. Left.
587 
588  * @param new_des_vy new des_vy value
589  */
590 void
591 MotorInterface::set_des_vy(const float new_des_vy)
592 {
593  data->des_vy = new_des_vy;
594  data_changed = true;
595 }
596 
597 /** Get des_omega value.
598  *
599  Desired Rotation speed of the robot in rad/s.
600 
601  * @return des_omega value
602  */
603 float
605 {
606  return data->des_omega;
607 }
608 
609 /** Get maximum length of des_omega value.
610  * @return length of des_omega value, can be length of the array or number of
611  * maximum number of characters for a string
612  */
613 size_t
615 {
616  return 1;
617 }
618 
619 /** Set des_omega value.
620  *
621  Desired Rotation speed of the robot in rad/s.
622 
623  * @param new_des_omega new des_omega value
624  */
625 void
626 MotorInterface::set_des_omega(const float new_des_omega)
627 {
628  data->des_omega = new_des_omega;
629  data_changed = true;
630 }
631 
632 /** Get controller value.
633  *
634  The ID of the controller. The controller ID is the instance serial of the sending
635  interface. Only from this interface instance command messages are accepted.
636 
637  * @return controller value
638  */
639 uint32_t
641 {
642  return data->controller;
643 }
644 
645 /** Get maximum length of controller value.
646  * @return length of controller value, can be length of the array or number of
647  * maximum number of characters for a string
648  */
649 size_t
651 {
652  return 1;
653 }
654 
655 /** Set controller value.
656  *
657  The ID of the controller. The controller ID is the instance serial of the sending
658  interface. Only from this interface instance command messages are accepted.
659 
660  * @param new_controller new controller value
661  */
662 void
663 MotorInterface::set_controller(const uint32_t new_controller)
664 {
665  data->controller = new_controller;
666  data_changed = true;
667 }
668 
669 /** Get controller_thread_name value.
670  *
671  The name of the controlling thread, for easier debugging. This is informative only
672  and actually two threads may share an interface instance (although this should be
673  avoided since the interface locking has to be reproduced for these threads then).
674 
675  * @return controller_thread_name value
676  */
677 char *
679 {
680  return data->controller_thread_name;
681 }
682 
683 /** Get maximum length of controller_thread_name value.
684  * @return length of controller_thread_name value, can be length of the array or number of
685  * maximum number of characters for a string
686  */
687 size_t
689 {
690  return 64;
691 }
692 
693 /** Set controller_thread_name value.
694  *
695  The name of the controlling thread, for easier debugging. This is informative only
696  and actually two threads may share an interface instance (although this should be
697  avoided since the interface locking has to be reproduced for these threads then).
698 
699  * @param new_controller_thread_name new controller_thread_name value
700  */
701 void
702 MotorInterface::set_controller_thread_name(const char * new_controller_thread_name)
703 {
704  strncpy(data->controller_thread_name, new_controller_thread_name, sizeof(data->controller_thread_name)-1);
705  data->controller_thread_name[sizeof(data->controller_thread_name)-1] = 0;
706  data_changed = true;
707 }
708 
709 /* =========== message create =========== */
710 Message *
711 MotorInterface::create_message(const char *type) const
712 {
713  if ( strncmp("SetMotorStateMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
714  return new SetMotorStateMessage();
715  } else if ( strncmp("AcquireControlMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
716  return new AcquireControlMessage();
717  } else if ( strncmp("ResetOdometryMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
718  return new ResetOdometryMessage();
719  } else if ( strncmp("SetOdometryMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
720  return new SetOdometryMessage();
721  } else if ( strncmp("DriveRPMMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
722  return new DriveRPMMessage();
723  } else if ( strncmp("GotoMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
724  return new GotoMessage();
725  } else if ( strncmp("TransMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
726  return new TransMessage();
727  } else if ( strncmp("RotMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
728  return new RotMessage();
729  } else if ( strncmp("TransRotMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
730  return new TransRotMessage();
731  } else if ( strncmp("OrbitMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
732  return new OrbitMessage();
733  } else if ( strncmp("LinTransRotMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
734  return new LinTransRotMessage();
735  } else {
736  throw UnknownTypeException("The given type '%s' does not match any known "
737  "message type for this interface type.", type);
738  }
739 }
740 
741 
742 /** Copy values from other interface.
743  * @param other other interface to copy values from
744  */
745 void
747 {
748  const MotorInterface *oi = dynamic_cast<const MotorInterface *>(other);
749  if (oi == NULL) {
750  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
751  type(), other->type());
752  }
753  memcpy(data, oi->data, sizeof(MotorInterface_data_t));
754 }
755 
756 const char *
757 MotorInterface::enum_tostring(const char *enumtype, int val) const
758 {
759  throw UnknownTypeException("Unknown enum type %s", enumtype);
760 }
761 
762 /* =========== messages =========== */
763 /** @class MotorInterface::SetMotorStateMessage <interfaces/MotorInterface.h>
764  * SetMotorStateMessage Fawkes BlackBoard Interface Message.
765  *
766 
767  */
768 
769 
770 /** Constructor with initial values.
771  * @param ini_motor_state initial value for motor_state
772  */
773 MotorInterface::SetMotorStateMessage::SetMotorStateMessage(const uint32_t ini_motor_state) : Message("SetMotorStateMessage")
774 {
775  data_size = sizeof(SetMotorStateMessage_data_t);
776  data_ptr = malloc(data_size);
777  memset(data_ptr, 0, data_size);
778  data = (SetMotorStateMessage_data_t *)data_ptr;
780  data->motor_state = ini_motor_state;
781  add_fieldinfo(IFT_UINT32, "motor_state", 1, &data->motor_state);
782 }
783 /** Constructor */
785 {
786  data_size = sizeof(SetMotorStateMessage_data_t);
787  data_ptr = malloc(data_size);
788  memset(data_ptr, 0, data_size);
789  data = (SetMotorStateMessage_data_t *)data_ptr;
791  add_fieldinfo(IFT_UINT32, "motor_state", 1, &data->motor_state);
792 }
793 
794 /** Destructor */
796 {
797  free(data_ptr);
798 }
799 
800 /** Copy constructor.
801  * @param m message to copy from
802  */
804 {
805  data_size = m->data_size;
806  data_ptr = malloc(data_size);
808  data = (SetMotorStateMessage_data_t *)data_ptr;
810 }
811 
812 /* Methods */
813 /** Get motor_state value.
814  *
815  The new motor state to set. Use the MOTOR_* constants.
816 
817  * @return motor_state value
818  */
819 uint32_t
821 {
822  return data->motor_state;
823 }
824 
825 /** Get maximum length of motor_state value.
826  * @return length of motor_state value, can be length of the array or number of
827  * maximum number of characters for a string
828  */
829 size_t
831 {
832  return 1;
833 }
834 
835 /** Set motor_state value.
836  *
837  The new motor state to set. Use the MOTOR_* constants.
838 
839  * @param new_motor_state new motor_state value
840  */
841 void
842 MotorInterface::SetMotorStateMessage::set_motor_state(const uint32_t new_motor_state)
843 {
844  data->motor_state = new_motor_state;
845 }
846 
847 /** Clone this message.
848  * Produces a message of the same type as this message and copies the
849  * data to the new message.
850  * @return clone of this message
851  */
852 Message *
854 {
855  return new MotorInterface::SetMotorStateMessage(this);
856 }
857 /** @class MotorInterface::AcquireControlMessage <interfaces/MotorInterface.h>
858  * AcquireControlMessage Fawkes BlackBoard Interface Message.
859  *
860 
861  */
862 
863 
864 /** Constructor with initial values.
865  * @param ini_controller initial value for controller
866  * @param ini_controller_thread_name initial value for controller_thread_name
867  */
868 MotorInterface::AcquireControlMessage::AcquireControlMessage(const uint32_t ini_controller, const char * ini_controller_thread_name) : Message("AcquireControlMessage")
869 {
870  data_size = sizeof(AcquireControlMessage_data_t);
871  data_ptr = malloc(data_size);
872  memset(data_ptr, 0, data_size);
873  data = (AcquireControlMessage_data_t *)data_ptr;
875  data->controller = ini_controller;
876  strncpy(data->controller_thread_name, ini_controller_thread_name, 64-1);
877  data->controller_thread_name[64-1] = 0;
878  add_fieldinfo(IFT_UINT32, "controller", 1, &data->controller);
879  add_fieldinfo(IFT_STRING, "controller_thread_name", 64, data->controller_thread_name);
880 }
881 /** Constructor */
883 {
884  data_size = sizeof(AcquireControlMessage_data_t);
885  data_ptr = malloc(data_size);
886  memset(data_ptr, 0, data_size);
887  data = (AcquireControlMessage_data_t *)data_ptr;
889  add_fieldinfo(IFT_UINT32, "controller", 1, &data->controller);
890  add_fieldinfo(IFT_STRING, "controller_thread_name", 64, data->controller_thread_name);
891 }
892 
893 /** Destructor */
895 {
896  free(data_ptr);
897 }
898 
899 /** Copy constructor.
900  * @param m message to copy from
901  */
903 {
904  data_size = m->data_size;
905  data_ptr = malloc(data_size);
907  data = (AcquireControlMessage_data_t *)data_ptr;
909 }
910 
911 /* Methods */
912 /** Get controller value.
913  *
914  The ID of the controller. The controller ID is the instance serial of the sending
915  interface. Only from this interface instance command messages are accepted.
916 
917  * @return controller value
918  */
919 uint32_t
921 {
922  return data->controller;
923 }
924 
925 /** Get maximum length of controller value.
926  * @return length of controller value, can be length of the array or number of
927  * maximum number of characters for a string
928  */
929 size_t
931 {
932  return 1;
933 }
934 
935 /** Set controller value.
936  *
937  The ID of the controller. The controller ID is the instance serial of the sending
938  interface. Only from this interface instance command messages are accepted.
939 
940  * @param new_controller new controller value
941  */
942 void
943 MotorInterface::AcquireControlMessage::set_controller(const uint32_t new_controller)
944 {
945  data->controller = new_controller;
946 }
947 
948 /** Get controller_thread_name value.
949  *
950  The name of the controlling thread, for easier debugging. This is informative only
951  and actually two threads may share an interface instance (although this should be
952  avoided since the interface locking has to be reproduced for these threads then).
953 
954  * @return controller_thread_name value
955  */
956 char *
958 {
959  return data->controller_thread_name;
960 }
961 
962 /** Get maximum length of controller_thread_name value.
963  * @return length of controller_thread_name value, can be length of the array or number of
964  * maximum number of characters for a string
965  */
966 size_t
968 {
969  return 64;
970 }
971 
972 /** Set controller_thread_name value.
973  *
974  The name of the controlling thread, for easier debugging. This is informative only
975  and actually two threads may share an interface instance (although this should be
976  avoided since the interface locking has to be reproduced for these threads then).
977 
978  * @param new_controller_thread_name new controller_thread_name value
979  */
980 void
981 MotorInterface::AcquireControlMessage::set_controller_thread_name(const char * new_controller_thread_name)
982 {
983  strncpy(data->controller_thread_name, new_controller_thread_name, sizeof(data->controller_thread_name)-1);
984  data->controller_thread_name[sizeof(data->controller_thread_name)-1] = 0;
985 }
986 
987 /** Clone this message.
988  * Produces a message of the same type as this message and copies the
989  * data to the new message.
990  * @return clone of this message
991  */
992 Message *
994 {
995  return new MotorInterface::AcquireControlMessage(this);
996 }
997 /** @class MotorInterface::ResetOdometryMessage <interfaces/MotorInterface.h>
998  * ResetOdometryMessage Fawkes BlackBoard Interface Message.
999  *
1000 
1001  */
1002 
1003 
1004 /** Constructor */
1006 {
1007  data_size = sizeof(ResetOdometryMessage_data_t);
1008  data_ptr = malloc(data_size);
1009  memset(data_ptr, 0, data_size);
1010  data = (ResetOdometryMessage_data_t *)data_ptr;
1012 }
1013 
1014 /** Destructor */
1016 {
1017  free(data_ptr);
1018 }
1020 /** Copy constructor.
1021  * @param m message to copy from
1022  */
1024 {
1025  data_size = m->data_size;
1026  data_ptr = malloc(data_size);
1028  data = (ResetOdometryMessage_data_t *)data_ptr;
1030 }
1031 
1032 /* Methods */
1033 /** Clone this message.
1034  * Produces a message of the same type as this message and copies the
1035  * data to the new message.
1036  * @return clone of this message
1037  */
1038 Message *
1040 {
1041  return new MotorInterface::ResetOdometryMessage(this);
1042 }
1043 /** @class MotorInterface::SetOdometryMessage <interfaces/MotorInterface.h>
1044  * SetOdometryMessage Fawkes BlackBoard Interface Message.
1045  *
1046 
1047  */
1048 
1049 
1050 /** Constructor with initial values.
1051  * @param ini_x initial value for x
1052  * @param ini_y initial value for y
1053  * @param ini_odometry_orientation initial value for odometry_orientation
1054  */
1055 MotorInterface::SetOdometryMessage::SetOdometryMessage(const float ini_x, const float ini_y, const float ini_odometry_orientation) : Message("SetOdometryMessage")
1056 {
1057  data_size = sizeof(SetOdometryMessage_data_t);
1058  data_ptr = malloc(data_size);
1059  memset(data_ptr, 0, data_size);
1060  data = (SetOdometryMessage_data_t *)data_ptr;
1062  data->x = ini_x;
1063  data->y = ini_y;
1064  data->odometry_orientation = ini_odometry_orientation;
1065  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
1066  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
1067  add_fieldinfo(IFT_FLOAT, "odometry_orientation", 1, &data->odometry_orientation);
1068 }
1069 /** Constructor */
1071 {
1072  data_size = sizeof(SetOdometryMessage_data_t);
1073  data_ptr = malloc(data_size);
1074  memset(data_ptr, 0, data_size);
1075  data = (SetOdometryMessage_data_t *)data_ptr;
1077  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
1078  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
1079  add_fieldinfo(IFT_FLOAT, "odometry_orientation", 1, &data->odometry_orientation);
1080 }
1081 
1082 /** Destructor */
1084 {
1085  free(data_ptr);
1086 }
1088 /** Copy constructor.
1089  * @param m message to copy from
1090  */
1092 {
1093  data_size = m->data_size;
1094  data_ptr = malloc(data_size);
1096  data = (SetOdometryMessage_data_t *)data_ptr;
1098 }
1099 
1100 /* Methods */
1101 /** Get x value.
1102  * Translation in x direction in m
1103  * @return x value
1104  */
1105 float
1107 {
1108  return data->x;
1109 }
1111 /** Get maximum length of x value.
1112  * @return length of x value, can be length of the array or number of
1113  * maximum number of characters for a string
1114  */
1115 size_t
1117 {
1118  return 1;
1119 }
1121 /** Set x value.
1122  * Translation in x direction in m
1123  * @param new_x new x value
1124  */
1125 void
1127 {
1128  data->x = new_x;
1129 }
1131 /** Get y value.
1132  * Translation in y direction in m
1133  * @return y value
1134  */
1135 float
1137 {
1138  return data->y;
1139 }
1141 /** Get maximum length of y value.
1142  * @return length of y value, can be length of the array or number of
1143  * maximum number of characters for a string
1144  */
1145 size_t
1147 {
1148  return 1;
1149 }
1151 /** Set y value.
1152  * Translation in y direction in m
1153  * @param new_y new y value
1154  */
1155 void
1157 {
1158  data->y = new_y;
1159 }
1161 /** Get odometry_orientation value.
1162  * OdometryOrientation in m
1163  * @return odometry_orientation value
1164  */
1165 float
1167 {
1168  return data->odometry_orientation;
1169 }
1171 /** Get maximum length of odometry_orientation value.
1172  * @return length of odometry_orientation value, can be length of the array or number of
1173  * maximum number of characters for a string
1174  */
1175 size_t
1177 {
1178  return 1;
1179 }
1181 /** Set odometry_orientation value.
1182  * OdometryOrientation in m
1183  * @param new_odometry_orientation new odometry_orientation value
1184  */
1185 void
1186 MotorInterface::SetOdometryMessage::set_odometry_orientation(const float new_odometry_orientation)
1187 {
1188  data->odometry_orientation = new_odometry_orientation;
1189 }
1191 /** Clone this message.
1192  * Produces a message of the same type as this message and copies the
1193  * data to the new message.
1194  * @return clone of this message
1195  */
1196 Message *
1198 {
1199  return new MotorInterface::SetOdometryMessage(this);
1200 }
1201 /** @class MotorInterface::DriveRPMMessage <interfaces/MotorInterface.h>
1202  * DriveRPMMessage Fawkes BlackBoard Interface Message.
1203  *
1204 
1205  */
1206 
1207 
1208 /** Constructor with initial values.
1209  * @param ini_front_right initial value for front_right
1210  * @param ini_front_left initial value for front_left
1211  * @param ini_rear initial value for rear
1212  */
1213 MotorInterface::DriveRPMMessage::DriveRPMMessage(const float ini_front_right, const float ini_front_left, const float ini_rear) : Message("DriveRPMMessage")
1214 {
1215  data_size = sizeof(DriveRPMMessage_data_t);
1216  data_ptr = malloc(data_size);
1217  memset(data_ptr, 0, data_size);
1218  data = (DriveRPMMessage_data_t *)data_ptr;
1220  data->front_right = ini_front_right;
1221  data->front_left = ini_front_left;
1222  data->rear = ini_rear;
1223  add_fieldinfo(IFT_FLOAT, "front_right", 1, &data->front_right);
1224  add_fieldinfo(IFT_FLOAT, "front_left", 1, &data->front_left);
1225  add_fieldinfo(IFT_FLOAT, "rear", 1, &data->rear);
1226 }
1227 /** Constructor */
1229 {
1230  data_size = sizeof(DriveRPMMessage_data_t);
1231  data_ptr = malloc(data_size);
1232  memset(data_ptr, 0, data_size);
1233  data = (DriveRPMMessage_data_t *)data_ptr;
1235  add_fieldinfo(IFT_FLOAT, "front_right", 1, &data->front_right);
1236  add_fieldinfo(IFT_FLOAT, "front_left", 1, &data->front_left);
1237  add_fieldinfo(IFT_FLOAT, "rear", 1, &data->rear);
1238 }
1239 
1240 /** Destructor */
1242 {
1243  free(data_ptr);
1244 }
1246 /** Copy constructor.
1247  * @param m message to copy from
1248  */
1250 {
1251  data_size = m->data_size;
1252  data_ptr = malloc(data_size);
1254  data = (DriveRPMMessage_data_t *)data_ptr;
1256 }
1257 
1258 /* Methods */
1259 /** Get front_right value.
1260  * Rotation in RPM of the right front wheel.
1261  * @return front_right value
1262  */
1263 float
1265 {
1266  return data->front_right;
1267 }
1269 /** Get maximum length of front_right value.
1270  * @return length of front_right value, can be length of the array or number of
1271  * maximum number of characters for a string
1272  */
1273 size_t
1275 {
1276  return 1;
1277 }
1279 /** Set front_right value.
1280  * Rotation in RPM of the right front wheel.
1281  * @param new_front_right new front_right value
1282  */
1283 void
1284 MotorInterface::DriveRPMMessage::set_front_right(const float new_front_right)
1285 {
1286  data->front_right = new_front_right;
1287 }
1289 /** Get front_left value.
1290  * Rotation in RPM of the left front wheel.
1291  * @return front_left value
1292  */
1293 float
1295 {
1296  return data->front_left;
1297 }
1299 /** Get maximum length of front_left value.
1300  * @return length of front_left value, can be length of the array or number of
1301  * maximum number of characters for a string
1302  */
1303 size_t
1305 {
1306  return 1;
1307 }
1309 /** Set front_left value.
1310  * Rotation in RPM of the left front wheel.
1311  * @param new_front_left new front_left value
1312  */
1313 void
1314 MotorInterface::DriveRPMMessage::set_front_left(const float new_front_left)
1315 {
1316  data->front_left = new_front_left;
1317 }
1319 /** Get rear value.
1320  * Rotation in RPM of the rear wheel.
1321  * @return rear value
1322  */
1323 float
1325 {
1326  return data->rear;
1327 }
1329 /** Get maximum length of rear value.
1330  * @return length of rear value, can be length of the array or number of
1331  * maximum number of characters for a string
1332  */
1333 size_t
1335 {
1336  return 1;
1337 }
1339 /** Set rear value.
1340  * Rotation in RPM of the rear wheel.
1341  * @param new_rear new rear value
1342  */
1343 void
1344 MotorInterface::DriveRPMMessage::set_rear(const float new_rear)
1345 {
1346  data->rear = new_rear;
1347 }
1349 /** Clone this message.
1350  * Produces a message of the same type as this message and copies the
1351  * data to the new message.
1352  * @return clone of this message
1353  */
1354 Message *
1356 {
1357  return new MotorInterface::DriveRPMMessage(this);
1358 }
1359 /** @class MotorInterface::GotoMessage <interfaces/MotorInterface.h>
1360  * GotoMessage Fawkes BlackBoard Interface Message.
1361  *
1362 
1363  */
1364 
1365 
1366 /** Constructor with initial values.
1367  * @param ini_x initial value for x
1368  * @param ini_y initial value for y
1369  * @param ini_phi initial value for phi
1370  * @param ini_time_sec initial value for time_sec
1371  */
1372 MotorInterface::GotoMessage::GotoMessage(const float ini_x, const float ini_y, const float ini_phi, const float ini_time_sec) : Message("GotoMessage")
1373 {
1374  data_size = sizeof(GotoMessage_data_t);
1375  data_ptr = malloc(data_size);
1376  memset(data_ptr, 0, data_size);
1377  data = (GotoMessage_data_t *)data_ptr;
1379  data->x = ini_x;
1380  data->y = ini_y;
1381  data->phi = ini_phi;
1382  data->time_sec = ini_time_sec;
1383  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
1384  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
1385  add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi);
1386  add_fieldinfo(IFT_FLOAT, "time_sec", 1, &data->time_sec);
1387 }
1388 /** Constructor */
1390 {
1391  data_size = sizeof(GotoMessage_data_t);
1392  data_ptr = malloc(data_size);
1393  memset(data_ptr, 0, data_size);
1394  data = (GotoMessage_data_t *)data_ptr;
1396  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
1397  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
1398  add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi);
1399  add_fieldinfo(IFT_FLOAT, "time_sec", 1, &data->time_sec);
1400 }
1401 
1402 /** Destructor */
1404 {
1405  free(data_ptr);
1406 }
1408 /** Copy constructor.
1409  * @param m message to copy from
1410  */
1412 {
1413  data_size = m->data_size;
1414  data_ptr = malloc(data_size);
1416  data = (GotoMessage_data_t *)data_ptr;
1418 }
1419 
1420 /* Methods */
1421 /** Get x value.
1422  * X distance in m.
1423  * @return x value
1424  */
1425 float
1427 {
1428  return data->x;
1429 }
1431 /** Get maximum length of x value.
1432  * @return length of x value, can be length of the array or number of
1433  * maximum number of characters for a string
1434  */
1435 size_t
1437 {
1438  return 1;
1439 }
1441 /** Set x value.
1442  * X distance in m.
1443  * @param new_x new x value
1444  */
1445 void
1446 MotorInterface::GotoMessage::set_x(const float new_x)
1447 {
1448  data->x = new_x;
1449 }
1451 /** Get y value.
1452  * Y distance in m.
1453  * @return y value
1454  */
1455 float
1457 {
1458  return data->y;
1459 }
1461 /** Get maximum length of y value.
1462  * @return length of y value, can be length of the array or number of
1463  * maximum number of characters for a string
1464  */
1465 size_t
1467 {
1468  return 1;
1469 }
1471 /** Set y value.
1472  * Y distance in m.
1473  * @param new_y new y value
1474  */
1475 void
1476 MotorInterface::GotoMessage::set_y(const float new_y)
1477 {
1478  data->y = new_y;
1479 }
1481 /** Get phi value.
1482  * Angle relative to current angle in rad.
1483  * @return phi value
1484  */
1485 float
1487 {
1488  return data->phi;
1489 }
1491 /** Get maximum length of phi value.
1492  * @return length of phi value, can be length of the array or number of
1493  * maximum number of characters for a string
1494  */
1495 size_t
1497 {
1498  return 1;
1499 }
1501 /** Set phi value.
1502  * Angle relative to current angle in rad.
1503  * @param new_phi new phi value
1504  */
1505 void
1506 MotorInterface::GotoMessage::set_phi(const float new_phi)
1507 {
1508  data->phi = new_phi;
1509 }
1511 /** Get time_sec value.
1512  * When to reach the desired location.
1513  * @return time_sec value
1514  */
1515 float
1517 {
1518  return data->time_sec;
1519 }
1521 /** Get maximum length of time_sec value.
1522  * @return length of time_sec value, can be length of the array or number of
1523  * maximum number of characters for a string
1524  */
1525 size_t
1527 {
1528  return 1;
1529 }
1531 /** Set time_sec value.
1532  * When to reach the desired location.
1533  * @param new_time_sec new time_sec value
1534  */
1535 void
1536 MotorInterface::GotoMessage::set_time_sec(const float new_time_sec)
1537 {
1538  data->time_sec = new_time_sec;
1539 }
1541 /** Clone this message.
1542  * Produces a message of the same type as this message and copies the
1543  * data to the new message.
1544  * @return clone of this message
1545  */
1546 Message *
1548 {
1549  return new MotorInterface::GotoMessage(this);
1550 }
1551 /** @class MotorInterface::TransMessage <interfaces/MotorInterface.h>
1552  * TransMessage Fawkes BlackBoard Interface Message.
1553  *
1554 
1555  */
1556 
1557 
1558 /** Constructor with initial values.
1559  * @param ini_vx initial value for vx
1560  * @param ini_vy initial value for vy
1561  */
1562 MotorInterface::TransMessage::TransMessage(const float ini_vx, const float ini_vy) : Message("TransMessage")
1563 {
1564  data_size = sizeof(TransMessage_data_t);
1565  data_ptr = malloc(data_size);
1566  memset(data_ptr, 0, data_size);
1567  data = (TransMessage_data_t *)data_ptr;
1569  data->vx = ini_vx;
1570  data->vy = ini_vy;
1571  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
1572  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
1573 }
1574 /** Constructor */
1576 {
1577  data_size = sizeof(TransMessage_data_t);
1578  data_ptr = malloc(data_size);
1579  memset(data_ptr, 0, data_size);
1580  data = (TransMessage_data_t *)data_ptr;
1582  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
1583  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
1584 }
1585 
1586 /** Destructor */
1588 {
1589  free(data_ptr);
1590 }
1592 /** Copy constructor.
1593  * @param m message to copy from
1594  */
1596 {
1597  data_size = m->data_size;
1598  data_ptr = malloc(data_size);
1600  data = (TransMessage_data_t *)data_ptr;
1602 }
1603 
1604 /* Methods */
1605 /** Get vx value.
1606  * Speed in X direction in m/s.
1607  * @return vx value
1608  */
1609 float
1611 {
1612  return data->vx;
1613 }
1615 /** Get maximum length of vx value.
1616  * @return length of vx value, can be length of the array or number of
1617  * maximum number of characters for a string
1618  */
1619 size_t
1621 {
1622  return 1;
1623 }
1625 /** Set vx value.
1626  * Speed in X direction in m/s.
1627  * @param new_vx new vx value
1628  */
1629 void
1630 MotorInterface::TransMessage::set_vx(const float new_vx)
1631 {
1632  data->vx = new_vx;
1633 }
1635 /** Get vy value.
1636  * Speed in Y direction in m/s.
1637  * @return vy value
1638  */
1639 float
1641 {
1642  return data->vy;
1643 }
1645 /** Get maximum length of vy value.
1646  * @return length of vy value, can be length of the array or number of
1647  * maximum number of characters for a string
1648  */
1649 size_t
1651 {
1652  return 1;
1653 }
1655 /** Set vy value.
1656  * Speed in Y direction in m/s.
1657  * @param new_vy new vy value
1658  */
1659 void
1660 MotorInterface::TransMessage::set_vy(const float new_vy)
1661 {
1662  data->vy = new_vy;
1663 }
1665 /** Clone this message.
1666  * Produces a message of the same type as this message and copies the
1667  * data to the new message.
1668  * @return clone of this message
1669  */
1670 Message *
1672 {
1673  return new MotorInterface::TransMessage(this);
1674 }
1675 /** @class MotorInterface::RotMessage <interfaces/MotorInterface.h>
1676  * RotMessage Fawkes BlackBoard Interface Message.
1677  *
1678 
1679  */
1680 
1681 
1682 /** Constructor with initial values.
1683  * @param ini_omega initial value for omega
1684  */
1685 MotorInterface::RotMessage::RotMessage(const float ini_omega) : Message("RotMessage")
1686 {
1687  data_size = sizeof(RotMessage_data_t);
1688  data_ptr = malloc(data_size);
1689  memset(data_ptr, 0, data_size);
1690  data = (RotMessage_data_t *)data_ptr;
1692  data->omega = ini_omega;
1693  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
1694 }
1695 /** Constructor */
1697 {
1698  data_size = sizeof(RotMessage_data_t);
1699  data_ptr = malloc(data_size);
1700  memset(data_ptr, 0, data_size);
1701  data = (RotMessage_data_t *)data_ptr;
1703  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
1704 }
1705 
1706 /** Destructor */
1708 {
1709  free(data_ptr);
1710 }
1712 /** Copy constructor.
1713  * @param m message to copy from
1714  */
1716 {
1717  data_size = m->data_size;
1718  data_ptr = malloc(data_size);
1720  data = (RotMessage_data_t *)data_ptr;
1722 }
1723 
1724 /* Methods */
1725 /** Get omega value.
1726  * Angle rotation in rad/s.
1727  * @return omega value
1728  */
1729 float
1731 {
1732  return data->omega;
1733 }
1735 /** Get maximum length of omega value.
1736  * @return length of omega value, can be length of the array or number of
1737  * maximum number of characters for a string
1738  */
1739 size_t
1741 {
1742  return 1;
1743 }
1745 /** Set omega value.
1746  * Angle rotation in rad/s.
1747  * @param new_omega new omega value
1748  */
1749 void
1750 MotorInterface::RotMessage::set_omega(const float new_omega)
1751 {
1752  data->omega = new_omega;
1753 }
1755 /** Clone this message.
1756  * Produces a message of the same type as this message and copies the
1757  * data to the new message.
1758  * @return clone of this message
1759  */
1760 Message *
1762 {
1763  return new MotorInterface::RotMessage(this);
1764 }
1765 /** @class MotorInterface::TransRotMessage <interfaces/MotorInterface.h>
1766  * TransRotMessage Fawkes BlackBoard Interface Message.
1767  *
1768 
1769  */
1770 
1771 
1772 /** Constructor with initial values.
1773  * @param ini_vx initial value for vx
1774  * @param ini_vy initial value for vy
1775  * @param ini_omega initial value for omega
1776  */
1777 MotorInterface::TransRotMessage::TransRotMessage(const float ini_vx, const float ini_vy, const float ini_omega) : Message("TransRotMessage")
1778 {
1779  data_size = sizeof(TransRotMessage_data_t);
1780  data_ptr = malloc(data_size);
1781  memset(data_ptr, 0, data_size);
1782  data = (TransRotMessage_data_t *)data_ptr;
1784  data->vx = ini_vx;
1785  data->vy = ini_vy;
1786  data->omega = ini_omega;
1787  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
1788  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
1789  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
1790 }
1791 /** Constructor */
1793 {
1794  data_size = sizeof(TransRotMessage_data_t);
1795  data_ptr = malloc(data_size);
1796  memset(data_ptr, 0, data_size);
1797  data = (TransRotMessage_data_t *)data_ptr;
1799  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
1800  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
1801  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
1802 }
1803 
1804 /** Destructor */
1806 {
1807  free(data_ptr);
1808 }
1810 /** Copy constructor.
1811  * @param m message to copy from
1812  */
1814 {
1815  data_size = m->data_size;
1816  data_ptr = malloc(data_size);
1818  data = (TransRotMessage_data_t *)data_ptr;
1820 }
1821 
1822 /* Methods */
1823 /** Get vx value.
1824  * Speed in X direction in m/s.
1825  * @return vx value
1826  */
1827 float
1829 {
1830  return data->vx;
1831 }
1833 /** Get maximum length of vx value.
1834  * @return length of vx value, can be length of the array or number of
1835  * maximum number of characters for a string
1836  */
1837 size_t
1839 {
1840  return 1;
1841 }
1843 /** Set vx value.
1844  * Speed in X direction in m/s.
1845  * @param new_vx new vx value
1846  */
1847 void
1848 MotorInterface::TransRotMessage::set_vx(const float new_vx)
1849 {
1850  data->vx = new_vx;
1851 }
1853 /** Get vy value.
1854  * Speed in Y direction in m/s.
1855  * @return vy value
1856  */
1857 float
1859 {
1860  return data->vy;
1861 }
1863 /** Get maximum length of vy value.
1864  * @return length of vy value, can be length of the array or number of
1865  * maximum number of characters for a string
1866  */
1867 size_t
1869 {
1870  return 1;
1871 }
1873 /** Set vy value.
1874  * Speed in Y direction in m/s.
1875  * @param new_vy new vy value
1876  */
1877 void
1878 MotorInterface::TransRotMessage::set_vy(const float new_vy)
1879 {
1880  data->vy = new_vy;
1881 }
1883 /** Get omega value.
1884  * Angle rotation in rad/s.
1885  * @return omega value
1886  */
1887 float
1889 {
1890  return data->omega;
1891 }
1893 /** Get maximum length of omega value.
1894  * @return length of omega value, can be length of the array or number of
1895  * maximum number of characters for a string
1896  */
1897 size_t
1899 {
1900  return 1;
1901 }
1903 /** Set omega value.
1904  * Angle rotation in rad/s.
1905  * @param new_omega new omega value
1906  */
1907 void
1908 MotorInterface::TransRotMessage::set_omega(const float new_omega)
1909 {
1910  data->omega = new_omega;
1911 }
1913 /** Clone this message.
1914  * Produces a message of the same type as this message and copies the
1915  * data to the new message.
1916  * @return clone of this message
1917  */
1918 Message *
1920 {
1921  return new MotorInterface::TransRotMessage(this);
1922 }
1923 /** @class MotorInterface::OrbitMessage <interfaces/MotorInterface.h>
1924  * OrbitMessage Fawkes BlackBoard Interface Message.
1925  *
1926 
1927  */
1928 
1929 
1930 /** Constructor with initial values.
1931  * @param ini_px initial value for px
1932  * @param ini_py initial value for py
1933  * @param ini_omega initial value for omega
1934  */
1935 MotorInterface::OrbitMessage::OrbitMessage(const float ini_px, const float ini_py, const float ini_omega) : Message("OrbitMessage")
1936 {
1937  data_size = sizeof(OrbitMessage_data_t);
1938  data_ptr = malloc(data_size);
1939  memset(data_ptr, 0, data_size);
1940  data = (OrbitMessage_data_t *)data_ptr;
1942  data->px = ini_px;
1943  data->py = ini_py;
1944  data->omega = ini_omega;
1945  add_fieldinfo(IFT_FLOAT, "px", 1, &data->px);
1946  add_fieldinfo(IFT_FLOAT, "py", 1, &data->py);
1947  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
1948 }
1949 /** Constructor */
1951 {
1952  data_size = sizeof(OrbitMessage_data_t);
1953  data_ptr = malloc(data_size);
1954  memset(data_ptr, 0, data_size);
1955  data = (OrbitMessage_data_t *)data_ptr;
1957  add_fieldinfo(IFT_FLOAT, "px", 1, &data->px);
1958  add_fieldinfo(IFT_FLOAT, "py", 1, &data->py);
1959  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
1960 }
1961 
1962 /** Destructor */
1964 {
1965  free(data_ptr);
1966 }
1968 /** Copy constructor.
1969  * @param m message to copy from
1970  */
1972 {
1973  data_size = m->data_size;
1974  data_ptr = malloc(data_size);
1976  data = (OrbitMessage_data_t *)data_ptr;
1978 }
1979 
1980 /* Methods */
1981 /** Get px value.
1982  * Point's X coordinate to orbit.
1983  * @return px value
1984  */
1985 float
1987 {
1988  return data->px;
1989 }
1991 /** Get maximum length of px value.
1992  * @return length of px value, can be length of the array or number of
1993  * maximum number of characters for a string
1994  */
1995 size_t
1997 {
1998  return 1;
1999 }
2001 /** Set px value.
2002  * Point's X coordinate to orbit.
2003  * @param new_px new px value
2004  */
2005 void
2006 MotorInterface::OrbitMessage::set_px(const float new_px)
2007 {
2008  data->px = new_px;
2009 }
2011 /** Get py value.
2012  * Point's Y coordinate to orbit.
2013  * @return py value
2014  */
2015 float
2017 {
2018  return data->py;
2019 }
2021 /** Get maximum length of py value.
2022  * @return length of py value, can be length of the array or number of
2023  * maximum number of characters for a string
2024  */
2025 size_t
2027 {
2028  return 1;
2029 }
2031 /** Set py value.
2032  * Point's Y coordinate to orbit.
2033  * @param new_py new py value
2034  */
2035 void
2036 MotorInterface::OrbitMessage::set_py(const float new_py)
2037 {
2038  data->py = new_py;
2039 }
2041 /** Get omega value.
2042  * Angular speed around point in rad/s.
2043  * @return omega value
2044  */
2045 float
2047 {
2048  return data->omega;
2049 }
2051 /** Get maximum length of omega value.
2052  * @return length of omega value, can be length of the array or number of
2053  * maximum number of characters for a string
2054  */
2055 size_t
2057 {
2058  return 1;
2059 }
2061 /** Set omega value.
2062  * Angular speed around point in rad/s.
2063  * @param new_omega new omega value
2064  */
2065 void
2066 MotorInterface::OrbitMessage::set_omega(const float new_omega)
2067 {
2068  data->omega = new_omega;
2069 }
2071 /** Clone this message.
2072  * Produces a message of the same type as this message and copies the
2073  * data to the new message.
2074  * @return clone of this message
2075  */
2076 Message *
2078 {
2079  return new MotorInterface::OrbitMessage(this);
2080 }
2081 /** @class MotorInterface::LinTransRotMessage <interfaces/MotorInterface.h>
2082  * LinTransRotMessage Fawkes BlackBoard Interface Message.
2083  *
2084 
2085  */
2086 
2087 
2088 /** Constructor with initial values.
2089  * @param ini_vx initial value for vx
2090  * @param ini_vy initial value for vy
2091  * @param ini_omega initial value for omega
2092  */
2093 MotorInterface::LinTransRotMessage::LinTransRotMessage(const float ini_vx, const float ini_vy, const float ini_omega) : Message("LinTransRotMessage")
2094 {
2095  data_size = sizeof(LinTransRotMessage_data_t);
2096  data_ptr = malloc(data_size);
2097  memset(data_ptr, 0, data_size);
2098  data = (LinTransRotMessage_data_t *)data_ptr;
2100  data->vx = ini_vx;
2101  data->vy = ini_vy;
2102  data->omega = ini_omega;
2103  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
2104  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
2105  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
2106 }
2107 /** Constructor */
2109 {
2110  data_size = sizeof(LinTransRotMessage_data_t);
2111  data_ptr = malloc(data_size);
2112  memset(data_ptr, 0, data_size);
2113  data = (LinTransRotMessage_data_t *)data_ptr;
2115  add_fieldinfo(IFT_FLOAT, "vx", 1, &data->vx);
2116  add_fieldinfo(IFT_FLOAT, "vy", 1, &data->vy);
2117  add_fieldinfo(IFT_FLOAT, "omega", 1, &data->omega);
2118 }
2119 
2120 /** Destructor */
2122 {
2123  free(data_ptr);
2124 }
2126 /** Copy constructor.
2127  * @param m message to copy from
2128  */
2130 {
2131  data_size = m->data_size;
2132  data_ptr = malloc(data_size);
2134  data = (LinTransRotMessage_data_t *)data_ptr;
2136 }
2137 
2138 /* Methods */
2139 /** Get vx value.
2140  * Speed for translation in X direction in m/s.
2141  * @return vx value
2142  */
2143 float
2145 {
2146  return data->vx;
2147 }
2149 /** Get maximum length of vx value.
2150  * @return length of vx value, can be length of the array or number of
2151  * maximum number of characters for a string
2152  */
2153 size_t
2155 {
2156  return 1;
2157 }
2159 /** Set vx value.
2160  * Speed for translation in X direction in m/s.
2161  * @param new_vx new vx value
2162  */
2163 void
2165 {
2166  data->vx = new_vx;
2167 }
2169 /** Get vy value.
2170  * Speed for translation in Y direction in m/s.
2171  * @return vy value
2172  */
2173 float
2175 {
2176  return data->vy;
2177 }
2179 /** Get maximum length of vy value.
2180  * @return length of vy value, can be length of the array or number of
2181  * maximum number of characters for a string
2182  */
2183 size_t
2185 {
2186  return 1;
2187 }
2189 /** Set vy value.
2190  * Speed for translation in Y direction in m/s.
2191  * @param new_vy new vy value
2192  */
2193 void
2195 {
2196  data->vy = new_vy;
2197 }
2199 /** Get omega value.
2200  * Rotational speed in rad/s.
2201  * @return omega value
2202  */
2203 float
2205 {
2206  return data->omega;
2207 }
2209 /** Get maximum length of omega value.
2210  * @return length of omega value, can be length of the array or number of
2211  * maximum number of characters for a string
2212  */
2213 size_t
2215 {
2216  return 1;
2217 }
2219 /** Set omega value.
2220  * Rotational speed in rad/s.
2221  * @param new_omega new omega value
2222  */
2223 void
2224 MotorInterface::LinTransRotMessage::set_omega(const float new_omega)
2225 {
2226  data->omega = new_omega;
2227 }
2229 /** Clone this message.
2230  * Produces a message of the same type as this message and copies the
2231  * data to the new message.
2232  * @return clone of this message
2233  */
2234 Message *
2236 {
2237  return new MotorInterface::LinTransRotMessage(this);
2238 }
2239 /** Check if message is valid and can be enqueued.
2240  * @param message Message to check
2241  * @return true if the message is valid, false otherwise.
2242  */
2243 bool
2244 MotorInterface::message_valid(const Message *message) const
2245 {
2246  const SetMotorStateMessage *m0 = dynamic_cast<const SetMotorStateMessage *>(message);
2247  if ( m0 != NULL ) {
2248  return true;
2249  }
2250  const AcquireControlMessage *m1 = dynamic_cast<const AcquireControlMessage *>(message);
2251  if ( m1 != NULL ) {
2252  return true;
2253  }
2254  const ResetOdometryMessage *m2 = dynamic_cast<const ResetOdometryMessage *>(message);
2255  if ( m2 != NULL ) {
2256  return true;
2257  }
2258  const SetOdometryMessage *m3 = dynamic_cast<const SetOdometryMessage *>(message);
2259  if ( m3 != NULL ) {
2260  return true;
2261  }
2262  const DriveRPMMessage *m4 = dynamic_cast<const DriveRPMMessage *>(message);
2263  if ( m4 != NULL ) {
2264  return true;
2265  }
2266  const GotoMessage *m5 = dynamic_cast<const GotoMessage *>(message);
2267  if ( m5 != NULL ) {
2268  return true;
2269  }
2270  const TransMessage *m6 = dynamic_cast<const TransMessage *>(message);
2271  if ( m6 != NULL ) {
2272  return true;
2273  }
2274  const RotMessage *m7 = dynamic_cast<const RotMessage *>(message);
2275  if ( m7 != NULL ) {
2276  return true;
2277  }
2278  const TransRotMessage *m8 = dynamic_cast<const TransRotMessage *>(message);
2279  if ( m8 != NULL ) {
2280  return true;
2281  }
2282  const OrbitMessage *m9 = dynamic_cast<const OrbitMessage *>(message);
2283  if ( m9 != NULL ) {
2284  return true;
2285  }
2286  const LinTransRotMessage *m10 = dynamic_cast<const LinTransRotMessage *>(message);
2287  if ( m10 != NULL ) {
2288  return true;
2289  }
2290  return false;
2291 }
2292 
2293 /// @cond INTERNALS
2294 EXPORT_INTERFACE(MotorInterface)
2295 /// @endcond
2296 
2297 
2298 } // end namespace fawkes
fawkes::MotorInterface::LinTransRotMessage
Definition: MotorInterface.h:429
fawkes::MotorInterface::GotoMessage::set_y
void set_y(const float new_y)
Set y value.
Definition: MotorInterface.cpp:1480
fawkes::MotorInterface::DriveRPMMessage::DriveRPMMessage
DriveRPMMessage()
Constructor.
Definition: MotorInterface.cpp:1232
fawkes::MotorInterface::SetMotorStateMessage
Definition: MotorInterface.h:123
fawkes::MotorInterface::des_vx
float des_vx() const
Get des_vx value.
Definition: MotorInterface.cpp:538
fawkes::MotorInterface::DRIVE_MODE_TRANS
static const uint32_t DRIVE_MODE_TRANS
DRIVE_MODE_TRANS constant.
Definition: MotorInterface.h:52
fawkes::MotorInterface::OrbitMessage::omega
float omega() const
Get omega value.
Definition: MotorInterface.cpp:2050
fawkes::Interface::data_ptr
void * data_ptr
Definition: interface.h:223
fawkes::MotorInterface::motor_state
uint32_t motor_state() const
Get motor_state value.
Definition: MotorInterface.cpp:118
fawkes::MotorInterface::set_controller_thread_name
void set_controller_thread_name(const char *new_controller_thread_name)
Set controller_thread_name value.
Definition: MotorInterface.cpp:706
fawkes::MotorInterface::AcquireControlMessage::controller
uint32_t controller() const
Get controller value.
Definition: MotorInterface.cpp:924
fawkes::MotorInterface::GotoMessage::~GotoMessage
~GotoMessage()
Destructor.
Definition: MotorInterface.cpp:1407
fawkes::MotorInterface::TransMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1675
fawkes::MotorInterface::vx
float vx() const
Get vx value.
Definition: MotorInterface.cpp:433
fawkes::MotorInterface::RotMessage::RotMessage
RotMessage()
Constructor.
Definition: MotorInterface.cpp:1700
fawkes::MotorInterface::DriveRPMMessage::rear
float rear() const
Get rear value.
Definition: MotorInterface.cpp:1328
fawkes::MotorInterface::drive_mode
uint32_t drive_mode() const
Get drive_mode value.
Definition: MotorInterface.cpp:153
fawkes::MotorInterface::TransRotMessage::vy
float vy() const
Get vy value.
Definition: MotorInterface.cpp:1862
fawkes::MotorInterface::DRIVE_MODE_ROT
static const uint32_t DRIVE_MODE_ROT
DRIVE_MODE_ROT constant.
Definition: MotorInterface.h:53
fawkes::MotorInterface::copy_values
virtual void copy_values(const Interface *other)
Copy values from other interface.
Definition: MotorInterface.cpp:750
fawkes::MotorInterface::omega
float omega() const
Get omega value.
Definition: MotorInterface.cpp:503
fawkes::MotorInterface::DriveRPMMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1359
fawkes::MotorInterface::DRIVE_MODE_RPM
static const uint32_t DRIVE_MODE_RPM
DRIVE_MODE_RPM constant.
Definition: MotorInterface.h:51
fawkes::MotorInterface::SetOdometryMessage::y
float y() const
Get y value.
Definition: MotorInterface.cpp:1140
fawkes::MotorInterface::right_rpm
int32_t right_rpm() const
Get right_rpm value.
Definition: MotorInterface.cpp:188
fawkes::MotorInterface::DriveRPMMessage::maxlenof_rear
size_t maxlenof_rear() const
Get maximum length of rear value.
Definition: MotorInterface.cpp:1338
fawkes::MotorInterface::SetOdometryMessage::set_odometry_orientation
void set_odometry_orientation(const float new_odometry_orientation)
Set odometry_orientation value.
Definition: MotorInterface.cpp:1190
fawkes::MotorInterface::SetMotorStateMessage::maxlenof_motor_state
size_t maxlenof_motor_state() const
Get maximum length of motor_state value.
Definition: MotorInterface.cpp:834
fawkes::MotorInterface::GotoMessage::x
float x() const
Get x value.
Definition: MotorInterface.cpp:1430
fawkes::MotorInterface::DriveRPMMessage::maxlenof_front_left
size_t maxlenof_front_left() const
Get maximum length of front_left value.
Definition: MotorInterface.cpp:1308
fawkes::MotorInterface::GotoMessage
Definition: MotorInterface.h:272
fawkes::MotorInterface::set_vx
void set_vx(const float new_vx)
Set vx value.
Definition: MotorInterface.cpp:455
fawkes::MotorInterface::TransMessage::~TransMessage
~TransMessage()
Destructor.
Definition: MotorInterface.cpp:1591
fawkes::MotorInterface::TransRotMessage
Definition: MotorInterface.h:363
fawkes::MotorInterface::LinTransRotMessage::set_omega
void set_omega(const float new_omega)
Set omega value.
Definition: MotorInterface.cpp:2228
fawkes::Message
Definition: message.h:40
fawkes::MotorInterface::AcquireControlMessage::AcquireControlMessage
AcquireControlMessage()
Constructor.
Definition: MotorInterface.cpp:886
fawkes::MotorInterface::OrbitMessage::py
float py() const
Get py value.
Definition: MotorInterface.cpp:2020
fawkes::Message::data_ptr
void * data_ptr
Definition: message.h:124
fawkes::MotorInterface::TransMessage::maxlenof_vx
size_t maxlenof_vx() const
Get maximum length of vx value.
Definition: MotorInterface.cpp:1624
fawkes::MotorInterface::maxlenof_motor_state
size_t maxlenof_motor_state() const
Get maximum length of motor_state value.
Definition: MotorInterface.cpp:128
fawkes::IFT_FLOAT
float field
Definition: types.h:57
fawkes::Message::data_ts
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:134
fawkes::MotorInterface::maxlenof_left_rpm
size_t maxlenof_left_rpm() const
Get maximum length of left_rpm value.
Definition: MotorInterface.cpp:268
fawkes::MotorInterface::maxlenof_controller
size_t maxlenof_controller() const
Get maximum length of controller value.
Definition: MotorInterface.cpp:654
fawkes::IFT_UINT32
32 bit unsigned integer field
Definition: types.h:54
fawkes::MotorInterface::des_vy
float des_vy() const
Get des_vy value.
Definition: MotorInterface.cpp:573
fawkes::MotorInterface::OrbitMessage::set_px
void set_px(const float new_px)
Set px value.
Definition: MotorInterface.cpp:2010
fawkes::MotorInterface::TransMessage::vy
float vy() const
Get vy value.
Definition: MotorInterface.cpp:1644
fawkes::MotorInterface::LinTransRotMessage::maxlenof_vy
size_t maxlenof_vy() const
Get maximum length of vy value.
Definition: MotorInterface.cpp:2188
fawkes::MotorInterface::TransRotMessage::maxlenof_vy
size_t maxlenof_vy() const
Get maximum length of vy value.
Definition: MotorInterface.cpp:1872
fawkes::MotorInterface::AcquireControlMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:997
fawkes::MotorInterface::ResetOdometryMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1043
fawkes::MotorInterface::maxlenof_controller_thread_name
size_t maxlenof_controller_thread_name() const
Get maximum length of controller_thread_name value.
Definition: MotorInterface.cpp:692
fawkes::MotorInterface::LinTransRotMessage::set_vx
void set_vx(const float new_vx)
Set vx value.
Definition: MotorInterface.cpp:2168
fawkes::MotorInterface::maxlenof_drive_mode
size_t maxlenof_drive_mode() const
Get maximum length of drive_mode value.
Definition: MotorInterface.cpp:163
fawkes::Interface::type
const char * type() const
Get type of interface.
Definition: interface.cpp:643
fawkes::Interface::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 field info list.
Definition: interface.cpp:339
fawkes::MotorInterface::OrbitMessage::maxlenof_px
size_t maxlenof_px() const
Get maximum length of px value.
Definition: MotorInterface.cpp:2000
fawkes::MotorInterface::OrbitMessage::set_omega
void set_omega(const float new_omega)
Set omega value.
Definition: MotorInterface.cpp:2070
fawkes::MotorInterface::SetMotorStateMessage::set_motor_state
void set_motor_state(const uint32_t new_motor_state)
Set motor_state value.
Definition: MotorInterface.cpp:846
fawkes::MotorInterface::GotoMessage::maxlenof_x
size_t maxlenof_x() const
Get maximum length of x value.
Definition: MotorInterface.cpp:1440
fawkes::MotorInterface::GotoMessage::maxlenof_phi
size_t maxlenof_phi() const
Get maximum length of phi value.
Definition: MotorInterface.cpp:1500
fawkes::MotorInterface::left_rpm
int32_t left_rpm() const
Get left_rpm value.
Definition: MotorInterface.cpp:258
fawkes::Interface::data_ts
interface_data_ts_t * data_ts
Definition: interface.h:227
fawkes::MotorInterface::set_des_omega
void set_des_omega(const float new_des_omega)
Set des_omega value.
Definition: MotorInterface.cpp:630
fawkes::MotorInterface::create_message
virtual Message * create_message(const char *type) const
Definition: MotorInterface.cpp:715
fawkes::MotorInterface::RotMessage::maxlenof_omega
size_t maxlenof_omega() const
Get maximum length of omega value.
Definition: MotorInterface.cpp:1744
fawkes::MotorInterface::TransMessage::vx
float vx() const
Get vx value.
Definition: MotorInterface.cpp:1614
fawkes::MotorInterface::DriveRPMMessage::set_rear
void set_rear(const float new_rear)
Set rear value.
Definition: MotorInterface.cpp:1348
fawkes::MotorInterface::GotoMessage::phi
float phi() const
Get phi value.
Definition: MotorInterface.cpp:1490
fawkes::MotorInterface::SetOdometryMessage::odometry_orientation
float odometry_orientation() const
Get odometry_orientation value.
Definition: MotorInterface.cpp:1170
fawkes::MotorInterface::odometry_position_y
float odometry_position_y() const
Get odometry_position_y value.
Definition: MotorInterface.cpp:363
fawkes::Message::message_data_ts_t
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:129
fawkes::MotorInterface::MOTOR_ENABLED
static const uint32_t MOTOR_ENABLED
MOTOR_ENABLED constant.
Definition: MotorInterface.h:49
fawkes::MotorInterface::RotMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1765
fawkes::MotorInterface::SetOdometryMessage::maxlenof_y
size_t maxlenof_y() const
Get maximum length of y value.
Definition: MotorInterface.cpp:1150
fawkes::MotorInterface::MOTOR_DISABLED
static const uint32_t MOTOR_DISABLED
MOTOR_DISABLED constant.
Definition: MotorInterface.h:50
fawkes::MotorInterface::LinTransRotMessage::vy
float vy() const
Get vy value.
Definition: MotorInterface.cpp:2178
fawkes::MotorInterface::DRIVE_MODE_TRANS_ROT
static const uint32_t DRIVE_MODE_TRANS_ROT
DRIVE_MODE_TRANS_ROT constant.
Definition: MotorInterface.h:54
fawkes::MotorInterface::set_drive_mode
void set_drive_mode(const uint32_t new_drive_mode)
Set drive_mode value.
Definition: MotorInterface.cpp:175
fawkes::MotorInterface::GotoMessage::GotoMessage
GotoMessage()
Constructor.
Definition: MotorInterface.cpp:1393
fawkes::MotorInterface::DRIVE_MODE_LINE_TRANS_ROT
static const uint32_t DRIVE_MODE_LINE_TRANS_ROT
DRIVE_MODE_LINE_TRANS_ROT constant.
Definition: MotorInterface.h:56
fawkes::TypeMismatchException
Definition: software.h:47
fawkes::Interface::data_changed
bool data_changed
Definition: interface.h:225
fawkes::MotorInterface::TransRotMessage::maxlenof_vx
size_t maxlenof_vx() const
Get maximum length of vx value.
Definition: MotorInterface.cpp:1842
fawkes::MotorInterface::ResetOdometryMessage::~ResetOdometryMessage
~ResetOdometryMessage()
Destructor.
Definition: MotorInterface.cpp:1019
fawkes::MotorInterface::maxlenof_des_vx
size_t maxlenof_des_vx() const
Get maximum length of des_vx value.
Definition: MotorInterface.cpp:548
fawkes::MotorInterface::maxlenof_odometry_position_y
size_t maxlenof_odometry_position_y() const
Get maximum length of odometry_position_y value.
Definition: MotorInterface.cpp:373
fawkes::MotorInterface::maxlenof_right_rpm
size_t maxlenof_right_rpm() const
Get maximum length of right_rpm value.
Definition: MotorInterface.cpp:198
fawkes::MotorInterface::LinTransRotMessage::set_vy
void set_vy(const float new_vy)
Set vy value.
Definition: MotorInterface.cpp:2198
fawkes::IFT_INT32
32 bit integer field
Definition: types.h:53
fawkes::MotorInterface::des_omega
float des_omega() const
Get des_omega value.
Definition: MotorInterface.cpp:608
fawkes::MotorInterface::set_vy
void set_vy(const float new_vy)
Set vy value.
Definition: MotorInterface.cpp:490
fawkes::MotorInterface::set_odometry_position_x
void set_odometry_position_x(const float new_odometry_position_x)
Set odometry_position_x value.
Definition: MotorInterface.cpp:350
fawkes::MotorInterface::ResetOdometryMessage
Definition: MotorInterface.h:186
fawkes::MotorInterface::AcquireControlMessage::set_controller_thread_name
void set_controller_thread_name(const char *new_controller_thread_name)
Set controller_thread_name value.
Definition: MotorInterface.cpp:985
fawkes::Interface::Interface
Interface()
Constructor.
Definition: interface.cpp:236
fawkes::MotorInterface::OrbitMessage::maxlenof_omega
size_t maxlenof_omega() const
Get maximum length of omega value.
Definition: MotorInterface.cpp:2060
fawkes::MotorInterface::maxlenof_vx
size_t maxlenof_vx() const
Get maximum length of vx value.
Definition: MotorInterface.cpp:443
fawkes::MotorInterface::maxlenof_des_omega
size_t maxlenof_des_omega() const
Get maximum length of des_omega value.
Definition: MotorInterface.cpp:618
fawkes::MotorInterface::TransRotMessage::omega
float omega() const
Get omega value.
Definition: MotorInterface.cpp:1892
fawkes::MotorInterface::controller
uint32_t controller() const
Get controller value.
Definition: MotorInterface.cpp:644
fawkes
fawkes::MotorInterface::TransRotMessage::maxlenof_omega
size_t maxlenof_omega() const
Get maximum length of omega value.
Definition: MotorInterface.cpp:1902
fawkes::MotorInterface::set_des_vy
void set_des_vy(const float new_des_vy)
Set des_vy value.
Definition: MotorInterface.cpp:595
fawkes::MotorInterface::odometry_orientation
float odometry_orientation() const
Get odometry_orientation value.
Definition: MotorInterface.cpp:398
fawkes::MotorInterface::GotoMessage::y
float y() const
Get y value.
Definition: MotorInterface.cpp:1460
fawkes::Interface::set_hash
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:319
fawkes::MotorInterface::controller_thread_name
char * controller_thread_name() const
Get controller_thread_name value.
Definition: MotorInterface.cpp:682
fawkes::Message::data_size
unsigned int data_size
Definition: message.h:125
fawkes::MotorInterface::AcquireControlMessage::~AcquireControlMessage
~AcquireControlMessage()
Destructor.
Definition: MotorInterface.cpp:898
fawkes::MotorInterface::LinTransRotMessage::LinTransRotMessage
LinTransRotMessage()
Constructor.
Definition: MotorInterface.cpp:2112
fawkes::MotorInterface::LinTransRotMessage::maxlenof_omega
size_t maxlenof_omega() const
Get maximum length of omega value.
Definition: MotorInterface.cpp:2218
fawkes::MotorInterface::OrbitMessage::px
float px() const
Get px value.
Definition: MotorInterface.cpp:1990
fawkes::MotorInterface::SetMotorStateMessage::SetMotorStateMessage
SetMotorStateMessage()
Constructor.
Definition: MotorInterface.cpp:788
fawkes::MotorInterface::ResetOdometryMessage::ResetOdometryMessage
ResetOdometryMessage()
Constructor.
Definition: MotorInterface.cpp:1009
fawkes::MotorInterface::SetOdometryMessage::maxlenof_x
size_t maxlenof_x() const
Get maximum length of x value.
Definition: MotorInterface.cpp:1120
fawkes::MotorInterface::SetOdometryMessage::x
float x() const
Get x value.
Definition: MotorInterface.cpp:1110
fawkes::MotorInterface::TransRotMessage::set_omega
void set_omega(const float new_omega)
Set omega value.
Definition: MotorInterface.cpp:1912
fawkes::MotorInterface::SetOdometryMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1201
fawkes::MotorInterface::maxlenof_odometry_position_x
size_t maxlenof_odometry_position_x() const
Get maximum length of odometry_position_x value.
Definition: MotorInterface.cpp:338
fawkes::MotorInterface::GotoMessage::maxlenof_time_sec
size_t maxlenof_time_sec() const
Get maximum length of time_sec value.
Definition: MotorInterface.cpp:1530
fawkes::MotorInterface::TransMessage
Definition: MotorInterface.h:309
fawkes::MotorInterface::TransRotMessage::set_vx
void set_vx(const float new_vx)
Set vx value.
Definition: MotorInterface.cpp:1852
fawkes::MotorInterface::GotoMessage::set_phi
void set_phi(const float new_phi)
Set phi value.
Definition: MotorInterface.cpp:1510
fawkes::MotorInterface::DriveRPMMessage
Definition: MotorInterface.h:239
fawkes::MotorInterface::GotoMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1551
fawkes::MotorInterface::DriveRPMMessage::front_left
float front_left() const
Get front_left value.
Definition: MotorInterface.cpp:1298
fawkes::MotorInterface::DriveRPMMessage::front_right
float front_right() const
Get front_right value.
Definition: MotorInterface.cpp:1268
fawkes::MotorInterface::set_odometry_position_y
void set_odometry_position_y(const float new_odometry_position_y)
Set odometry_position_y value.
Definition: MotorInterface.cpp:385
fawkes::MotorInterface::OrbitMessage
Definition: MotorInterface.h:396
fawkes::MotorInterface::AcquireControlMessage::maxlenof_controller_thread_name
size_t maxlenof_controller_thread_name() const
Get maximum length of controller_thread_name value.
Definition: MotorInterface.cpp:971
fawkes::MotorInterface::rear_rpm
int32_t rear_rpm() const
Get rear_rpm value.
Definition: MotorInterface.cpp:223
fawkes::MotorInterface::AcquireControlMessage::controller_thread_name
char * controller_thread_name() const
Get controller_thread_name value.
Definition: MotorInterface.cpp:961
fawkes::MotorInterface::maxlenof_vy
size_t maxlenof_vy() const
Get maximum length of vy value.
Definition: MotorInterface.cpp:478
fawkes::MotorInterface::SetMotorStateMessage::~SetMotorStateMessage
~SetMotorStateMessage()
Destructor.
Definition: MotorInterface.cpp:799
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:404
fawkes::MotorInterface::RotMessage
Definition: MotorInterface.h:338
fawkes::MotorInterface::LinTransRotMessage::omega
float omega() const
Get omega value.
Definition: MotorInterface.cpp:2208
fawkes::MotorInterface::GotoMessage::set_x
void set_x(const float new_x)
Set x value.
Definition: MotorInterface.cpp:1450
fawkes::MotorInterface::set_des_vx
void set_des_vx(const float new_des_vx)
Set des_vx value.
Definition: MotorInterface.cpp:560
fawkes::MotorInterface::SetOdometryMessage::~SetOdometryMessage
~SetOdometryMessage()
Destructor.
Definition: MotorInterface.cpp:1087
fawkes::MotorInterface::set_motor_state
void set_motor_state(const uint32_t new_motor_state)
Set motor_state value.
Definition: MotorInterface.cpp:140
fawkes::MotorInterface::OrbitMessage::~OrbitMessage
~OrbitMessage()
Destructor.
Definition: MotorInterface.cpp:1967
fawkes::Interface::data_size
unsigned int data_size
Definition: interface.h:224
fawkes::MotorInterface::TransMessage::set_vy
void set_vy(const float new_vy)
Set vy value.
Definition: MotorInterface.cpp:1664
fawkes::MotorInterface::DriveRPMMessage::~DriveRPMMessage
~DriveRPMMessage()
Destructor.
Definition: MotorInterface.cpp:1245
fawkes::MotorInterface::OrbitMessage::maxlenof_py
size_t maxlenof_py() const
Get maximum length of py value.
Definition: MotorInterface.cpp:2030
fawkes::MotorInterface::DriveRPMMessage::maxlenof_front_right
size_t maxlenof_front_right() const
Get maximum length of front_right value.
Definition: MotorInterface.cpp:1278
fawkes::MotorInterface::maxlenof_odometry_path_length
size_t maxlenof_odometry_path_length() const
Get maximum length of odometry_path_length value.
Definition: MotorInterface.cpp:303
fawkes::MotorInterface::set_odometry_orientation
void set_odometry_orientation(const float new_odometry_orientation)
Set odometry_orientation value.
Definition: MotorInterface.cpp:420
fawkes::MotorInterface::RotMessage::set_omega
void set_omega(const float new_omega)
Set omega value.
Definition: MotorInterface.cpp:1754
fawkes::MotorInterface::set_right_rpm
void set_right_rpm(const int32_t new_right_rpm)
Set right_rpm value.
Definition: MotorInterface.cpp:210
fawkes::MotorInterface::TransRotMessage::TransRotMessage
TransRotMessage()
Constructor.
Definition: MotorInterface.cpp:1796
fawkes::MotorInterface::enum_tostring
virtual const char * enum_tostring(const char *enumtype, int val) const
Definition: MotorInterface.cpp:761
fawkes::MotorInterface::maxlenof_omega
size_t maxlenof_omega() const
Get maximum length of omega value.
Definition: MotorInterface.cpp:513
fawkes::MotorInterface::OrbitMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:2081
fawkes::MotorInterface::message_valid
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Definition: MotorInterface.cpp:2248
fawkes::MotorInterface::SetMotorStateMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:857
fawkes::MotorInterface::RotMessage::~RotMessage
~RotMessage()
Destructor.
Definition: MotorInterface.cpp:1711
fawkes::MotorInterface::OrbitMessage::set_py
void set_py(const float new_py)
Set py value.
Definition: MotorInterface.cpp:2040
fawkes::MotorInterface::LinTransRotMessage::maxlenof_vx
size_t maxlenof_vx() const
Get maximum length of vx value.
Definition: MotorInterface.cpp:2158
fawkes::MotorInterface::set_omega
void set_omega(const float new_omega)
Set omega value.
Definition: MotorInterface.cpp:525
fawkes::MotorInterface::DRIVE_MODE_ORBIT
static const uint32_t DRIVE_MODE_ORBIT
DRIVE_MODE_ORBIT constant.
Definition: MotorInterface.h:55
fawkes::MotorInterface::TransMessage::maxlenof_vy
size_t maxlenof_vy() const
Get maximum length of vy value.
Definition: MotorInterface.cpp:1654
fawkes::IFT_STRING
string field
Definition: types.h:59
fawkes::MotorInterface::TransRotMessage::vx
float vx() const
Get vx value.
Definition: MotorInterface.cpp:1832
fawkes::MotorInterface::AcquireControlMessage::maxlenof_controller
size_t maxlenof_controller() const
Get maximum length of controller value.
Definition: MotorInterface.cpp:934
fawkes::MotorInterface::SetOdometryMessage::set_y
void set_y(const float new_y)
Set y value.
Definition: MotorInterface.cpp:1160
fawkes::MotorInterface::AcquireControlMessage
Definition: MotorInterface.h:150
fawkes::MotorInterface::TransMessage::TransMessage
TransMessage()
Constructor.
Definition: MotorInterface.cpp:1579
fawkes::MotorInterface::odometry_position_x
float odometry_position_x() const
Get odometry_position_x value.
Definition: MotorInterface.cpp:328
fawkes::MotorInterface::LinTransRotMessage::~LinTransRotMessage
~LinTransRotMessage()
Destructor.
Definition: MotorInterface.cpp:2125
fawkes::MotorInterface::SetOdometryMessage::set_x
void set_x(const float new_x)
Set x value.
Definition: MotorInterface.cpp:1130
fawkes::MotorInterface::SetOdometryMessage::SetOdometryMessage
SetOdometryMessage()
Constructor.
Definition: MotorInterface.cpp:1074
fawkes::MotorInterface::maxlenof_odometry_orientation
size_t maxlenof_odometry_orientation() const
Get maximum length of odometry_orientation value.
Definition: MotorInterface.cpp:408
fawkes::MotorInterface::odometry_path_length
float odometry_path_length() const
Get odometry_path_length value.
Definition: MotorInterface.cpp:293
fawkes::MotorInterface::LinTransRotMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:2239
fawkes::MotorInterface::maxlenof_des_vy
size_t maxlenof_des_vy() const
Get maximum length of des_vy value.
Definition: MotorInterface.cpp:583
fawkes::MotorInterface::LinTransRotMessage::vx
float vx() const
Get vx value.
Definition: MotorInterface.cpp:2148
fawkes::MotorInterface::TransRotMessage::clone
virtual Message * clone() const
Clone this message.
Definition: MotorInterface.cpp:1923
fawkes::MotorInterface::set_controller
void set_controller(const uint32_t new_controller)
Set controller value.
Definition: MotorInterface.cpp:667
fawkes::MotorInterface::OrbitMessage::OrbitMessage
OrbitMessage()
Constructor.
Definition: MotorInterface.cpp:1954
fawkes::MotorInterface::set_left_rpm
void set_left_rpm(const int32_t new_left_rpm)
Set left_rpm value.
Definition: MotorInterface.cpp:280
fawkes::Interface::add_messageinfo
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:378
fawkes::MotorInterface::GotoMessage::time_sec
float time_sec() const
Get time_sec value.
Definition: MotorInterface.cpp:1520
fawkes::MotorInterface::DriveRPMMessage::set_front_left
void set_front_left(const float new_front_left)
Set front_left value.
Definition: MotorInterface.cpp:1318
fawkes::MotorInterface::DriveRPMMessage::set_front_right
void set_front_right(const float new_front_right)
Set front_right value.
Definition: MotorInterface.cpp:1288
fawkes::MotorInterface::maxlenof_rear_rpm
size_t maxlenof_rear_rpm() const
Get maximum length of rear_rpm value.
Definition: MotorInterface.cpp:233
fawkes::MotorInterface::GotoMessage::set_time_sec
void set_time_sec(const float new_time_sec)
Set time_sec value.
Definition: MotorInterface.cpp:1540
fawkes::MotorInterface::SetOdometryMessage
Definition: MotorInterface.h:206
fawkes::MotorInterface::RotMessage::omega
float omega() const
Get omega value.
Definition: MotorInterface.cpp:1734
fawkes::MotorInterface::GotoMessage::maxlenof_y
size_t maxlenof_y() const
Get maximum length of y value.
Definition: MotorInterface.cpp:1470
fawkes::MotorInterface::set_rear_rpm
void set_rear_rpm(const int32_t new_rear_rpm)
Set rear_rpm value.
Definition: MotorInterface.cpp:245
fawkes::MotorInterface::TransRotMessage::~TransRotMessage
~TransRotMessage()
Destructor.
Definition: MotorInterface.cpp:1809
fawkes::MotorInterface::vy
float vy() const
Get vy value.
Definition: MotorInterface.cpp:468
fawkes::MotorInterface::TransMessage::set_vx
void set_vx(const float new_vx)
Set vx value.
Definition: MotorInterface.cpp:1634
fawkes::MotorInterface::SetOdometryMessage::maxlenof_odometry_orientation
size_t maxlenof_odometry_orientation() const
Get maximum length of odometry_orientation value.
Definition: MotorInterface.cpp:1180
fawkes::MotorInterface::SetMotorStateMessage::motor_state
uint32_t motor_state() const
Get motor_state value.
Definition: MotorInterface.cpp:824
fawkes::MotorInterface::AcquireControlMessage::set_controller
void set_controller(const uint32_t new_controller)
Set controller value.
Definition: MotorInterface.cpp:947
fawkes::MotorInterface::TransRotMessage::set_vy
void set_vy(const float new_vy)
Set vy value.
Definition: MotorInterface.cpp:1882
fawkes::MotorInterface::set_odometry_path_length
void set_odometry_path_length(const float new_odometry_path_length)
Set odometry_path_length value.
Definition: MotorInterface.cpp:315