Fawkes API  Fawkes Development Version
NavigatorInterface.cpp
1 
2 /***************************************************************************
3  * NavigatorInterface.cpp - Fawkes BlackBoard Interface - NavigatorInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2007-2009 Martin Liebenberg, Daniel Beck, 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/NavigatorInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <cstring>
29 #include <cstdlib>
30 
31 namespace fawkes {
32 
33 /** @class NavigatorInterface <interfaces/NavigatorInterface.h>
34  * NavigatorInterface Fawkes BlackBoard Interface.
35  *
36  The navigator interface is used by the navigator to export information about
37  the current status of the navigator and to define all messages by which the navigator
38  can be instructed.
39 
40  There are three coordinate systems, the robot system which is a right-handed cartesian
41  coordinate system with the robot in its origin, X axis pointing forward, Y pointing to
42  the left and Z pointing upwards. The second coordinate system is the so-called
43  navigator system. It is a coordinate system similar to the robot system, but the
44  origin is defined on the initialization of the navigator. The last system is the
45  odometry system. It is again a similar system, but the origin is reset from time
46  to time and the robot's position in this system gives the odometry deltas.
47 
48  * @ingroup FawkesInterfaces
49  */
50 
51 
52 /** ERROR_NONE constant */
53 const uint32_t NavigatorInterface::ERROR_NONE = 0u;
54 /** ERROR_MOTOR constant */
55 const uint32_t NavigatorInterface::ERROR_MOTOR = 1u;
56 /** ERROR_OBSTRUCTION constant */
57 const uint32_t NavigatorInterface::ERROR_OBSTRUCTION = 2u;
58 /** ERROR_UNKNOWN_PLACE constant */
59 const uint32_t NavigatorInterface::ERROR_UNKNOWN_PLACE = 4u;
60 /** FLAG_NONE constant */
61 const uint32_t NavigatorInterface::FLAG_NONE = 0u;
62 /** FLAG_CART_GOTO constant */
63 const uint32_t NavigatorInterface::FLAG_CART_GOTO = 1u;
64 /** FLAG_POLAR_GOTO constant */
65 const uint32_t NavigatorInterface::FLAG_POLAR_GOTO = 2u;
66 /** FLAG_PLACE_GOTO constant */
67 const uint32_t NavigatorInterface::FLAG_PLACE_GOTO = 4u;
68 /** FLAG_UPDATES_DEST_DIST constant */
70 /** FLAG_SECURITY_DISTANCE constant */
72 /** FLAG_ESCAPING constant */
73 const uint32_t NavigatorInterface::FLAG_ESCAPING = 32u;
74 
75 /** Constructor */
76 NavigatorInterface::NavigatorInterface() : Interface()
77 {
78  data_size = sizeof(NavigatorInterface_data_t);
79  data_ptr = malloc(data_size);
80  data = (NavigatorInterface_data_t *)data_ptr;
81  data_ts = (interface_data_ts_t *)data_ptr;
82  memset(data_ptr, 0, data_size);
83  add_fieldinfo(IFT_UINT32, "flags", 1, &data->flags, "");
84  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x, "");
85  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y, "");
86  add_fieldinfo(IFT_FLOAT, "dest_x", 1, &data->dest_x, "");
87  add_fieldinfo(IFT_FLOAT, "dest_y", 1, &data->dest_y, "");
88  add_fieldinfo(IFT_FLOAT, "dest_ori", 1, &data->dest_ori, "");
89  add_fieldinfo(IFT_FLOAT, "dest_dist", 1, &data->dest_dist, "");
90  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid, "");
91  add_fieldinfo(IFT_BOOL, "final", 1, &data->final, "");
92  add_fieldinfo(IFT_UINT32, "error_code", 1, &data->error_code, "");
93  add_fieldinfo(IFT_FLOAT, "max_velocity", 1, &data->max_velocity, "");
94  add_fieldinfo(IFT_FLOAT, "security_distance", 1, &data->security_distance, "");
95  add_fieldinfo(IFT_BOOL, "escaping_enabled", 1, &data->escaping_enabled, "");
96  add_messageinfo("StopMessage");
97  add_messageinfo("TurnMessage");
98  add_messageinfo("CartesianGotoMessage");
99  add_messageinfo("PolarGotoMessage");
100  add_messageinfo("PlaceGotoMessage");
101  add_messageinfo("ObstacleMessage");
102  add_messageinfo("ResetOdometryMessage");
103  add_messageinfo("SetMaxVelocityMessage");
104  add_messageinfo("SetEscapingMessage");
105  add_messageinfo("SetSecurityDistanceMessage");
106  unsigned char tmp_hash[] = {0x90, 0x6b, 0x4d, 0xeb, 0x52, 0x4d, 0x53, 0x73, 0x4c, 0xbc, 0x82, 0x5, 0x80, 0x81, 0xf1, 0x39};
107  set_hash(tmp_hash);
108 }
109 
110 /** Destructor */
111 NavigatorInterface::~NavigatorInterface()
112 {
113  free(data_ptr);
114 }
115 /* Methods */
116 /** Get flags value.
117  * Bit-wise combination of
118  FLAG_* constants denoting navigator component features.
119  * @return flags value
120  */
121 uint32_t
123 {
124  return data->flags;
125 }
126 
127 /** Get maximum length of flags value.
128  * @return length of flags value, can be length of the array or number of
129  * maximum number of characters for a string
130  */
131 size_t
133 {
134  return 1;
135 }
136 
137 /** Set flags value.
138  * Bit-wise combination of
139  FLAG_* constants denoting navigator component features.
140  * @param new_flags new flags value
141  */
142 void
143 NavigatorInterface::set_flags(const uint32_t new_flags)
144 {
145  data->flags = new_flags;
146  data_changed = true;
147 }
148 
149 /** Get x value.
150  * Current X-coordinate in the navigator coordinate system.
151  * @return x value
152  */
153 float
155 {
156  return data->x;
157 }
158 
159 /** Get maximum length of x value.
160  * @return length of x value, can be length of the array or number of
161  * maximum number of characters for a string
162  */
163 size_t
165 {
166  return 1;
167 }
168 
169 /** Set x value.
170  * Current X-coordinate in the navigator coordinate system.
171  * @param new_x new x value
172  */
173 void
174 NavigatorInterface::set_x(const float new_x)
175 {
176  data->x = new_x;
177  data_changed = true;
178 }
179 
180 /** Get y value.
181  * Current Y-coordinate in the navigator coordinate system.
182  * @return y value
183  */
184 float
186 {
187  return data->y;
188 }
189 
190 /** Get maximum length of y value.
191  * @return length of y value, can be length of the array or number of
192  * maximum number of characters for a string
193  */
194 size_t
196 {
197  return 1;
198 }
199 
200 /** Set y value.
201  * Current Y-coordinate in the navigator coordinate system.
202  * @param new_y new y value
203  */
204 void
205 NavigatorInterface::set_y(const float new_y)
206 {
207  data->y = new_y;
208  data_changed = true;
209 }
210 
211 /** Get dest_x value.
212  * X-coordinate of the current destination, or 0.0 if no target has been set.
213  * @return dest_x value
214  */
215 float
217 {
218  return data->dest_x;
219 }
220 
221 /** Get maximum length of dest_x value.
222  * @return length of dest_x value, can be length of the array or number of
223  * maximum number of characters for a string
224  */
225 size_t
227 {
228  return 1;
229 }
230 
231 /** Set dest_x value.
232  * X-coordinate of the current destination, or 0.0 if no target has been set.
233  * @param new_dest_x new dest_x value
234  */
235 void
236 NavigatorInterface::set_dest_x(const float new_dest_x)
237 {
238  data->dest_x = new_dest_x;
239  data_changed = true;
240 }
241 
242 /** Get dest_y value.
243  * Y-coordinate of the current destination, or 0.0 if no target has been set.
244  * @return dest_y value
245  */
246 float
248 {
249  return data->dest_y;
250 }
251 
252 /** Get maximum length of dest_y value.
253  * @return length of dest_y value, can be length of the array or number of
254  * maximum number of characters for a string
255  */
256 size_t
258 {
259  return 1;
260 }
261 
262 /** Set dest_y value.
263  * Y-coordinate of the current destination, or 0.0 if no target has been set.
264  * @param new_dest_y new dest_y value
265  */
266 void
267 NavigatorInterface::set_dest_y(const float new_dest_y)
268 {
269  data->dest_y = new_dest_y;
270  data_changed = true;
271 }
272 
273 /** Get dest_ori value.
274  * Orientation of the current destination, or 0.0 if no target has been set.
275  * @return dest_ori value
276  */
277 float
279 {
280  return data->dest_ori;
281 }
282 
283 /** Get maximum length of dest_ori value.
284  * @return length of dest_ori value, can be length of the array or number of
285  * maximum number of characters for a string
286  */
287 size_t
289 {
290  return 1;
291 }
292 
293 /** Set dest_ori value.
294  * Orientation of the current destination, or 0.0 if no target has been set.
295  * @param new_dest_ori new dest_ori value
296  */
297 void
298 NavigatorInterface::set_dest_ori(const float new_dest_ori)
299 {
300  data->dest_ori = new_dest_ori;
301  data_changed = true;
302 }
303 
304 /** Get dest_dist value.
305  * Distance to destination in m.
306  * @return dest_dist value
307  */
308 float
310 {
311  return data->dest_dist;
312 }
313 
314 /** Get maximum length of dest_dist value.
315  * @return length of dest_dist value, can be length of the array or number of
316  * maximum number of characters for a string
317  */
318 size_t
320 {
321  return 1;
322 }
323 
324 /** Set dest_dist value.
325  * Distance to destination in m.
326  * @param new_dest_dist new dest_dist value
327  */
328 void
329 NavigatorInterface::set_dest_dist(const float new_dest_dist)
330 {
331  data->dest_dist = new_dest_dist;
332  data_changed = true;
333 }
334 
335 /** Get msgid value.
336  * The ID of the message that is currently being
337  processed, or 0 if no message is being processed.
338  * @return msgid value
339  */
340 uint32_t
342 {
343  return data->msgid;
344 }
345 
346 /** Get maximum length of msgid value.
347  * @return length of msgid value, can be length of the array or number of
348  * maximum number of characters for a string
349  */
350 size_t
352 {
353  return 1;
354 }
355 
356 /** Set msgid value.
357  * The ID of the message that is currently being
358  processed, or 0 if no message is being processed.
359  * @param new_msgid new msgid value
360  */
361 void
362 NavigatorInterface::set_msgid(const uint32_t new_msgid)
363 {
364  data->msgid = new_msgid;
365  data_changed = true;
366 }
367 
368 /** Get final value.
369  * True, if the last goto command has been finished,
370  false if it is still running
371  * @return final value
372  */
373 bool
375 {
376  return data->final;
377 }
378 
379 /** Get maximum length of final value.
380  * @return length of final value, can be length of the array or number of
381  * maximum number of characters for a string
382  */
383 size_t
385 {
386  return 1;
387 }
388 
389 /** Set final value.
390  * True, if the last goto command has been finished,
391  false if it is still running
392  * @param new_final new final value
393  */
394 void
395 NavigatorInterface::set_final(const bool new_final)
396 {
397  data->final = new_final;
398  data_changed = true;
399 }
400 
401 /** Get error_code value.
402  * Failure code set if
403  final is true. 0 if no error occured, an error code from ERROR_*
404  constants otherwise (or a bit-wise combination).
405  * @return error_code value
406  */
407 uint32_t
409 {
410  return data->error_code;
411 }
412 
413 /** Get maximum length of error_code value.
414  * @return length of error_code value, can be length of the array or number of
415  * maximum number of characters for a string
416  */
417 size_t
419 {
420  return 1;
421 }
422 
423 /** Set error_code value.
424  * Failure code set if
425  final is true. 0 if no error occured, an error code from ERROR_*
426  constants otherwise (or a bit-wise combination).
427  * @param new_error_code new error_code value
428  */
429 void
430 NavigatorInterface::set_error_code(const uint32_t new_error_code)
431 {
432  data->error_code = new_error_code;
433  data_changed = true;
434 }
435 
436 /** Get max_velocity value.
437  * Maximum velocity
438  * @return max_velocity value
439  */
440 float
442 {
443  return data->max_velocity;
444 }
445 
446 /** Get maximum length of max_velocity value.
447  * @return length of max_velocity value, can be length of the array or number of
448  * maximum number of characters for a string
449  */
450 size_t
452 {
453  return 1;
454 }
455 
456 /** Set max_velocity value.
457  * Maximum velocity
458  * @param new_max_velocity new max_velocity value
459  */
460 void
461 NavigatorInterface::set_max_velocity(const float new_max_velocity)
462 {
463  data->max_velocity = new_max_velocity;
464  data_changed = true;
465 }
466 
467 /** Get security_distance value.
468  * Security distance to
469  keep to obstacles
470  * @return security_distance value
471  */
472 float
474 {
475  return data->security_distance;
476 }
477 
478 /** Get maximum length of security_distance value.
479  * @return length of security_distance value, can be length of the array or number of
480  * maximum number of characters for a string
481  */
482 size_t
484 {
485  return 1;
486 }
487 
488 /** Set security_distance value.
489  * Security distance to
490  keep to obstacles
491  * @param new_security_distance new security_distance value
492  */
493 void
494 NavigatorInterface::set_security_distance(const float new_security_distance)
495 {
496  data->security_distance = new_security_distance;
497  data_changed = true;
498 }
499 
500 /** Get escaping_enabled value.
501  * This is used for
502  navigation components with integrated collision avoidance, to
503  check whether the navigator should stop when an obstacle
504  obstructs the path, or if it should escape.
505  * @return escaping_enabled value
506  */
507 bool
509 {
510  return data->escaping_enabled;
511 }
512 
513 /** Get maximum length of escaping_enabled value.
514  * @return length of escaping_enabled value, can be length of the array or number of
515  * maximum number of characters for a string
516  */
517 size_t
519 {
520  return 1;
521 }
522 
523 /** Set escaping_enabled value.
524  * This is used for
525  navigation components with integrated collision avoidance, to
526  check whether the navigator should stop when an obstacle
527  obstructs the path, or if it should escape.
528  * @param new_escaping_enabled new escaping_enabled value
529  */
530 void
531 NavigatorInterface::set_escaping_enabled(const bool new_escaping_enabled)
532 {
533  data->escaping_enabled = new_escaping_enabled;
534  data_changed = true;
535 }
536 
537 /* =========== message create =========== */
538 Message *
540 {
541  if ( strncmp("StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
542  return new StopMessage();
543  } else if ( strncmp("TurnMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
544  return new TurnMessage();
545  } else if ( strncmp("CartesianGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
546  return new CartesianGotoMessage();
547  } else if ( strncmp("PolarGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
548  return new PolarGotoMessage();
549  } else if ( strncmp("PlaceGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
550  return new PlaceGotoMessage();
551  } else if ( strncmp("ObstacleMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
552  return new ObstacleMessage();
553  } else if ( strncmp("ResetOdometryMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
554  return new ResetOdometryMessage();
555  } else if ( strncmp("SetMaxVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
556  return new SetMaxVelocityMessage();
557  } else if ( strncmp("SetEscapingMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
558  return new SetEscapingMessage();
559  } else if ( strncmp("SetSecurityDistanceMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
560  return new SetSecurityDistanceMessage();
561  } else {
562  throw UnknownTypeException("The given type '%s' does not match any known "
563  "message type for this interface type.", type);
564  }
565 }
566 
567 
568 /** Copy values from other interface.
569  * @param other other interface to copy values from
570  */
571 void
573 {
574  const NavigatorInterface *oi = dynamic_cast<const NavigatorInterface *>(other);
575  if (oi == NULL) {
576  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
577  type(), other->type());
578  }
579  memcpy(data, oi->data, sizeof(NavigatorInterface_data_t));
580 }
581 
582 const char *
583 NavigatorInterface::enum_tostring(const char *enumtype, int val) const
584 {
585  throw UnknownTypeException("Unknown enum type %s", enumtype);
586 }
587 
588 /* =========== messages =========== */
589 /** @class NavigatorInterface::StopMessage <interfaces/NavigatorInterface.h>
590  * StopMessage Fawkes BlackBoard Interface Message.
591  *
592 
593  */
594 
595 
596 /** Constructor */
598 {
599  data_size = sizeof(StopMessage_data_t);
600  data_ptr = malloc(data_size);
601  memset(data_ptr, 0, data_size);
602  data = (StopMessage_data_t *)data_ptr;
604 }
605 
606 /** Destructor */
608 {
609  free(data_ptr);
610 }
611 
612 /** Copy constructor.
613  * @param m message to copy from
614  */
616 {
617  data_size = m->data_size;
618  data_ptr = malloc(data_size);
619  memcpy(data_ptr, m->data_ptr, data_size);
620  data = (StopMessage_data_t *)data_ptr;
622 }
623 
624 /* Methods */
625 /** Clone this message.
626  * Produces a message of the same type as this message and copies the
627  * data to the new message.
628  * @return clone of this message
629  */
630 Message *
632 {
633  return new NavigatorInterface::StopMessage(this);
634 }
635 /** @class NavigatorInterface::TurnMessage <interfaces/NavigatorInterface.h>
636  * TurnMessage Fawkes BlackBoard Interface Message.
637  *
638 
639  */
640 
641 
642 /** Constructor with initial values.
643  * @param ini_angle initial value for angle
644  * @param ini_velocity initial value for velocity
645  */
646 NavigatorInterface::TurnMessage::TurnMessage(const float ini_angle, const float ini_velocity) : Message("TurnMessage")
647 {
648  data_size = sizeof(TurnMessage_data_t);
649  data_ptr = malloc(data_size);
650  memset(data_ptr, 0, data_size);
651  data = (TurnMessage_data_t *)data_ptr;
653  data->angle = ini_angle;
654  data->velocity = ini_velocity;
655  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle, "");
656  add_fieldinfo(IFT_FLOAT, "velocity", 1, &data->velocity, "");
657 }
658 /** Constructor */
660 {
661  data_size = sizeof(TurnMessage_data_t);
662  data_ptr = malloc(data_size);
663  memset(data_ptr, 0, data_size);
664  data = (TurnMessage_data_t *)data_ptr;
666  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle, "");
667  add_fieldinfo(IFT_FLOAT, "velocity", 1, &data->velocity, "");
668 }
669 
670 /** Destructor */
672 {
673  free(data_ptr);
674 }
675 
676 /** Copy constructor.
677  * @param m message to copy from
678  */
680 {
681  data_size = m->data_size;
682  data_ptr = malloc(data_size);
683  memcpy(data_ptr, m->data_ptr, data_size);
684  data = (TurnMessage_data_t *)data_ptr;
686 }
687 
688 /* Methods */
689 /** Get angle value.
690  * Angle of the turn.
691  * @return angle value
692  */
693 float
695 {
696  return data->angle;
697 }
698 
699 /** Get maximum length of angle value.
700  * @return length of angle value, can be length of the array or number of
701  * maximum number of characters for a string
702  */
703 size_t
705 {
706  return 1;
707 }
708 
709 /** Set angle value.
710  * Angle of the turn.
711  * @param new_angle new angle value
712  */
713 void
715 {
716  data->angle = new_angle;
717 }
718 
719 /** Get velocity value.
720  * The desired turning velocity in rad/s,
721  set to zero to use default value.
722  * @return velocity value
723  */
724 float
726 {
727  return data->velocity;
728 }
729 
730 /** Get maximum length of velocity value.
731  * @return length of velocity value, can be length of the array or number of
732  * maximum number of characters for a string
733  */
734 size_t
736 {
737  return 1;
738 }
739 
740 /** Set velocity value.
741  * The desired turning velocity in rad/s,
742  set to zero to use default value.
743  * @param new_velocity new velocity value
744  */
745 void
747 {
748  data->velocity = new_velocity;
749 }
750 
751 /** Clone this message.
752  * Produces a message of the same type as this message and copies the
753  * data to the new message.
754  * @return clone of this message
755  */
756 Message *
758 {
759  return new NavigatorInterface::TurnMessage(this);
760 }
761 /** @class NavigatorInterface::CartesianGotoMessage <interfaces/NavigatorInterface.h>
762  * CartesianGotoMessage Fawkes BlackBoard Interface Message.
763  *
764 
765  */
766 
767 
768 /** Constructor with initial values.
769  * @param ini_x initial value for x
770  * @param ini_y initial value for y
771  * @param ini_orientation initial value for orientation
772  */
773 NavigatorInterface::CartesianGotoMessage::CartesianGotoMessage(const float ini_x, const float ini_y, const float ini_orientation) : Message("CartesianGotoMessage")
774 {
775  data_size = sizeof(CartesianGotoMessage_data_t);
776  data_ptr = malloc(data_size);
777  memset(data_ptr, 0, data_size);
778  data = (CartesianGotoMessage_data_t *)data_ptr;
780  data->x = ini_x;
781  data->y = ini_y;
782  data->orientation = ini_orientation;
783  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x, "");
784  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y, "");
785  add_fieldinfo(IFT_FLOAT, "orientation", 1, &data->orientation, "");
786 }
787 /** Constructor */
789 {
790  data_size = sizeof(CartesianGotoMessage_data_t);
791  data_ptr = malloc(data_size);
792  memset(data_ptr, 0, data_size);
793  data = (CartesianGotoMessage_data_t *)data_ptr;
795  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x, "");
796  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y, "");
797  add_fieldinfo(IFT_FLOAT, "orientation", 1, &data->orientation, "");
798 }
799 
800 /** Destructor */
802 {
803  free(data_ptr);
804 }
805 
806 /** Copy constructor.
807  * @param m message to copy from
808  */
810 {
811  data_size = m->data_size;
812  data_ptr = malloc(data_size);
813  memcpy(data_ptr, m->data_ptr, data_size);
814  data = (CartesianGotoMessage_data_t *)data_ptr;
816 }
817 
818 /* Methods */
819 /** Get x value.
820  * X-coordinate of the target, in the robot's coordinate system.
821  * @return x value
822  */
823 float
825 {
826  return data->x;
827 }
828 
829 /** Get maximum length of x value.
830  * @return length of x value, can be length of the array or number of
831  * maximum number of characters for a string
832  */
833 size_t
835 {
836  return 1;
837 }
838 
839 /** Set x value.
840  * X-coordinate of the target, in the robot's coordinate system.
841  * @param new_x new x value
842  */
843 void
845 {
846  data->x = new_x;
847 }
848 
849 /** Get y value.
850  * Y-coordinate of the target, in the robot's coordinate system.
851  * @return y value
852  */
853 float
855 {
856  return data->y;
857 }
858 
859 /** Get maximum length of y value.
860  * @return length of y value, can be length of the array or number of
861  * maximum number of characters for a string
862  */
863 size_t
865 {
866  return 1;
867 }
868 
869 /** Set y value.
870  * Y-coordinate of the target, in the robot's coordinate system.
871  * @param new_y new y value
872  */
873 void
875 {
876  data->y = new_y;
877 }
878 
879 /** Get orientation value.
880  * The orientation of the robot at the target.
881  * @return orientation value
882  */
883 float
885 {
886  return data->orientation;
887 }
888 
889 /** Get maximum length of orientation value.
890  * @return length of orientation value, can be length of the array or number of
891  * maximum number of characters for a string
892  */
893 size_t
895 {
896  return 1;
897 }
898 
899 /** Set orientation value.
900  * The orientation of the robot at the target.
901  * @param new_orientation new orientation value
902  */
903 void
905 {
906  data->orientation = new_orientation;
907 }
908 
909 /** Clone this message.
910  * Produces a message of the same type as this message and copies the
911  * data to the new message.
912  * @return clone of this message
913  */
914 Message *
916 {
918 }
919 /** @class NavigatorInterface::PolarGotoMessage <interfaces/NavigatorInterface.h>
920  * PolarGotoMessage Fawkes BlackBoard Interface Message.
921  *
922 
923  */
924 
925 
926 /** Constructor with initial values.
927  * @param ini_phi initial value for phi
928  * @param ini_dist initial value for dist
929  * @param ini_orientation initial value for orientation
930  */
931 NavigatorInterface::PolarGotoMessage::PolarGotoMessage(const float ini_phi, const float ini_dist, const float ini_orientation) : Message("PolarGotoMessage")
932 {
933  data_size = sizeof(PolarGotoMessage_data_t);
934  data_ptr = malloc(data_size);
935  memset(data_ptr, 0, data_size);
936  data = (PolarGotoMessage_data_t *)data_ptr;
938  data->phi = ini_phi;
939  data->dist = ini_dist;
940  data->orientation = ini_orientation;
941  add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi, "");
942  add_fieldinfo(IFT_FLOAT, "dist", 1, &data->dist, "");
943  add_fieldinfo(IFT_FLOAT, "orientation", 1, &data->orientation, "");
944 }
945 /** Constructor */
947 {
948  data_size = sizeof(PolarGotoMessage_data_t);
949  data_ptr = malloc(data_size);
950  memset(data_ptr, 0, data_size);
951  data = (PolarGotoMessage_data_t *)data_ptr;
953  add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi, "");
954  add_fieldinfo(IFT_FLOAT, "dist", 1, &data->dist, "");
955  add_fieldinfo(IFT_FLOAT, "orientation", 1, &data->orientation, "");
956 }
957 
958 /** Destructor */
960 {
961  free(data_ptr);
962 }
963 
964 /** Copy constructor.
965  * @param m message to copy from
966  */
968 {
969  data_size = m->data_size;
970  data_ptr = malloc(data_size);
971  memcpy(data_ptr, m->data_ptr, data_size);
972  data = (PolarGotoMessage_data_t *)data_ptr;
974 }
975 
976 /* Methods */
977 /** Get phi value.
978  * Angle between the robot's front and the target.
979  * @return phi value
980  */
981 float
983 {
984  return data->phi;
985 }
986 
987 /** Get maximum length of phi value.
988  * @return length of phi value, can be length of the array or number of
989  * maximum number of characters for a string
990  */
991 size_t
993 {
994  return 1;
995 }
996 
997 /** Set phi value.
998  * Angle between the robot's front and the target.
999  * @param new_phi new phi value
1000  */
1001 void
1003 {
1004  data->phi = new_phi;
1005 }
1006 
1007 /** Get dist value.
1008  * Distance to the target.
1009  * @return dist value
1010  */
1011 float
1013 {
1014  return data->dist;
1015 }
1016 
1017 /** Get maximum length of dist value.
1018  * @return length of dist value, can be length of the array or number of
1019  * maximum number of characters for a string
1020  */
1021 size_t
1023 {
1024  return 1;
1025 }
1026 
1027 /** Set dist value.
1028  * Distance to the target.
1029  * @param new_dist new dist value
1030  */
1031 void
1033 {
1034  data->dist = new_dist;
1035 }
1036 
1037 /** Get orientation value.
1038  * The orientation of the robot at the target.
1039  * @return orientation value
1040  */
1041 float
1043 {
1044  return data->orientation;
1045 }
1046 
1047 /** Get maximum length of orientation value.
1048  * @return length of orientation value, can be length of the array or number of
1049  * maximum number of characters for a string
1050  */
1051 size_t
1053 {
1054  return 1;
1055 }
1056 
1057 /** Set orientation value.
1058  * The orientation of the robot at the target.
1059  * @param new_orientation new orientation value
1060  */
1061 void
1063 {
1064  data->orientation = new_orientation;
1065 }
1066 
1067 /** Clone this message.
1068  * Produces a message of the same type as this message and copies the
1069  * data to the new message.
1070  * @return clone of this message
1071  */
1072 Message *
1074 {
1075  return new NavigatorInterface::PolarGotoMessage(this);
1076 }
1077 /** @class NavigatorInterface::PlaceGotoMessage <interfaces/NavigatorInterface.h>
1078  * PlaceGotoMessage Fawkes BlackBoard Interface Message.
1079  *
1080 
1081  */
1082 
1083 
1084 /** Constructor with initial values.
1085  * @param ini_place initial value for place
1086  */
1087 NavigatorInterface::PlaceGotoMessage::PlaceGotoMessage(const char * ini_place) : Message("PlaceGotoMessage")
1088 {
1089  data_size = sizeof(PlaceGotoMessage_data_t);
1090  data_ptr = malloc(data_size);
1091  memset(data_ptr, 0, data_size);
1092  data = (PlaceGotoMessage_data_t *)data_ptr;
1094  strncpy(data->place, ini_place, 64);
1095  add_fieldinfo(IFT_STRING, "place", 64, data->place, "");
1096 }
1097 /** Constructor */
1099 {
1100  data_size = sizeof(PlaceGotoMessage_data_t);
1101  data_ptr = malloc(data_size);
1102  memset(data_ptr, 0, data_size);
1103  data = (PlaceGotoMessage_data_t *)data_ptr;
1105  add_fieldinfo(IFT_STRING, "place", 64, data->place, "");
1106 }
1107 
1108 /** Destructor */
1110 {
1111  free(data_ptr);
1112 }
1113 
1114 /** Copy constructor.
1115  * @param m message to copy from
1116  */
1118 {
1119  data_size = m->data_size;
1120  data_ptr = malloc(data_size);
1121  memcpy(data_ptr, m->data_ptr, data_size);
1122  data = (PlaceGotoMessage_data_t *)data_ptr;
1124 }
1125 
1126 /* Methods */
1127 /** Get place value.
1128  * Place to go to.
1129  * @return place value
1130  */
1131 char *
1133 {
1134  return data->place;
1135 }
1136 
1137 /** Get maximum length of place value.
1138  * @return length of place value, can be length of the array or number of
1139  * maximum number of characters for a string
1140  */
1141 size_t
1143 {
1144  return 64;
1145 }
1146 
1147 /** Set place value.
1148  * Place to go to.
1149  * @param new_place new place value
1150  */
1151 void
1153 {
1154  strncpy(data->place, new_place, sizeof(data->place));
1155 }
1156 
1157 /** Clone this message.
1158  * Produces a message of the same type as this message and copies the
1159  * data to the new message.
1160  * @return clone of this message
1161  */
1162 Message *
1164 {
1165  return new NavigatorInterface::PlaceGotoMessage(this);
1166 }
1167 /** @class NavigatorInterface::ObstacleMessage <interfaces/NavigatorInterface.h>
1168  * ObstacleMessage Fawkes BlackBoard Interface Message.
1169  *
1170 
1171  */
1172 
1173 
1174 /** Constructor with initial values.
1175  * @param ini_x initial value for x
1176  * @param ini_y initial value for y
1177  * @param ini_width initial value for width
1178  */
1179 NavigatorInterface::ObstacleMessage::ObstacleMessage(const float ini_x, const float ini_y, const float ini_width) : Message("ObstacleMessage")
1180 {
1181  data_size = sizeof(ObstacleMessage_data_t);
1182  data_ptr = malloc(data_size);
1183  memset(data_ptr, 0, data_size);
1184  data = (ObstacleMessage_data_t *)data_ptr;
1186  data->x = ini_x;
1187  data->y = ini_y;
1188  data->width = ini_width;
1189  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x, "");
1190  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y, "");
1191  add_fieldinfo(IFT_FLOAT, "width", 1, &data->width, "");
1192 }
1193 /** Constructor */
1195 {
1196  data_size = sizeof(ObstacleMessage_data_t);
1197  data_ptr = malloc(data_size);
1198  memset(data_ptr, 0, data_size);
1199  data = (ObstacleMessage_data_t *)data_ptr;
1201  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x, "");
1202  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y, "");
1203  add_fieldinfo(IFT_FLOAT, "width", 1, &data->width, "");
1204 }
1205 
1206 /** Destructor */
1208 {
1209  free(data_ptr);
1210 }
1211 
1212 /** Copy constructor.
1213  * @param m message to copy from
1214  */
1216 {
1217  data_size = m->data_size;
1218  data_ptr = malloc(data_size);
1219  memcpy(data_ptr, m->data_ptr, data_size);
1220  data = (ObstacleMessage_data_t *)data_ptr;
1222 }
1223 
1224 /* Methods */
1225 /** Get x value.
1226  * X-coordinate of the obstacle.
1227  * @return x value
1228  */
1229 float
1231 {
1232  return data->x;
1233 }
1234 
1235 /** Get maximum length of x value.
1236  * @return length of x value, can be length of the array or number of
1237  * maximum number of characters for a string
1238  */
1239 size_t
1241 {
1242  return 1;
1243 }
1244 
1245 /** Set x value.
1246  * X-coordinate of the obstacle.
1247  * @param new_x new x value
1248  */
1249 void
1251 {
1252  data->x = new_x;
1253 }
1254 
1255 /** Get y value.
1256  * Y-coordinate of the obstacle.
1257  * @return y value
1258  */
1259 float
1261 {
1262  return data->y;
1263 }
1264 
1265 /** Get maximum length of y value.
1266  * @return length of y value, can be length of the array or number of
1267  * maximum number of characters for a string
1268  */
1269 size_t
1271 {
1272  return 1;
1273 }
1274 
1275 /** Set y value.
1276  * Y-coordinate of the obstacle.
1277  * @param new_y new y value
1278  */
1279 void
1281 {
1282  data->y = new_y;
1283 }
1284 
1285 /** Get width value.
1286  * Width of the obstacle.
1287  * @return width value
1288  */
1289 float
1291 {
1292  return data->width;
1293 }
1294 
1295 /** Get maximum length of width value.
1296  * @return length of width value, can be length of the array or number of
1297  * maximum number of characters for a string
1298  */
1299 size_t
1301 {
1302  return 1;
1303 }
1304 
1305 /** Set width value.
1306  * Width of the obstacle.
1307  * @param new_width new width value
1308  */
1309 void
1311 {
1312  data->width = new_width;
1313 }
1314 
1315 /** Clone this message.
1316  * Produces a message of the same type as this message and copies the
1317  * data to the new message.
1318  * @return clone of this message
1319  */
1320 Message *
1322 {
1323  return new NavigatorInterface::ObstacleMessage(this);
1324 }
1325 /** @class NavigatorInterface::ResetOdometryMessage <interfaces/NavigatorInterface.h>
1326  * ResetOdometryMessage Fawkes BlackBoard Interface Message.
1327  *
1328 
1329  */
1330 
1331 
1332 /** Constructor */
1334 {
1335  data_size = sizeof(ResetOdometryMessage_data_t);
1336  data_ptr = malloc(data_size);
1337  memset(data_ptr, 0, data_size);
1338  data = (ResetOdometryMessage_data_t *)data_ptr;
1340 }
1341 
1342 /** Destructor */
1344 {
1345  free(data_ptr);
1346 }
1347 
1348 /** Copy constructor.
1349  * @param m message to copy from
1350  */
1352 {
1353  data_size = m->data_size;
1354  data_ptr = malloc(data_size);
1355  memcpy(data_ptr, m->data_ptr, data_size);
1356  data = (ResetOdometryMessage_data_t *)data_ptr;
1358 }
1359 
1360 /* Methods */
1361 /** Clone this message.
1362  * Produces a message of the same type as this message and copies the
1363  * data to the new message.
1364  * @return clone of this message
1365  */
1366 Message *
1368 {
1370 }
1371 /** @class NavigatorInterface::SetMaxVelocityMessage <interfaces/NavigatorInterface.h>
1372  * SetMaxVelocityMessage Fawkes BlackBoard Interface Message.
1373  *
1374 
1375  */
1376 
1377 
1378 /** Constructor with initial values.
1379  * @param ini_max_velocity initial value for max_velocity
1380  */
1381 NavigatorInterface::SetMaxVelocityMessage::SetMaxVelocityMessage(const float ini_max_velocity) : Message("SetMaxVelocityMessage")
1382 {
1383  data_size = sizeof(SetMaxVelocityMessage_data_t);
1384  data_ptr = malloc(data_size);
1385  memset(data_ptr, 0, data_size);
1386  data = (SetMaxVelocityMessage_data_t *)data_ptr;
1388  data->max_velocity = ini_max_velocity;
1389  add_fieldinfo(IFT_FLOAT, "max_velocity", 1, &data->max_velocity, "");
1390 }
1391 /** Constructor */
1393 {
1394  data_size = sizeof(SetMaxVelocityMessage_data_t);
1395  data_ptr = malloc(data_size);
1396  memset(data_ptr, 0, data_size);
1397  data = (SetMaxVelocityMessage_data_t *)data_ptr;
1399  add_fieldinfo(IFT_FLOAT, "max_velocity", 1, &data->max_velocity, "");
1400 }
1401 
1402 /** Destructor */
1404 {
1405  free(data_ptr);
1406 }
1407 
1408 /** Copy constructor.
1409  * @param m message to copy from
1410  */
1412 {
1413  data_size = m->data_size;
1414  data_ptr = malloc(data_size);
1415  memcpy(data_ptr, m->data_ptr, data_size);
1416  data = (SetMaxVelocityMessage_data_t *)data_ptr;
1418 }
1419 
1420 /* Methods */
1421 /** Get max_velocity value.
1422  * Maximum velocity
1423  * @return max_velocity value
1424  */
1425 float
1427 {
1428  return data->max_velocity;
1429 }
1430 
1431 /** Get maximum length of max_velocity value.
1432  * @return length of max_velocity 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 }
1440 
1441 /** Set max_velocity value.
1442  * Maximum velocity
1443  * @param new_max_velocity new max_velocity value
1444  */
1445 void
1447 {
1448  data->max_velocity = new_max_velocity;
1449 }
1450 
1451 /** Clone this message.
1452  * Produces a message of the same type as this message and copies the
1453  * data to the new message.
1454  * @return clone of this message
1455  */
1456 Message *
1458 {
1460 }
1461 /** @class NavigatorInterface::SetEscapingMessage <interfaces/NavigatorInterface.h>
1462  * SetEscapingMessage Fawkes BlackBoard Interface Message.
1463  *
1464 
1465  */
1466 
1467 
1468 /** Constructor with initial values.
1469  * @param ini_escaping_enabled initial value for escaping_enabled
1470  */
1471 NavigatorInterface::SetEscapingMessage::SetEscapingMessage(const bool ini_escaping_enabled) : Message("SetEscapingMessage")
1472 {
1473  data_size = sizeof(SetEscapingMessage_data_t);
1474  data_ptr = malloc(data_size);
1475  memset(data_ptr, 0, data_size);
1476  data = (SetEscapingMessage_data_t *)data_ptr;
1478  data->escaping_enabled = ini_escaping_enabled;
1479  add_fieldinfo(IFT_BOOL, "escaping_enabled", 1, &data->escaping_enabled, "");
1480 }
1481 /** Constructor */
1483 {
1484  data_size = sizeof(SetEscapingMessage_data_t);
1485  data_ptr = malloc(data_size);
1486  memset(data_ptr, 0, data_size);
1487  data = (SetEscapingMessage_data_t *)data_ptr;
1489  add_fieldinfo(IFT_BOOL, "escaping_enabled", 1, &data->escaping_enabled, "");
1490 }
1491 
1492 /** Destructor */
1494 {
1495  free(data_ptr);
1496 }
1497 
1498 /** Copy constructor.
1499  * @param m message to copy from
1500  */
1502 {
1503  data_size = m->data_size;
1504  data_ptr = malloc(data_size);
1505  memcpy(data_ptr, m->data_ptr, data_size);
1506  data = (SetEscapingMessage_data_t *)data_ptr;
1508 }
1509 
1510 /* Methods */
1511 /** Get escaping_enabled value.
1512  * This is used for
1513  navigation components with integrated collision avoidance, to
1514  check whether the navigator should stop when an obstacle
1515  obstructs the path, or if it should escape.
1516  * @return escaping_enabled value
1517  */
1518 bool
1520 {
1521  return data->escaping_enabled;
1522 }
1523 
1524 /** Get maximum length of escaping_enabled value.
1525  * @return length of escaping_enabled value, can be length of the array or number of
1526  * maximum number of characters for a string
1527  */
1528 size_t
1530 {
1531  return 1;
1532 }
1533 
1534 /** Set escaping_enabled value.
1535  * This is used for
1536  navigation components with integrated collision avoidance, to
1537  check whether the navigator should stop when an obstacle
1538  obstructs the path, or if it should escape.
1539  * @param new_escaping_enabled new escaping_enabled value
1540  */
1541 void
1543 {
1544  data->escaping_enabled = new_escaping_enabled;
1545 }
1546 
1547 /** Clone this message.
1548  * Produces a message of the same type as this message and copies the
1549  * data to the new message.
1550  * @return clone of this message
1551  */
1552 Message *
1554 {
1555  return new NavigatorInterface::SetEscapingMessage(this);
1556 }
1557 /** @class NavigatorInterface::SetSecurityDistanceMessage <interfaces/NavigatorInterface.h>
1558  * SetSecurityDistanceMessage Fawkes BlackBoard Interface Message.
1559  *
1560 
1561  */
1562 
1563 
1564 /** Constructor with initial values.
1565  * @param ini_security_distance initial value for security_distance
1566  */
1567 NavigatorInterface::SetSecurityDistanceMessage::SetSecurityDistanceMessage(const float ini_security_distance) : Message("SetSecurityDistanceMessage")
1568 {
1569  data_size = sizeof(SetSecurityDistanceMessage_data_t);
1570  data_ptr = malloc(data_size);
1571  memset(data_ptr, 0, data_size);
1572  data = (SetSecurityDistanceMessage_data_t *)data_ptr;
1574  data->security_distance = ini_security_distance;
1575  add_fieldinfo(IFT_FLOAT, "security_distance", 1, &data->security_distance, "");
1576 }
1577 /** Constructor */
1579 {
1580  data_size = sizeof(SetSecurityDistanceMessage_data_t);
1581  data_ptr = malloc(data_size);
1582  memset(data_ptr, 0, data_size);
1583  data = (SetSecurityDistanceMessage_data_t *)data_ptr;
1585  add_fieldinfo(IFT_FLOAT, "security_distance", 1, &data->security_distance, "");
1586 }
1587 
1588 /** Destructor */
1590 {
1591  free(data_ptr);
1592 }
1593 
1594 /** Copy constructor.
1595  * @param m message to copy from
1596  */
1598 {
1599  data_size = m->data_size;
1600  data_ptr = malloc(data_size);
1601  memcpy(data_ptr, m->data_ptr, data_size);
1602  data = (SetSecurityDistanceMessage_data_t *)data_ptr;
1604 }
1605 
1606 /* Methods */
1607 /** Get security_distance value.
1608  * Security distance to
1609  keep to obstacles
1610  * @return security_distance value
1611  */
1612 float
1614 {
1615  return data->security_distance;
1616 }
1617 
1618 /** Get maximum length of security_distance value.
1619  * @return length of security_distance value, can be length of the array or number of
1620  * maximum number of characters for a string
1621  */
1622 size_t
1624 {
1625  return 1;
1626 }
1627 
1628 /** Set security_distance value.
1629  * Security distance to
1630  keep to obstacles
1631  * @param new_security_distance new security_distance value
1632  */
1633 void
1635 {
1636  data->security_distance = new_security_distance;
1637 }
1638 
1639 /** Clone this message.
1640  * Produces a message of the same type as this message and copies the
1641  * data to the new message.
1642  * @return clone of this message
1643  */
1644 Message *
1646 {
1648 }
1649 /** Check if message is valid and can be enqueued.
1650  * @param message Message to check
1651  * @return true if the message is valid, false otherwise.
1652  */
1653 bool
1655 {
1656  const StopMessage *m0 = dynamic_cast<const StopMessage *>(message);
1657  if ( m0 != NULL ) {
1658  return true;
1659  }
1660  const TurnMessage *m1 = dynamic_cast<const TurnMessage *>(message);
1661  if ( m1 != NULL ) {
1662  return true;
1663  }
1664  const CartesianGotoMessage *m2 = dynamic_cast<const CartesianGotoMessage *>(message);
1665  if ( m2 != NULL ) {
1666  return true;
1667  }
1668  const PolarGotoMessage *m3 = dynamic_cast<const PolarGotoMessage *>(message);
1669  if ( m3 != NULL ) {
1670  return true;
1671  }
1672  const PlaceGotoMessage *m4 = dynamic_cast<const PlaceGotoMessage *>(message);
1673  if ( m4 != NULL ) {
1674  return true;
1675  }
1676  const ObstacleMessage *m5 = dynamic_cast<const ObstacleMessage *>(message);
1677  if ( m5 != NULL ) {
1678  return true;
1679  }
1680  const ResetOdometryMessage *m6 = dynamic_cast<const ResetOdometryMessage *>(message);
1681  if ( m6 != NULL ) {
1682  return true;
1683  }
1684  const SetMaxVelocityMessage *m7 = dynamic_cast<const SetMaxVelocityMessage *>(message);
1685  if ( m7 != NULL ) {
1686  return true;
1687  }
1688  const SetEscapingMessage *m8 = dynamic_cast<const SetEscapingMessage *>(message);
1689  if ( m8 != NULL ) {
1690  return true;
1691  }
1692  const SetSecurityDistanceMessage *m9 = dynamic_cast<const SetSecurityDistanceMessage *>(message);
1693  if ( m9 != NULL ) {
1694  return true;
1695  }
1696  return false;
1697 }
1698 
1699 /// @cond INTERNALS
1700 EXPORT_INTERFACE(NavigatorInterface)
1701 /// @endcond
1702 
1703 
1704 } // end namespace fawkes
size_t maxlenof_y() const
Get maximum length of y value.
size_t maxlenof_security_distance() const
Get maximum length of security_distance value.
size_t maxlenof_escaping_enabled() const
Get maximum length of escaping_enabled value.
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:114
size_t maxlenof_width() const
Get maximum length of width value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:43
float max_velocity() const
Get max_velocity value.
size_t maxlenof_security_distance() const
Get maximum length of security_distance value.
void set_dist(const float new_dist)
Set dist value.
virtual Message * clone() const
Clone this message.
void set_angle(const float new_angle)
Set angle value.
void set_escaping_enabled(const bool new_escaping_enabled)
Set escaping_enabled value.
virtual Message * clone() const
Clone this message.
float y() const
Get y value.
uint32_t flags() const
Get flags value.
size_t maxlenof_dest_ori() const
Get maximum length of dest_ori value.
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:312
const char * type() const
Get message type.
Definition: message.cpp:378
void set_max_velocity(const float new_max_velocity)
Set max_velocity value.
Fawkes library namespace.
ObstacleMessage Fawkes BlackBoard Interface Message.
void set_final(const bool new_final)
Set final value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
Definition: message.h:119
float dest_y() const
Get dest_y value.
static const uint32_t ERROR_MOTOR
ERROR_MOTOR constant.
float security_distance() const
Get security_distance value.
SetSecurityDistanceMessage Fawkes BlackBoard Interface Message.
void set_place(const char *new_place)
Set place value.
static const uint32_t FLAG_CART_GOTO
FLAG_CART_GOTO constant.
void set_escaping_enabled(const bool new_escaping_enabled)
Set escaping_enabled value.
string field
Definition: types.h:45
size_t maxlenof_dest_dist() const
Get maximum length of dest_dist value.
uint32_t msgid() const
Get msgid value.
bool is_final() const
Get final value.
uint32_t error_code() const
Get error_code value.
size_t maxlenof_y() const
Get maximum length of y value.
PolarGotoMessage Fawkes BlackBoard Interface Message.
static const uint32_t ERROR_UNKNOWN_PLACE
ERROR_UNKNOWN_PLACE constant.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
float orientation() const
Get orientation value.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
float dest_ori() const
Get dest_ori value.
size_t maxlenof_max_velocity() const
Get maximum length of max_velocity value.
void set_phi(const float new_phi)
Set phi value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_x() const
Get maximum length of x value.
size_t maxlenof_phi() const
Get maximum length of phi value.
size_t maxlenof_max_velocity() const
Get maximum length of max_velocity value.
static const uint32_t FLAG_POLAR_GOTO
FLAG_POLAR_GOTO constant.
void set_security_distance(const float new_security_distance)
Set security_distance value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:123
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:115
SetEscapingMessage Fawkes BlackBoard Interface Message.
virtual Message * create_message(const char *type) const
Create message based on type name.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
float dest_x() const
Get dest_x value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_orientation() const
Get maximum length of orientation value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:368
void set_orientation(const float new_orientation)
Set orientation value.
size_t maxlenof_orientation() const
Get maximum length of orientation value.
bool is_escaping_enabled() const
Get escaping_enabled value.
size_t maxlenof_y() const
Get maximum length of y value.
size_t maxlenof_dest_y() const
Get maximum length of dest_y value.
size_t maxlenof_velocity() const
Get maximum length of velocity value.
bool data_changed
Indicator if data has changed.
Definition: interface.h:208
PlaceGotoMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_place() const
Get maximum length of place value.
size_t maxlenof_dist() const
Get maximum length of dist value.
float velocity() const
Get velocity value.
size_t maxlenof_angle() const
Get maximum length of angle value.
size_t maxlenof_flags() const
Get maximum length of flags value.
CartesianGotoMessage Fawkes BlackBoard Interface Message.
void set_flags(const uint32_t new_flags)
Set flags value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
bool is_escaping_enabled() const
Get escaping_enabled value.
float security_distance() const
Get security_distance value.
virtual Message * clone() const
Clone this message.
void set_y(const float new_y)
Set y value.
void set_max_velocity(const float new_max_velocity)
Set max_velocity value.
void set_y(const float new_y)
Set y value.
void set_width(const float new_width)
Set width value.
float max_velocity() const
Get max_velocity value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_final() const
Get maximum length of final value.
void set_error_code(const uint32_t new_error_code)
Set error_code value.
float field
Definition: types.h:43
virtual Message * clone() const
Clone this message.
static const uint32_t FLAG_ESCAPING
FLAG_ESCAPING constant.
static const uint32_t ERROR_OBSTRUCTION
ERROR_OBSTRUCTION constant.
size_t maxlenof_escaping_enabled() const
Get maximum length of escaping_enabled value.
float x() const
Get x value.
void set_dest_ori(const float new_dest_ori)
Set dest_ori value.
void set_y(const float new_y)
Set y value.
TurnMessage Fawkes BlackBoard Interface Message.
void set_velocity(const float new_velocity)
Set velocity value.
static const uint32_t FLAG_SECURITY_DISTANCE
FLAG_SECURITY_DISTANCE constant.
void set_security_distance(const float new_security_distance)
Set security_distance value.
void set_dest_dist(const float new_dest_dist)
Set dest_dist value.
void set_orientation(const float new_orientation)
Set orientation value.
void set_dest_x(const float new_dest_x)
Set dest_x value.
void set_x(const float new_x)
Set x value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0)
Add an entry to the info list.
Definition: message.cpp:435
static const uint32_t ERROR_NONE
ERROR_NONE constant.
static const uint32_t FLAG_UPDATES_DEST_DIST
FLAG_UPDATES_DEST_DIST constant.
virtual Message * clone() const
Clone this message.
void set_x(const float new_x)
Set x value.
void set_dest_y(const float new_dest_y)
Set dest_y value.
boolean field
Definition: types.h:34
static const uint32_t FLAG_NONE
FLAG_NONE constant.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
size_t maxlenof_x() const
Get maximum length of x value.
size_t maxlenof_x() const
Get maximum length of x value.
const char * type() const
Get type of interface.
Definition: interface.cpp:635
float orientation() const
Get orientation value.
float dest_dist() const
Get dest_dist value.
void set_x(const float new_x)
Set x value.
float angle() const
Get angle value.
32 bit unsigned integer field
Definition: types.h:40
size_t maxlenof_msgid() const
Get maximum length of msgid value.
SetMaxVelocityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_dest_x() const
Get maximum length of dest_x value.
ResetOdometryMessage Fawkes BlackBoard Interface Message.
static const uint32_t FLAG_PLACE_GOTO
FLAG_PLACE_GOTO constant.
StopMessage Fawkes BlackBoard Interface Message.
NavigatorInterface Fawkes BlackBoard Interface.