Fawkes API  Fawkes Development Version
RobotinoSensorInterface.cpp
1 
2 /***************************************************************************
3  * RobotinoSensorInterface.cpp - Fawkes BlackBoard Interface - RobotinoSensorInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2012-2016 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/RobotinoSensorInterface.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 RobotinoSensorInterface <interfaces/RobotinoSensorInterface.h>
36  * RobotinoSensorInterface Fawkes BlackBoard Interface.
37  * Sensor information of a Robotino robot
38  * @ingroup FawkesInterfaces
39  */
40 
41 
42 
43 /** Constructor */
44 RobotinoSensorInterface::RobotinoSensorInterface() : Interface()
45 {
46  data_size = sizeof(RobotinoSensorInterface_data_t);
47  data_ptr = malloc(data_size);
48  data = (RobotinoSensorInterface_data_t *)data_ptr;
49  data_ts = (interface_data_ts_t *)data_ptr;
50  memset(data_ptr, 0, data_size);
51  add_fieldinfo(IFT_FLOAT, "mot_velocity", 3, &data->mot_velocity);
52  add_fieldinfo(IFT_INT32, "mot_position", 3, &data->mot_position);
53  add_fieldinfo(IFT_FLOAT, "mot_current", 3, &data->mot_current);
54  add_fieldinfo(IFT_BOOL, "bumper", 1, &data->bumper);
55  add_fieldinfo(IFT_FLOAT, "distance", 9, &data->distance);
56  add_fieldinfo(IFT_BOOL, "digital_in", 8, &data->digital_in);
57  add_fieldinfo(IFT_BOOL, "digital_out", 8, &data->digital_out);
58  add_fieldinfo(IFT_FLOAT, "analog_in", 8, &data->analog_in);
59  add_fieldinfo(IFT_BOOL, "bumper_estop_enabled", 1, &data->bumper_estop_enabled);
60  add_messageinfo("SetBumperEStopEnabledMessage");
61  add_messageinfo("SetDigitalOutputMessage");
62  unsigned char tmp_hash[] = {0xa5, 0xb, 0xa1, 0x94, 0xea, 0x39, 0x14, 0x7, 0x98, 0x77, 0x10, 0xc, 0x25, 0x72, 0x57, 0xa0};
63  set_hash(tmp_hash);
64 }
65 
66 /** Destructor */
67 RobotinoSensorInterface::~RobotinoSensorInterface()
68 {
69  free(data_ptr);
70 }
71 /* Methods */
72 /** Get mot_velocity value.
73  * Velocities of the wheels.
74  * @return mot_velocity value
75  */
76 float *
77 RobotinoSensorInterface::mot_velocity() const
78 {
79  return data->mot_velocity;
80 }
81 
82 /** Get mot_velocity value at given index.
83  * Velocities of the wheels.
84  * @param index index of value
85  * @return mot_velocity value
86  * @exception Exception thrown if index is out of bounds
87  */
88 float
89 RobotinoSensorInterface::mot_velocity(unsigned int index) const
90 {
91  if (index > 3) {
92  throw Exception("Index value %u out of bounds (0..3)", index);
93  }
94  return data->mot_velocity[index];
95 }
96 
97 /** Get maximum length of mot_velocity value.
98  * @return length of mot_velocity value, can be length of the array or number of
99  * maximum number of characters for a string
100  */
101 size_t
102 RobotinoSensorInterface::maxlenof_mot_velocity() const
103 {
104  return 3;
105 }
106 
107 /** Set mot_velocity value.
108  * Velocities of the wheels.
109  * @param new_mot_velocity new mot_velocity value
110  */
111 void
112 RobotinoSensorInterface::set_mot_velocity(const float * new_mot_velocity)
113 {
114  memcpy(data->mot_velocity, new_mot_velocity, sizeof(float) * 3);
115  data_changed = true;
116 }
117 
118 /** Set mot_velocity value at given index.
119  * Velocities of the wheels.
120  * @param new_mot_velocity new mot_velocity value
121  * @param index index for of the value
122  */
123 void
124 RobotinoSensorInterface::set_mot_velocity(unsigned int index, const float new_mot_velocity)
125 {
126  if (index > 3) {
127  throw Exception("Index value %u out of bounds (0..3)", index);
128  }
129  data->mot_velocity[index] = new_mot_velocity;
130  data_changed = true;
131 }
132 /** Get mot_position value.
133  * Positions of the wheels.
134  * @return mot_position value
135  */
136 int32_t *
137 RobotinoSensorInterface::mot_position() const
138 {
139  return data->mot_position;
140 }
141 
142 /** Get mot_position value at given index.
143  * Positions of the wheels.
144  * @param index index of value
145  * @return mot_position value
146  * @exception Exception thrown if index is out of bounds
147  */
148 int32_t
149 RobotinoSensorInterface::mot_position(unsigned int index) const
150 {
151  if (index > 3) {
152  throw Exception("Index value %u out of bounds (0..3)", index);
153  }
154  return data->mot_position[index];
155 }
156 
157 /** Get maximum length of mot_position value.
158  * @return length of mot_position value, can be length of the array or number of
159  * maximum number of characters for a string
160  */
161 size_t
162 RobotinoSensorInterface::maxlenof_mot_position() const
163 {
164  return 3;
165 }
166 
167 /** Set mot_position value.
168  * Positions of the wheels.
169  * @param new_mot_position new mot_position value
170  */
171 void
172 RobotinoSensorInterface::set_mot_position(const int32_t * new_mot_position)
173 {
174  memcpy(data->mot_position, new_mot_position, sizeof(int32_t) * 3);
175  data_changed = true;
176 }
177 
178 /** Set mot_position value at given index.
179  * Positions of the wheels.
180  * @param new_mot_position new mot_position value
181  * @param index index for of the value
182  */
183 void
184 RobotinoSensorInterface::set_mot_position(unsigned int index, const int32_t new_mot_position)
185 {
186  if (index > 3) {
187  throw Exception("Index value %u out of bounds (0..3)", index);
188  }
189  data->mot_position[index] = new_mot_position;
190  data_changed = true;
191 }
192 /** Get mot_current value.
193  * Motor currents.
194  * @return mot_current value
195  */
196 float *
197 RobotinoSensorInterface::mot_current() const
198 {
199  return data->mot_current;
200 }
201 
202 /** Get mot_current value at given index.
203  * Motor currents.
204  * @param index index of value
205  * @return mot_current value
206  * @exception Exception thrown if index is out of bounds
207  */
208 float
209 RobotinoSensorInterface::mot_current(unsigned int index) const
210 {
211  if (index > 3) {
212  throw Exception("Index value %u out of bounds (0..3)", index);
213  }
214  return data->mot_current[index];
215 }
216 
217 /** Get maximum length of mot_current value.
218  * @return length of mot_current value, can be length of the array or number of
219  * maximum number of characters for a string
220  */
221 size_t
222 RobotinoSensorInterface::maxlenof_mot_current() const
223 {
224  return 3;
225 }
226 
227 /** Set mot_current value.
228  * Motor currents.
229  * @param new_mot_current new mot_current value
230  */
231 void
232 RobotinoSensorInterface::set_mot_current(const float * new_mot_current)
233 {
234  memcpy(data->mot_current, new_mot_current, sizeof(float) * 3);
235  data_changed = true;
236 }
237 
238 /** Set mot_current value at given index.
239  * Motor currents.
240  * @param new_mot_current new mot_current value
241  * @param index index for of the value
242  */
243 void
244 RobotinoSensorInterface::set_mot_current(unsigned int index, const float new_mot_current)
245 {
246  if (index > 3) {
247  throw Exception("Index value %u out of bounds (0..3)", index);
248  }
249  data->mot_current[index] = new_mot_current;
250  data_changed = true;
251 }
252 /** Get bumper value.
253  * Bumper pressed indicator.
254  * @return bumper value
255  */
256 bool
257 RobotinoSensorInterface::is_bumper() const
258 {
259  return data->bumper;
260 }
261 
262 /** Get maximum length of bumper value.
263  * @return length of bumper value, can be length of the array or number of
264  * maximum number of characters for a string
265  */
266 size_t
267 RobotinoSensorInterface::maxlenof_bumper() const
268 {
269  return 1;
270 }
271 
272 /** Set bumper value.
273  * Bumper pressed indicator.
274  * @param new_bumper new bumper value
275  */
276 void
277 RobotinoSensorInterface::set_bumper(const bool new_bumper)
278 {
279  data->bumper = new_bumper;
280  data_changed = true;
281 }
282 
283 /** Get distance value.
284  * Distance sensor values.
285  * @return distance value
286  */
287 float *
288 RobotinoSensorInterface::distance() const
289 {
290  return data->distance;
291 }
292 
293 /** Get distance value at given index.
294  * Distance sensor values.
295  * @param index index of value
296  * @return distance value
297  * @exception Exception thrown if index is out of bounds
298  */
299 float
300 RobotinoSensorInterface::distance(unsigned int index) const
301 {
302  if (index > 9) {
303  throw Exception("Index value %u out of bounds (0..9)", index);
304  }
305  return data->distance[index];
306 }
307 
308 /** Get maximum length of distance value.
309  * @return length of distance value, can be length of the array or number of
310  * maximum number of characters for a string
311  */
312 size_t
313 RobotinoSensorInterface::maxlenof_distance() const
314 {
315  return 9;
316 }
317 
318 /** Set distance value.
319  * Distance sensor values.
320  * @param new_distance new distance value
321  */
322 void
323 RobotinoSensorInterface::set_distance(const float * new_distance)
324 {
325  memcpy(data->distance, new_distance, sizeof(float) * 9);
326  data_changed = true;
327 }
328 
329 /** Set distance value at given index.
330  * Distance sensor values.
331  * @param new_distance new distance value
332  * @param index index for of the value
333  */
334 void
335 RobotinoSensorInterface::set_distance(unsigned int index, const float new_distance)
336 {
337  if (index > 9) {
338  throw Exception("Index value %u out of bounds (0..9)", index);
339  }
340  data->distance[index] = new_distance;
341  data_changed = true;
342 }
343 /** Get digital_in value.
344  * Digital input values.
345  * @return digital_in value
346  */
347 bool *
348 RobotinoSensorInterface::is_digital_in() const
349 {
350  return data->digital_in;
351 }
352 
353 /** Get digital_in value at given index.
354  * Digital input values.
355  * @param index index of value
356  * @return digital_in value
357  * @exception Exception thrown if index is out of bounds
358  */
359 bool
360 RobotinoSensorInterface::is_digital_in(unsigned int index) const
361 {
362  if (index > 8) {
363  throw Exception("Index value %u out of bounds (0..8)", index);
364  }
365  return data->digital_in[index];
366 }
367 
368 /** Get maximum length of digital_in value.
369  * @return length of digital_in value, can be length of the array or number of
370  * maximum number of characters for a string
371  */
372 size_t
373 RobotinoSensorInterface::maxlenof_digital_in() const
374 {
375  return 8;
376 }
377 
378 /** Set digital_in value.
379  * Digital input values.
380  * @param new_digital_in new digital_in value
381  */
382 void
383 RobotinoSensorInterface::set_digital_in(const bool * new_digital_in)
384 {
385  memcpy(data->digital_in, new_digital_in, sizeof(bool) * 8);
386  data_changed = true;
387 }
388 
389 /** Set digital_in value at given index.
390  * Digital input values.
391  * @param new_digital_in new digital_in value
392  * @param index index for of the value
393  */
394 void
395 RobotinoSensorInterface::set_digital_in(unsigned int index, const bool new_digital_in)
396 {
397  if (index > 8) {
398  throw Exception("Index value %u out of bounds (0..8)", index);
399  }
400  data->digital_in[index] = new_digital_in;
401  data_changed = true;
402 }
403 /** Get digital_out value.
404  * Digital output values.
405  * @return digital_out value
406  */
407 bool *
408 RobotinoSensorInterface::is_digital_out() const
409 {
410  return data->digital_out;
411 }
412 
413 /** Get digital_out value at given index.
414  * Digital output values.
415  * @param index index of value
416  * @return digital_out value
417  * @exception Exception thrown if index is out of bounds
418  */
419 bool
420 RobotinoSensorInterface::is_digital_out(unsigned int index) const
421 {
422  if (index > 8) {
423  throw Exception("Index value %u out of bounds (0..8)", index);
424  }
425  return data->digital_out[index];
426 }
427 
428 /** Get maximum length of digital_out value.
429  * @return length of digital_out value, can be length of the array or number of
430  * maximum number of characters for a string
431  */
432 size_t
433 RobotinoSensorInterface::maxlenof_digital_out() const
434 {
435  return 8;
436 }
437 
438 /** Set digital_out value.
439  * Digital output values.
440  * @param new_digital_out new digital_out value
441  */
442 void
443 RobotinoSensorInterface::set_digital_out(const bool * new_digital_out)
444 {
445  memcpy(data->digital_out, new_digital_out, sizeof(bool) * 8);
446  data_changed = true;
447 }
448 
449 /** Set digital_out value at given index.
450  * Digital output values.
451  * @param new_digital_out new digital_out value
452  * @param index index for of the value
453  */
454 void
455 RobotinoSensorInterface::set_digital_out(unsigned int index, const bool new_digital_out)
456 {
457  if (index > 8) {
458  throw Exception("Index value %u out of bounds (0..8)", index);
459  }
460  data->digital_out[index] = new_digital_out;
461  data_changed = true;
462 }
463 /** Get analog_in value.
464  * Analog input values.
465  * @return analog_in value
466  */
467 float *
468 RobotinoSensorInterface::analog_in() const
469 {
470  return data->analog_in;
471 }
472 
473 /** Get analog_in value at given index.
474  * Analog input values.
475  * @param index index of value
476  * @return analog_in value
477  * @exception Exception thrown if index is out of bounds
478  */
479 float
480 RobotinoSensorInterface::analog_in(unsigned int index) const
481 {
482  if (index > 8) {
483  throw Exception("Index value %u out of bounds (0..8)", index);
484  }
485  return data->analog_in[index];
486 }
487 
488 /** Get maximum length of analog_in value.
489  * @return length of analog_in value, can be length of the array or number of
490  * maximum number of characters for a string
491  */
492 size_t
493 RobotinoSensorInterface::maxlenof_analog_in() const
494 {
495  return 8;
496 }
497 
498 /** Set analog_in value.
499  * Analog input values.
500  * @param new_analog_in new analog_in value
501  */
502 void
503 RobotinoSensorInterface::set_analog_in(const float * new_analog_in)
504 {
505  memcpy(data->analog_in, new_analog_in, sizeof(float) * 8);
506  data_changed = true;
507 }
508 
509 /** Set analog_in value at given index.
510  * Analog input values.
511  * @param new_analog_in new analog_in value
512  * @param index index for of the value
513  */
514 void
515 RobotinoSensorInterface::set_analog_in(unsigned int index, const float new_analog_in)
516 {
517  if (index > 8) {
518  throw Exception("Index value %u out of bounds (0..8)", index);
519  }
520  data->analog_in[index] = new_analog_in;
521  data_changed = true;
522 }
523 /** Get bumper_estop_enabled value.
524  *
525  True if emergency stop on bumper contact is enabled, false otherwise.
526 
527  * @return bumper_estop_enabled value
528  */
529 bool
530 RobotinoSensorInterface::is_bumper_estop_enabled() const
531 {
532  return data->bumper_estop_enabled;
533 }
534 
535 /** Get maximum length of bumper_estop_enabled value.
536  * @return length of bumper_estop_enabled value, can be length of the array or number of
537  * maximum number of characters for a string
538  */
539 size_t
540 RobotinoSensorInterface::maxlenof_bumper_estop_enabled() const
541 {
542  return 1;
543 }
544 
545 /** Set bumper_estop_enabled value.
546  *
547  True if emergency stop on bumper contact is enabled, false otherwise.
548 
549  * @param new_bumper_estop_enabled new bumper_estop_enabled value
550  */
551 void
552 RobotinoSensorInterface::set_bumper_estop_enabled(const bool new_bumper_estop_enabled)
553 {
554  data->bumper_estop_enabled = new_bumper_estop_enabled;
555  data_changed = true;
556 }
557 
558 /* =========== message create =========== */
559 Message *
560 RobotinoSensorInterface::create_message(const char *type) const
561 {
562  if ( strncmp("SetBumperEStopEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
563  return new SetBumperEStopEnabledMessage();
564  } else if ( strncmp("SetDigitalOutputMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
565  return new SetDigitalOutputMessage();
566  } else {
567  throw UnknownTypeException("The given type '%s' does not match any known "
568  "message type for this interface type.", type);
569  }
570 }
571 
572 
573 /** Copy values from other interface.
574  * @param other other interface to copy values from
575  */
576 void
577 RobotinoSensorInterface::copy_values(const Interface *other)
578 {
579  const RobotinoSensorInterface *oi = dynamic_cast<const RobotinoSensorInterface *>(other);
580  if (oi == NULL) {
581  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
582  type(), other->type());
583  }
584  memcpy(data, oi->data, sizeof(RobotinoSensorInterface_data_t));
585 }
586 
587 const char *
588 RobotinoSensorInterface::enum_tostring(const char *enumtype, int val) const
589 {
590  throw UnknownTypeException("Unknown enum type %s", enumtype);
591 }
592 
593 /* =========== messages =========== */
594 /** @class RobotinoSensorInterface::SetBumperEStopEnabledMessage <interfaces/RobotinoSensorInterface.h>
595  * SetBumperEStopEnabledMessage Fawkes BlackBoard Interface Message.
596  *
597 
598  */
599 
600 
601 /** Constructor with initial values.
602  * @param ini_enabled initial value for enabled
603  */
604 RobotinoSensorInterface::SetBumperEStopEnabledMessage::SetBumperEStopEnabledMessage(const bool ini_enabled) : Message("SetBumperEStopEnabledMessage")
605 {
606  data_size = sizeof(SetBumperEStopEnabledMessage_data_t);
607  data_ptr = malloc(data_size);
608  memset(data_ptr, 0, data_size);
609  data = (SetBumperEStopEnabledMessage_data_t *)data_ptr;
611  data->enabled = ini_enabled;
612  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
613 }
614 /** Constructor */
616 {
617  data_size = sizeof(SetBumperEStopEnabledMessage_data_t);
618  data_ptr = malloc(data_size);
619  memset(data_ptr, 0, data_size);
620  data = (SetBumperEStopEnabledMessage_data_t *)data_ptr;
622  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
623 }
624 
625 /** Destructor */
627 {
628  free(data_ptr);
629 }
630 
631 /** Copy constructor.
632  * @param m message to copy from
633  */
635 {
636  data_size = m->data_size;
637  data_ptr = malloc(data_size);
638  memcpy(data_ptr, m->data_ptr, data_size);
639  data = (SetBumperEStopEnabledMessage_data_t *)data_ptr;
641 }
642 
643 /* Methods */
644 /** Get enabled value.
645  *
646  True to enable emergency stop on bumper contact, false to
647  disable. This will persist over OpenRobotino stated restarts.
648 
649  * @return enabled value
650  */
651 bool
653 {
654  return data->enabled;
655 }
656 
657 /** Get maximum length of enabled value.
658  * @return length of enabled value, can be length of the array or number of
659  * maximum number of characters for a string
660  */
661 size_t
663 {
664  return 1;
665 }
666 
667 /** Set enabled value.
668  *
669  True to enable emergency stop on bumper contact, false to
670  disable. This will persist over OpenRobotino stated restarts.
671 
672  * @param new_enabled new enabled value
673  */
674 void
676 {
677  data->enabled = new_enabled;
678 }
679 
680 /** Clone this message.
681  * Produces a message of the same type as this message and copies the
682  * data to the new message.
683  * @return clone of this message
684  */
685 Message *
687 {
689 }
690 /** @class RobotinoSensorInterface::SetDigitalOutputMessage <interfaces/RobotinoSensorInterface.h>
691  * SetDigitalOutputMessage Fawkes BlackBoard Interface Message.
692  *
693 
694  */
695 
696 
697 /** Constructor with initial values.
698  * @param ini_digital_out initial value for digital_out
699  * @param ini_enabled initial value for enabled
700  */
701 RobotinoSensorInterface::SetDigitalOutputMessage::SetDigitalOutputMessage(const uint8_t ini_digital_out, const bool ini_enabled) : Message("SetDigitalOutputMessage")
702 {
703  data_size = sizeof(SetDigitalOutputMessage_data_t);
704  data_ptr = malloc(data_size);
705  memset(data_ptr, 0, data_size);
706  data = (SetDigitalOutputMessage_data_t *)data_ptr;
708  data->digital_out = ini_digital_out;
709  data->enabled = ini_enabled;
710  add_fieldinfo(IFT_UINT8, "digital_out", 1, &data->digital_out);
711  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
712 }
713 /** Constructor */
715 {
716  data_size = sizeof(SetDigitalOutputMessage_data_t);
717  data_ptr = malloc(data_size);
718  memset(data_ptr, 0, data_size);
719  data = (SetDigitalOutputMessage_data_t *)data_ptr;
721  add_fieldinfo(IFT_UINT8, "digital_out", 1, &data->digital_out);
722  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
723 }
724 
725 /** Destructor */
727 {
728  free(data_ptr);
729 }
730 
731 /** Copy constructor.
732  * @param m message to copy from
733  */
735 {
736  data_size = m->data_size;
737  data_ptr = malloc(data_size);
738  memcpy(data_ptr, m->data_ptr, data_size);
739  data = (SetDigitalOutputMessage_data_t *)data_ptr;
741 }
742 
743 /* Methods */
744 /** Get digital_out value.
745  *
746  The number of the digital output to set.
747 
748  * @return digital_out value
749  */
750 uint8_t
752 {
753  return data->digital_out;
754 }
755 
756 /** Get maximum length of digital_out value.
757  * @return length of digital_out value, can be length of the array or number of
758  * maximum number of characters for a string
759  */
760 size_t
762 {
763  return 1;
764 }
765 
766 /** Set digital_out value.
767  *
768  The number of the digital output to set.
769 
770  * @param new_digital_out new digital_out value
771  */
772 void
774 {
775  data->digital_out = new_digital_out;
776 }
777 
778 /** Get enabled value.
779  *
780  True to enable digital out, false to disable.
781 
782  * @return enabled value
783  */
784 bool
786 {
787  return data->enabled;
788 }
789 
790 /** Get maximum length of enabled value.
791  * @return length of enabled value, can be length of the array or number of
792  * maximum number of characters for a string
793  */
794 size_t
796 {
797  return 1;
798 }
799 
800 /** Set enabled value.
801  *
802  True to enable digital out, false to disable.
803 
804  * @param new_enabled new enabled value
805  */
806 void
808 {
809  data->enabled = new_enabled;
810 }
811 
812 /** Clone this message.
813  * Produces a message of the same type as this message and copies the
814  * data to the new message.
815  * @return clone of this message
816  */
817 Message *
819 {
821 }
822 /** Check if message is valid and can be enqueued.
823  * @param message Message to check
824  * @return true if the message is valid, false otherwise.
825  */
826 bool
828 {
829  const SetBumperEStopEnabledMessage *m0 = dynamic_cast<const SetBumperEStopEnabledMessage *>(message);
830  if ( m0 != NULL ) {
831  return true;
832  }
833  const SetDigitalOutputMessage *m1 = dynamic_cast<const SetDigitalOutputMessage *>(message);
834  if ( m1 != NULL ) {
835  return true;
836  }
837  return false;
838 }
839 
840 /// @cond INTERNALS
841 EXPORT_INTERFACE(RobotinoSensorInterface)
842 /// @endcond
843 
844 
845 } // end namespace fawkes
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:124
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
Fawkes library namespace.
8 bit unsigned integer field
Definition: types.h:38
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
Definition: message.h:129
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
void set_enabled(const bool new_enabled)
Set enabled 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:133
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:125
RobotinoSensorInterface Fawkes BlackBoard Interface.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
void set_enabled(const bool new_enabled)
Set enabled value.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
Base class for exceptions in Fawkes.
Definition: exception.h:36
virtual Message * clone() const
Clone this message.
SetBumperEStopEnabledMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_digital_out() const
Get maximum length of digital_out value.
void set_digital_out(const uint8_t new_digital_out)
Set digital_out value.
SetDigitalOutputMessage Fawkes BlackBoard Interface Message.
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:436
boolean field
Definition: types.h:36
size_t maxlenof_enabled() const
Get maximum length of enabled value.