Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PanTiltInterface.cpp
1 
2 /***************************************************************************
3  * PanTiltInterface.cpp - Fawkes BlackBoard Interface - PanTiltInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2009 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/PanTiltInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <cstring>
29 #include <cstdlib>
30 
31 namespace fawkes {
32 
33 /** @class PanTiltInterface <interfaces/PanTiltInterface.h>
34  * PanTiltInterface Fawkes BlackBoard Interface.
35  *
36  Interface to access pan/tilt units.
37 
38  * @ingroup FawkesInterfaces
39  */
40 
41 
42 /** FLAG_SUPPORTS_PAN constant */
43 const uint32_t PanTiltInterface::FLAG_SUPPORTS_PAN = 1u;
44 /** FLAG_SUPPORTS_TILT constant */
45 const uint32_t PanTiltInterface::FLAG_SUPPORTS_TILT = 2u;
46 /** ERROR_NONE constant */
47 const uint32_t PanTiltInterface::ERROR_NONE = 0u;
48 /** ERROR_UNSPECIFIC constant */
49 const uint32_t PanTiltInterface::ERROR_UNSPECIFIC = 1u;
50 /** ERROR_COMMUNICATION constant */
51 const uint32_t PanTiltInterface::ERROR_COMMUNICATION = 2u;
52 /** ERROR_PAN_OUTOFRANGE constant */
53 const uint32_t PanTiltInterface::ERROR_PAN_OUTOFRANGE = 4u;
54 /** ERROR_TILT_OUTOFRANGE constant */
55 const uint32_t PanTiltInterface::ERROR_TILT_OUTOFRANGE = 8u;
56 
57 /** Constructor */
58 PanTiltInterface::PanTiltInterface() : Interface()
59 {
60  data_size = sizeof(PanTiltInterface_data_t);
61  data_ptr = malloc(data_size);
62  data = (PanTiltInterface_data_t *)data_ptr;
63  data_ts = (interface_data_ts_t *)data_ptr;
64  memset(data_ptr, 0, data_size);
65  add_fieldinfo(IFT_UINT32, "flags", 1, &data->flags);
66  add_fieldinfo(IFT_FLOAT, "pan", 1, &data->pan);
67  add_fieldinfo(IFT_FLOAT, "tilt", 1, &data->tilt);
68  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
69  add_fieldinfo(IFT_BOOL, "final", 1, &data->final);
70  add_fieldinfo(IFT_UINT32, "error_code", 1, &data->error_code);
71  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
72  add_fieldinfo(IFT_BOOL, "calibrated", 1, &data->calibrated);
73  add_fieldinfo(IFT_FLOAT, "min_pan", 1, &data->min_pan);
74  add_fieldinfo(IFT_FLOAT, "max_pan", 1, &data->max_pan);
75  add_fieldinfo(IFT_FLOAT, "min_tilt", 1, &data->min_tilt);
76  add_fieldinfo(IFT_FLOAT, "max_tilt", 1, &data->max_tilt);
77  add_fieldinfo(IFT_FLOAT, "max_pan_velocity", 1, &data->max_pan_velocity);
78  add_fieldinfo(IFT_FLOAT, "max_tilt_velocity", 1, &data->max_tilt_velocity);
79  add_fieldinfo(IFT_FLOAT, "pan_velocity", 1, &data->pan_velocity);
80  add_fieldinfo(IFT_FLOAT, "tilt_velocity", 1, &data->tilt_velocity);
81  add_fieldinfo(IFT_FLOAT, "pan_margin", 1, &data->pan_margin);
82  add_fieldinfo(IFT_FLOAT, "tilt_margin", 1, &data->tilt_margin);
83  add_messageinfo("StopMessage");
84  add_messageinfo("FlushMessage");
85  add_messageinfo("CalibrateMessage");
86  add_messageinfo("ParkMessage");
87  add_messageinfo("GotoMessage");
88  add_messageinfo("TimedGotoMessage");
89  add_messageinfo("SetEnabledMessage");
90  add_messageinfo("SetVelocityMessage");
91  add_messageinfo("SetMarginMessage");
92  unsigned char tmp_hash[] = {0x3, 0xd7, 0x3b, 0xa8, 0x9f, 0x6d, 00, 0xb9, 0xf5, 0xf2, 0x2f, 0x92, 0x25, 0x1b, 0x87, 0x8e};
93  set_hash(tmp_hash);
94 }
95 
96 /** Destructor */
97 PanTiltInterface::~PanTiltInterface()
98 {
99  free(data_ptr);
100 }
101 /* Methods */
102 /** Get flags value.
103  * Flags.
104  * @return flags value
105  */
106 uint32_t
107 PanTiltInterface::flags() const
108 {
109  return data->flags;
110 }
111 
112 /** Get maximum length of flags value.
113  * @return length of flags value, can be length of the array or number of
114  * maximum number of characters for a string
115  */
116 size_t
117 PanTiltInterface::maxlenof_flags() const
118 {
119  return 1;
120 }
121 
122 /** Set flags value.
123  * Flags.
124  * @param new_flags new flags value
125  */
126 void
127 PanTiltInterface::set_flags(const uint32_t new_flags)
128 {
129  data->flags = new_flags;
130  data_changed = true;
131 }
132 
133 /** Get pan value.
134  * Current pan.
135  * @return pan value
136  */
137 float
138 PanTiltInterface::pan() const
139 {
140  return data->pan;
141 }
142 
143 /** Get maximum length of pan value.
144  * @return length of pan value, can be length of the array or number of
145  * maximum number of characters for a string
146  */
147 size_t
148 PanTiltInterface::maxlenof_pan() const
149 {
150  return 1;
151 }
152 
153 /** Set pan value.
154  * Current pan.
155  * @param new_pan new pan value
156  */
157 void
158 PanTiltInterface::set_pan(const float new_pan)
159 {
160  data->pan = new_pan;
161  data_changed = true;
162 }
163 
164 /** Get tilt value.
165  * Current tilt.
166  * @return tilt value
167  */
168 float
169 PanTiltInterface::tilt() const
170 {
171  return data->tilt;
172 }
173 
174 /** Get maximum length of tilt value.
175  * @return length of tilt value, can be length of the array or number of
176  * maximum number of characters for a string
177  */
178 size_t
179 PanTiltInterface::maxlenof_tilt() const
180 {
181  return 1;
182 }
183 
184 /** Set tilt value.
185  * Current tilt.
186  * @param new_tilt new tilt value
187  */
188 void
189 PanTiltInterface::set_tilt(const float new_tilt)
190 {
191  data->tilt = new_tilt;
192  data_changed = true;
193 }
194 
195 /** Get msgid value.
196  * The ID of the message that is currently being
197  processed, or 0 if no message is being processed.
198  * @return msgid value
199  */
200 uint32_t
201 PanTiltInterface::msgid() const
202 {
203  return data->msgid;
204 }
205 
206 /** Get maximum length of msgid value.
207  * @return length of msgid value, can be length of the array or number of
208  * maximum number of characters for a string
209  */
210 size_t
211 PanTiltInterface::maxlenof_msgid() const
212 {
213  return 1;
214 }
215 
216 /** Set msgid value.
217  * The ID of the message that is currently being
218  processed, or 0 if no message is being processed.
219  * @param new_msgid new msgid value
220  */
221 void
222 PanTiltInterface::set_msgid(const uint32_t new_msgid)
223 {
224  data->msgid = new_msgid;
225  data_changed = true;
226 }
227 
228 /** Get final value.
229  * True, if the last goto command has been finished,
230  false if it is still running
231  * @return final value
232  */
233 bool
234 PanTiltInterface::is_final() const
235 {
236  return data->final;
237 }
238 
239 /** Get maximum length of final value.
240  * @return length of final value, can be length of the array or number of
241  * maximum number of characters for a string
242  */
243 size_t
244 PanTiltInterface::maxlenof_final() const
245 {
246  return 1;
247 }
248 
249 /** Set final value.
250  * True, if the last goto command has been finished,
251  false if it is still running
252  * @param new_final new final value
253  */
254 void
255 PanTiltInterface::set_final(const bool new_final)
256 {
257  data->final = new_final;
258  data_changed = true;
259 }
260 
261 /** Get error_code value.
262  * Failure code set if
263  final is true. 0 if no error occured, an error code from ERROR_*
264  constants otherwise (or a bit-wise combination).
265  * @return error_code value
266  */
267 uint32_t
268 PanTiltInterface::error_code() const
269 {
270  return data->error_code;
271 }
272 
273 /** Get maximum length of error_code value.
274  * @return length of error_code value, can be length of the array or number of
275  * maximum number of characters for a string
276  */
277 size_t
278 PanTiltInterface::maxlenof_error_code() const
279 {
280  return 1;
281 }
282 
283 /** Set error_code value.
284  * Failure code set if
285  final is true. 0 if no error occured, an error code from ERROR_*
286  constants otherwise (or a bit-wise combination).
287  * @param new_error_code new error_code value
288  */
289 void
290 PanTiltInterface::set_error_code(const uint32_t new_error_code)
291 {
292  data->error_code = new_error_code;
293  data_changed = true;
294 }
295 
296 /** Get enabled value.
297  * Is the pan/tilt unit enabled?
298  * @return enabled value
299  */
300 bool
301 PanTiltInterface::is_enabled() const
302 {
303  return data->enabled;
304 }
305 
306 /** Get maximum length of enabled value.
307  * @return length of enabled value, can be length of the array or number of
308  * maximum number of characters for a string
309  */
310 size_t
311 PanTiltInterface::maxlenof_enabled() const
312 {
313  return 1;
314 }
315 
316 /** Set enabled value.
317  * Is the pan/tilt unit enabled?
318  * @param new_enabled new enabled value
319  */
320 void
321 PanTiltInterface::set_enabled(const bool new_enabled)
322 {
323  data->enabled = new_enabled;
324  data_changed = true;
325 }
326 
327 /** Get calibrated value.
328  * Is the pan/tilt unit calibrated?
329  * @return calibrated value
330  */
331 bool
332 PanTiltInterface::is_calibrated() const
333 {
334  return data->calibrated;
335 }
336 
337 /** Get maximum length of calibrated value.
338  * @return length of calibrated value, can be length of the array or number of
339  * maximum number of characters for a string
340  */
341 size_t
342 PanTiltInterface::maxlenof_calibrated() const
343 {
344  return 1;
345 }
346 
347 /** Set calibrated value.
348  * Is the pan/tilt unit calibrated?
349  * @param new_calibrated new calibrated value
350  */
351 void
352 PanTiltInterface::set_calibrated(const bool new_calibrated)
353 {
354  data->calibrated = new_calibrated;
355  data_changed = true;
356 }
357 
358 /** Get min_pan value.
359  * Minimum pan possible.
360  * @return min_pan value
361  */
362 float
363 PanTiltInterface::min_pan() const
364 {
365  return data->min_pan;
366 }
367 
368 /** Get maximum length of min_pan value.
369  * @return length of min_pan value, can be length of the array or number of
370  * maximum number of characters for a string
371  */
372 size_t
373 PanTiltInterface::maxlenof_min_pan() const
374 {
375  return 1;
376 }
377 
378 /** Set min_pan value.
379  * Minimum pan possible.
380  * @param new_min_pan new min_pan value
381  */
382 void
383 PanTiltInterface::set_min_pan(const float new_min_pan)
384 {
385  data->min_pan = new_min_pan;
386  data_changed = true;
387 }
388 
389 /** Get max_pan value.
390  * Maximum pan possible.
391  * @return max_pan value
392  */
393 float
394 PanTiltInterface::max_pan() const
395 {
396  return data->max_pan;
397 }
398 
399 /** Get maximum length of max_pan value.
400  * @return length of max_pan value, can be length of the array or number of
401  * maximum number of characters for a string
402  */
403 size_t
404 PanTiltInterface::maxlenof_max_pan() const
405 {
406  return 1;
407 }
408 
409 /** Set max_pan value.
410  * Maximum pan possible.
411  * @param new_max_pan new max_pan value
412  */
413 void
414 PanTiltInterface::set_max_pan(const float new_max_pan)
415 {
416  data->max_pan = new_max_pan;
417  data_changed = true;
418 }
419 
420 /** Get min_tilt value.
421  * Minimum tilt possible.
422  * @return min_tilt value
423  */
424 float
425 PanTiltInterface::min_tilt() const
426 {
427  return data->min_tilt;
428 }
429 
430 /** Get maximum length of min_tilt value.
431  * @return length of min_tilt value, can be length of the array or number of
432  * maximum number of characters for a string
433  */
434 size_t
435 PanTiltInterface::maxlenof_min_tilt() const
436 {
437  return 1;
438 }
439 
440 /** Set min_tilt value.
441  * Minimum tilt possible.
442  * @param new_min_tilt new min_tilt value
443  */
444 void
445 PanTiltInterface::set_min_tilt(const float new_min_tilt)
446 {
447  data->min_tilt = new_min_tilt;
448  data_changed = true;
449 }
450 
451 /** Get max_tilt value.
452  * Maximum tilt possible.
453  * @return max_tilt value
454  */
455 float
456 PanTiltInterface::max_tilt() const
457 {
458  return data->max_tilt;
459 }
460 
461 /** Get maximum length of max_tilt value.
462  * @return length of max_tilt value, can be length of the array or number of
463  * maximum number of characters for a string
464  */
465 size_t
466 PanTiltInterface::maxlenof_max_tilt() const
467 {
468  return 1;
469 }
470 
471 /** Set max_tilt value.
472  * Maximum tilt possible.
473  * @param new_max_tilt new max_tilt value
474  */
475 void
476 PanTiltInterface::set_max_tilt(const float new_max_tilt)
477 {
478  data->max_tilt = new_max_tilt;
479  data_changed = true;
480 }
481 
482 /** Get max_pan_velocity value.
483  * Maximum supported pan velocity.
484  * @return max_pan_velocity value
485  */
486 float
487 PanTiltInterface::max_pan_velocity() const
488 {
489  return data->max_pan_velocity;
490 }
491 
492 /** Get maximum length of max_pan_velocity value.
493  * @return length of max_pan_velocity value, can be length of the array or number of
494  * maximum number of characters for a string
495  */
496 size_t
497 PanTiltInterface::maxlenof_max_pan_velocity() const
498 {
499  return 1;
500 }
501 
502 /** Set max_pan_velocity value.
503  * Maximum supported pan velocity.
504  * @param new_max_pan_velocity new max_pan_velocity value
505  */
506 void
507 PanTiltInterface::set_max_pan_velocity(const float new_max_pan_velocity)
508 {
509  data->max_pan_velocity = new_max_pan_velocity;
510  data_changed = true;
511 }
512 
513 /** Get max_tilt_velocity value.
514  * Maximum supported tilt velocity.
515  * @return max_tilt_velocity value
516  */
517 float
518 PanTiltInterface::max_tilt_velocity() const
519 {
520  return data->max_tilt_velocity;
521 }
522 
523 /** Get maximum length of max_tilt_velocity value.
524  * @return length of max_tilt_velocity value, can be length of the array or number of
525  * maximum number of characters for a string
526  */
527 size_t
528 PanTiltInterface::maxlenof_max_tilt_velocity() const
529 {
530  return 1;
531 }
532 
533 /** Set max_tilt_velocity value.
534  * Maximum supported tilt velocity.
535  * @param new_max_tilt_velocity new max_tilt_velocity value
536  */
537 void
538 PanTiltInterface::set_max_tilt_velocity(const float new_max_tilt_velocity)
539 {
540  data->max_tilt_velocity = new_max_tilt_velocity;
541  data_changed = true;
542 }
543 
544 /** Get pan_velocity value.
545  * Maximum pan velocity currently reached.
546  * @return pan_velocity value
547  */
548 float
549 PanTiltInterface::pan_velocity() const
550 {
551  return data->pan_velocity;
552 }
553 
554 /** Get maximum length of pan_velocity value.
555  * @return length of pan_velocity value, can be length of the array or number of
556  * maximum number of characters for a string
557  */
558 size_t
559 PanTiltInterface::maxlenof_pan_velocity() const
560 {
561  return 1;
562 }
563 
564 /** Set pan_velocity value.
565  * Maximum pan velocity currently reached.
566  * @param new_pan_velocity new pan_velocity value
567  */
568 void
569 PanTiltInterface::set_pan_velocity(const float new_pan_velocity)
570 {
571  data->pan_velocity = new_pan_velocity;
572  data_changed = true;
573 }
574 
575 /** Get tilt_velocity value.
576  * Maximum tilt velocity currently reached.
577  * @return tilt_velocity value
578  */
579 float
580 PanTiltInterface::tilt_velocity() const
581 {
582  return data->tilt_velocity;
583 }
584 
585 /** Get maximum length of tilt_velocity value.
586  * @return length of tilt_velocity value, can be length of the array or number of
587  * maximum number of characters for a string
588  */
589 size_t
590 PanTiltInterface::maxlenof_tilt_velocity() const
591 {
592  return 1;
593 }
594 
595 /** Set tilt_velocity value.
596  * Maximum tilt velocity currently reached.
597  * @param new_tilt_velocity new tilt_velocity value
598  */
599 void
600 PanTiltInterface::set_tilt_velocity(const float new_tilt_velocity)
601 {
602  data->tilt_velocity = new_tilt_velocity;
603  data_changed = true;
604 }
605 
606 /** Get pan_margin value.
607  * Margin in radians around a
608  target pan value to consider the motion as final.
609  * @return pan_margin value
610  */
611 float
612 PanTiltInterface::pan_margin() const
613 {
614  return data->pan_margin;
615 }
616 
617 /** Get maximum length of pan_margin value.
618  * @return length of pan_margin value, can be length of the array or number of
619  * maximum number of characters for a string
620  */
621 size_t
622 PanTiltInterface::maxlenof_pan_margin() const
623 {
624  return 1;
625 }
626 
627 /** Set pan_margin value.
628  * Margin in radians around a
629  target pan value to consider the motion as final.
630  * @param new_pan_margin new pan_margin value
631  */
632 void
633 PanTiltInterface::set_pan_margin(const float new_pan_margin)
634 {
635  data->pan_margin = new_pan_margin;
636  data_changed = true;
637 }
638 
639 /** Get tilt_margin value.
640  * Margin in radians around a
641  target tilt value to consider the motion as final.
642  * @return tilt_margin value
643  */
644 float
645 PanTiltInterface::tilt_margin() const
646 {
647  return data->tilt_margin;
648 }
649 
650 /** Get maximum length of tilt_margin value.
651  * @return length of tilt_margin value, can be length of the array or number of
652  * maximum number of characters for a string
653  */
654 size_t
655 PanTiltInterface::maxlenof_tilt_margin() const
656 {
657  return 1;
658 }
659 
660 /** Set tilt_margin value.
661  * Margin in radians around a
662  target tilt value to consider the motion as final.
663  * @param new_tilt_margin new tilt_margin value
664  */
665 void
666 PanTiltInterface::set_tilt_margin(const float new_tilt_margin)
667 {
668  data->tilt_margin = new_tilt_margin;
669  data_changed = true;
670 }
671 
672 /* =========== message create =========== */
673 Message *
674 PanTiltInterface::create_message(const char *type) const
675 {
676  if ( strncmp("StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
677  return new StopMessage();
678  } else if ( strncmp("FlushMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
679  return new FlushMessage();
680  } else if ( strncmp("CalibrateMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
681  return new CalibrateMessage();
682  } else if ( strncmp("ParkMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
683  return new ParkMessage();
684  } else if ( strncmp("GotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
685  return new GotoMessage();
686  } else if ( strncmp("TimedGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
687  return new TimedGotoMessage();
688  } else if ( strncmp("SetEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
689  return new SetEnabledMessage();
690  } else if ( strncmp("SetVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
691  return new SetVelocityMessage();
692  } else if ( strncmp("SetMarginMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
693  return new SetMarginMessage();
694  } else {
695  throw UnknownTypeException("The given type '%s' does not match any known "
696  "message type for this interface type.", type);
697  }
698 }
699 
700 
701 /** Copy values from other interface.
702  * @param other other interface to copy values from
703  */
704 void
705 PanTiltInterface::copy_values(const Interface *other)
706 {
707  const PanTiltInterface *oi = dynamic_cast<const PanTiltInterface *>(other);
708  if (oi == NULL) {
709  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
710  type(), other->type());
711  }
712  memcpy(data, oi->data, sizeof(PanTiltInterface_data_t));
713 }
714 
715 const char *
716 PanTiltInterface::enum_tostring(const char *enumtype, int val) const
717 {
718  throw UnknownTypeException("Unknown enum type %s", enumtype);
719 }
720 
721 /* =========== messages =========== */
722 /** @class PanTiltInterface::StopMessage <interfaces/PanTiltInterface.h>
723  * StopMessage Fawkes BlackBoard Interface Message.
724  *
725 
726  */
727 
728 
729 /** Constructor */
730 PanTiltInterface::StopMessage::StopMessage() : Message("StopMessage")
731 {
732  data_size = sizeof(StopMessage_data_t);
733  data_ptr = malloc(data_size);
734  memset(data_ptr, 0, data_size);
735  data = (StopMessage_data_t *)data_ptr;
737 }
738 
739 /** Destructor */
741 {
742  free(data_ptr);
743 }
744 
745 /** Copy constructor.
746  * @param m message to copy from
747  */
749 {
750  data_size = m->data_size;
751  data_ptr = malloc(data_size);
752  memcpy(data_ptr, m->data_ptr, data_size);
753  data = (StopMessage_data_t *)data_ptr;
755 }
756 
757 /* Methods */
758 /** Clone this message.
759  * Produces a message of the same type as this message and copies the
760  * data to the new message.
761  * @return clone of this message
762  */
763 Message *
765 {
766  return new PanTiltInterface::StopMessage(this);
767 }
768 /** @class PanTiltInterface::FlushMessage <interfaces/PanTiltInterface.h>
769  * FlushMessage Fawkes BlackBoard Interface Message.
770  *
771 
772  */
773 
774 
775 /** Constructor */
777 {
778  data_size = sizeof(FlushMessage_data_t);
779  data_ptr = malloc(data_size);
780  memset(data_ptr, 0, data_size);
781  data = (FlushMessage_data_t *)data_ptr;
783 }
784 
785 /** Destructor */
787 {
788  free(data_ptr);
789 }
790 
791 /** Copy constructor.
792  * @param m message to copy from
793  */
795 {
796  data_size = m->data_size;
797  data_ptr = malloc(data_size);
798  memcpy(data_ptr, m->data_ptr, data_size);
799  data = (FlushMessage_data_t *)data_ptr;
801 }
802 
803 /* Methods */
804 /** Clone this message.
805  * Produces a message of the same type as this message and copies the
806  * data to the new message.
807  * @return clone of this message
808  */
809 Message *
811 {
812  return new PanTiltInterface::FlushMessage(this);
813 }
814 /** @class PanTiltInterface::CalibrateMessage <interfaces/PanTiltInterface.h>
815  * CalibrateMessage Fawkes BlackBoard Interface Message.
816  *
817 
818  */
819 
820 
821 /** Constructor */
823 {
824  data_size = sizeof(CalibrateMessage_data_t);
825  data_ptr = malloc(data_size);
826  memset(data_ptr, 0, data_size);
827  data = (CalibrateMessage_data_t *)data_ptr;
829 }
830 
831 /** Destructor */
833 {
834  free(data_ptr);
835 }
836 
837 /** Copy constructor.
838  * @param m message to copy from
839  */
841 {
842  data_size = m->data_size;
843  data_ptr = malloc(data_size);
844  memcpy(data_ptr, m->data_ptr, data_size);
845  data = (CalibrateMessage_data_t *)data_ptr;
847 }
848 
849 /* Methods */
850 /** Clone this message.
851  * Produces a message of the same type as this message and copies the
852  * data to the new message.
853  * @return clone of this message
854  */
855 Message *
857 {
858  return new PanTiltInterface::CalibrateMessage(this);
859 }
860 /** @class PanTiltInterface::ParkMessage <interfaces/PanTiltInterface.h>
861  * ParkMessage Fawkes BlackBoard Interface Message.
862  *
863 
864  */
865 
866 
867 /** Constructor */
869 {
870  data_size = sizeof(ParkMessage_data_t);
871  data_ptr = malloc(data_size);
872  memset(data_ptr, 0, data_size);
873  data = (ParkMessage_data_t *)data_ptr;
875 }
876 
877 /** Destructor */
879 {
880  free(data_ptr);
881 }
882 
883 /** Copy constructor.
884  * @param m message to copy from
885  */
887 {
888  data_size = m->data_size;
889  data_ptr = malloc(data_size);
890  memcpy(data_ptr, m->data_ptr, data_size);
891  data = (ParkMessage_data_t *)data_ptr;
893 }
894 
895 /* Methods */
896 /** Clone this message.
897  * Produces a message of the same type as this message and copies the
898  * data to the new message.
899  * @return clone of this message
900  */
901 Message *
903 {
904  return new PanTiltInterface::ParkMessage(this);
905 }
906 /** @class PanTiltInterface::GotoMessage <interfaces/PanTiltInterface.h>
907  * GotoMessage Fawkes BlackBoard Interface Message.
908  *
909 
910  */
911 
912 
913 /** Constructor with initial values.
914  * @param ini_pan initial value for pan
915  * @param ini_tilt initial value for tilt
916  */
917 PanTiltInterface::GotoMessage::GotoMessage(const float ini_pan, const float ini_tilt) : Message("GotoMessage")
918 {
919  data_size = sizeof(GotoMessage_data_t);
920  data_ptr = malloc(data_size);
921  memset(data_ptr, 0, data_size);
922  data = (GotoMessage_data_t *)data_ptr;
924  data->pan = ini_pan;
925  data->tilt = ini_tilt;
926  add_fieldinfo(IFT_FLOAT, "pan", 1, &data->pan);
927  add_fieldinfo(IFT_FLOAT, "tilt", 1, &data->tilt);
928 }
929 /** Constructor */
931 {
932  data_size = sizeof(GotoMessage_data_t);
933  data_ptr = malloc(data_size);
934  memset(data_ptr, 0, data_size);
935  data = (GotoMessage_data_t *)data_ptr;
937  add_fieldinfo(IFT_FLOAT, "pan", 1, &data->pan);
938  add_fieldinfo(IFT_FLOAT, "tilt", 1, &data->tilt);
939 }
940 
941 /** Destructor */
943 {
944  free(data_ptr);
945 }
946 
947 /** Copy constructor.
948  * @param m message to copy from
949  */
951 {
952  data_size = m->data_size;
953  data_ptr = malloc(data_size);
954  memcpy(data_ptr, m->data_ptr, data_size);
955  data = (GotoMessage_data_t *)data_ptr;
957 }
958 
959 /* Methods */
960 /** Get pan value.
961  * Current pan.
962  * @return pan value
963  */
964 float
966 {
967  return data->pan;
968 }
969 
970 /** Get maximum length of pan value.
971  * @return length of pan value, can be length of the array or number of
972  * maximum number of characters for a string
973  */
974 size_t
976 {
977  return 1;
978 }
979 
980 /** Set pan value.
981  * Current pan.
982  * @param new_pan new pan value
983  */
984 void
986 {
987  data->pan = new_pan;
988 }
989 
990 /** Get tilt value.
991  * Current tilt.
992  * @return tilt value
993  */
994 float
996 {
997  return data->tilt;
998 }
999 
1000 /** Get maximum length of tilt value.
1001  * @return length of tilt value, can be length of the array or number of
1002  * maximum number of characters for a string
1003  */
1004 size_t
1006 {
1007  return 1;
1008 }
1009 
1010 /** Set tilt value.
1011  * Current tilt.
1012  * @param new_tilt new tilt value
1013  */
1014 void
1016 {
1017  data->tilt = new_tilt;
1018 }
1019 
1020 /** Clone this message.
1021  * Produces a message of the same type as this message and copies the
1022  * data to the new message.
1023  * @return clone of this message
1024  */
1025 Message *
1027 {
1028  return new PanTiltInterface::GotoMessage(this);
1029 }
1030 /** @class PanTiltInterface::TimedGotoMessage <interfaces/PanTiltInterface.h>
1031  * TimedGotoMessage Fawkes BlackBoard Interface Message.
1032  *
1033 
1034  */
1035 
1036 
1037 /** Constructor with initial values.
1038  * @param ini_time_sec initial value for time_sec
1039  * @param ini_pan initial value for pan
1040  * @param ini_tilt initial value for tilt
1041  */
1042 PanTiltInterface::TimedGotoMessage::TimedGotoMessage(const float ini_time_sec, const float ini_pan, const float ini_tilt) : Message("TimedGotoMessage")
1043 {
1044  data_size = sizeof(TimedGotoMessage_data_t);
1045  data_ptr = malloc(data_size);
1046  memset(data_ptr, 0, data_size);
1047  data = (TimedGotoMessage_data_t *)data_ptr;
1049  data->time_sec = ini_time_sec;
1050  data->pan = ini_pan;
1051  data->tilt = ini_tilt;
1052  add_fieldinfo(IFT_FLOAT, "time_sec", 1, &data->time_sec);
1053  add_fieldinfo(IFT_FLOAT, "pan", 1, &data->pan);
1054  add_fieldinfo(IFT_FLOAT, "tilt", 1, &data->tilt);
1055 }
1056 /** Constructor */
1058 {
1059  data_size = sizeof(TimedGotoMessage_data_t);
1060  data_ptr = malloc(data_size);
1061  memset(data_ptr, 0, data_size);
1062  data = (TimedGotoMessage_data_t *)data_ptr;
1064  add_fieldinfo(IFT_FLOAT, "time_sec", 1, &data->time_sec);
1065  add_fieldinfo(IFT_FLOAT, "pan", 1, &data->pan);
1066  add_fieldinfo(IFT_FLOAT, "tilt", 1, &data->tilt);
1067 }
1068 
1069 /** Destructor */
1071 {
1072  free(data_ptr);
1073 }
1074 
1075 /** Copy constructor.
1076  * @param m message to copy from
1077  */
1079 {
1080  data_size = m->data_size;
1081  data_ptr = malloc(data_size);
1082  memcpy(data_ptr, m->data_ptr, data_size);
1083  data = (TimedGotoMessage_data_t *)data_ptr;
1085 }
1086 
1087 /* Methods */
1088 /** Get time_sec value.
1089  * Time in seconds when to reach
1090  the final position.
1091  * @return time_sec value
1092  */
1093 float
1095 {
1096  return data->time_sec;
1097 }
1098 
1099 /** Get maximum length of time_sec value.
1100  * @return length of time_sec value, can be length of the array or number of
1101  * maximum number of characters for a string
1102  */
1103 size_t
1105 {
1106  return 1;
1107 }
1108 
1109 /** Set time_sec value.
1110  * Time in seconds when to reach
1111  the final position.
1112  * @param new_time_sec new time_sec value
1113  */
1114 void
1116 {
1117  data->time_sec = new_time_sec;
1118 }
1119 
1120 /** Get pan value.
1121  * Current pan.
1122  * @return pan value
1123  */
1124 float
1126 {
1127  return data->pan;
1128 }
1129 
1130 /** Get maximum length of pan value.
1131  * @return length of pan value, can be length of the array or number of
1132  * maximum number of characters for a string
1133  */
1134 size_t
1136 {
1137  return 1;
1138 }
1139 
1140 /** Set pan value.
1141  * Current pan.
1142  * @param new_pan new pan value
1143  */
1144 void
1146 {
1147  data->pan = new_pan;
1148 }
1149 
1150 /** Get tilt value.
1151  * Current tilt.
1152  * @return tilt value
1153  */
1154 float
1156 {
1157  return data->tilt;
1158 }
1159 
1160 /** Get maximum length of tilt value.
1161  * @return length of tilt value, can be length of the array or number of
1162  * maximum number of characters for a string
1163  */
1164 size_t
1166 {
1167  return 1;
1168 }
1169 
1170 /** Set tilt value.
1171  * Current tilt.
1172  * @param new_tilt new tilt value
1173  */
1174 void
1176 {
1177  data->tilt = new_tilt;
1178 }
1179 
1180 /** Clone this message.
1181  * Produces a message of the same type as this message and copies the
1182  * data to the new message.
1183  * @return clone of this message
1184  */
1185 Message *
1187 {
1188  return new PanTiltInterface::TimedGotoMessage(this);
1189 }
1190 /** @class PanTiltInterface::SetEnabledMessage <interfaces/PanTiltInterface.h>
1191  * SetEnabledMessage Fawkes BlackBoard Interface Message.
1192  *
1193 
1194  */
1195 
1196 
1197 /** Constructor with initial values.
1198  * @param ini_enabled initial value for enabled
1199  */
1200 PanTiltInterface::SetEnabledMessage::SetEnabledMessage(const bool ini_enabled) : Message("SetEnabledMessage")
1201 {
1202  data_size = sizeof(SetEnabledMessage_data_t);
1203  data_ptr = malloc(data_size);
1204  memset(data_ptr, 0, data_size);
1205  data = (SetEnabledMessage_data_t *)data_ptr;
1207  data->enabled = ini_enabled;
1208  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
1209 }
1210 /** Constructor */
1212 {
1213  data_size = sizeof(SetEnabledMessage_data_t);
1214  data_ptr = malloc(data_size);
1215  memset(data_ptr, 0, data_size);
1216  data = (SetEnabledMessage_data_t *)data_ptr;
1218  add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled);
1219 }
1220 
1221 /** Destructor */
1223 {
1224  free(data_ptr);
1225 }
1226 
1227 /** Copy constructor.
1228  * @param m message to copy from
1229  */
1231 {
1232  data_size = m->data_size;
1233  data_ptr = malloc(data_size);
1234  memcpy(data_ptr, m->data_ptr, data_size);
1235  data = (SetEnabledMessage_data_t *)data_ptr;
1237 }
1238 
1239 /* Methods */
1240 /** Get enabled value.
1241  * Is the pan/tilt unit enabled?
1242  * @return enabled value
1243  */
1244 bool
1246 {
1247  return data->enabled;
1248 }
1249 
1250 /** Get maximum length of enabled value.
1251  * @return length of enabled value, can be length of the array or number of
1252  * maximum number of characters for a string
1253  */
1254 size_t
1256 {
1257  return 1;
1258 }
1259 
1260 /** Set enabled value.
1261  * Is the pan/tilt unit enabled?
1262  * @param new_enabled new enabled value
1263  */
1264 void
1266 {
1267  data->enabled = new_enabled;
1268 }
1269 
1270 /** Clone this message.
1271  * Produces a message of the same type as this message and copies the
1272  * data to the new message.
1273  * @return clone of this message
1274  */
1275 Message *
1277 {
1278  return new PanTiltInterface::SetEnabledMessage(this);
1279 }
1280 /** @class PanTiltInterface::SetVelocityMessage <interfaces/PanTiltInterface.h>
1281  * SetVelocityMessage Fawkes BlackBoard Interface Message.
1282  *
1283 
1284  */
1285 
1286 
1287 /** Constructor with initial values.
1288  * @param ini_pan_velocity initial value for pan_velocity
1289  * @param ini_tilt_velocity initial value for tilt_velocity
1290  */
1291 PanTiltInterface::SetVelocityMessage::SetVelocityMessage(const float ini_pan_velocity, const float ini_tilt_velocity) : Message("SetVelocityMessage")
1292 {
1293  data_size = sizeof(SetVelocityMessage_data_t);
1294  data_ptr = malloc(data_size);
1295  memset(data_ptr, 0, data_size);
1296  data = (SetVelocityMessage_data_t *)data_ptr;
1298  data->pan_velocity = ini_pan_velocity;
1299  data->tilt_velocity = ini_tilt_velocity;
1300  add_fieldinfo(IFT_FLOAT, "pan_velocity", 1, &data->pan_velocity);
1301  add_fieldinfo(IFT_FLOAT, "tilt_velocity", 1, &data->tilt_velocity);
1302 }
1303 /** Constructor */
1305 {
1306  data_size = sizeof(SetVelocityMessage_data_t);
1307  data_ptr = malloc(data_size);
1308  memset(data_ptr, 0, data_size);
1309  data = (SetVelocityMessage_data_t *)data_ptr;
1311  add_fieldinfo(IFT_FLOAT, "pan_velocity", 1, &data->pan_velocity);
1312  add_fieldinfo(IFT_FLOAT, "tilt_velocity", 1, &data->tilt_velocity);
1313 }
1314 
1315 /** Destructor */
1317 {
1318  free(data_ptr);
1319 }
1320 
1321 /** Copy constructor.
1322  * @param m message to copy from
1323  */
1325 {
1326  data_size = m->data_size;
1327  data_ptr = malloc(data_size);
1328  memcpy(data_ptr, m->data_ptr, data_size);
1329  data = (SetVelocityMessage_data_t *)data_ptr;
1331 }
1332 
1333 /* Methods */
1334 /** Get pan_velocity value.
1335  * Maximum pan velocity currently reached.
1336  * @return pan_velocity value
1337  */
1338 float
1340 {
1341  return data->pan_velocity;
1342 }
1343 
1344 /** Get maximum length of pan_velocity value.
1345  * @return length of pan_velocity value, can be length of the array or number of
1346  * maximum number of characters for a string
1347  */
1348 size_t
1350 {
1351  return 1;
1352 }
1353 
1354 /** Set pan_velocity value.
1355  * Maximum pan velocity currently reached.
1356  * @param new_pan_velocity new pan_velocity value
1357  */
1358 void
1360 {
1361  data->pan_velocity = new_pan_velocity;
1362 }
1363 
1364 /** Get tilt_velocity value.
1365  * Maximum tilt velocity currently reached.
1366  * @return tilt_velocity value
1367  */
1368 float
1370 {
1371  return data->tilt_velocity;
1372 }
1373 
1374 /** Get maximum length of tilt_velocity value.
1375  * @return length of tilt_velocity value, can be length of the array or number of
1376  * maximum number of characters for a string
1377  */
1378 size_t
1380 {
1381  return 1;
1382 }
1383 
1384 /** Set tilt_velocity value.
1385  * Maximum tilt velocity currently reached.
1386  * @param new_tilt_velocity new tilt_velocity value
1387  */
1388 void
1390 {
1391  data->tilt_velocity = new_tilt_velocity;
1392 }
1393 
1394 /** Clone this message.
1395  * Produces a message of the same type as this message and copies the
1396  * data to the new message.
1397  * @return clone of this message
1398  */
1399 Message *
1401 {
1402  return new PanTiltInterface::SetVelocityMessage(this);
1403 }
1404 /** @class PanTiltInterface::SetMarginMessage <interfaces/PanTiltInterface.h>
1405  * SetMarginMessage Fawkes BlackBoard Interface Message.
1406  *
1407 
1408  */
1409 
1410 
1411 /** Constructor with initial values.
1412  * @param ini_pan_margin initial value for pan_margin
1413  * @param ini_tilt_margin initial value for tilt_margin
1414  */
1415 PanTiltInterface::SetMarginMessage::SetMarginMessage(const float ini_pan_margin, const float ini_tilt_margin) : Message("SetMarginMessage")
1416 {
1417  data_size = sizeof(SetMarginMessage_data_t);
1418  data_ptr = malloc(data_size);
1419  memset(data_ptr, 0, data_size);
1420  data = (SetMarginMessage_data_t *)data_ptr;
1422  data->pan_margin = ini_pan_margin;
1423  data->tilt_margin = ini_tilt_margin;
1424  add_fieldinfo(IFT_FLOAT, "pan_margin", 1, &data->pan_margin);
1425  add_fieldinfo(IFT_FLOAT, "tilt_margin", 1, &data->tilt_margin);
1426 }
1427 /** Constructor */
1429 {
1430  data_size = sizeof(SetMarginMessage_data_t);
1431  data_ptr = malloc(data_size);
1432  memset(data_ptr, 0, data_size);
1433  data = (SetMarginMessage_data_t *)data_ptr;
1435  add_fieldinfo(IFT_FLOAT, "pan_margin", 1, &data->pan_margin);
1436  add_fieldinfo(IFT_FLOAT, "tilt_margin", 1, &data->tilt_margin);
1437 }
1438 
1439 /** Destructor */
1441 {
1442  free(data_ptr);
1443 }
1444 
1445 /** Copy constructor.
1446  * @param m message to copy from
1447  */
1449 {
1450  data_size = m->data_size;
1451  data_ptr = malloc(data_size);
1452  memcpy(data_ptr, m->data_ptr, data_size);
1453  data = (SetMarginMessage_data_t *)data_ptr;
1455 }
1456 
1457 /* Methods */
1458 /** Get pan_margin value.
1459  * Margin in radians around a
1460  target pan value to consider the motion as final.
1461  * @return pan_margin value
1462  */
1463 float
1465 {
1466  return data->pan_margin;
1467 }
1468 
1469 /** Get maximum length of pan_margin value.
1470  * @return length of pan_margin value, can be length of the array or number of
1471  * maximum number of characters for a string
1472  */
1473 size_t
1475 {
1476  return 1;
1477 }
1478 
1479 /** Set pan_margin value.
1480  * Margin in radians around a
1481  target pan value to consider the motion as final.
1482  * @param new_pan_margin new pan_margin value
1483  */
1484 void
1486 {
1487  data->pan_margin = new_pan_margin;
1488 }
1489 
1490 /** Get tilt_margin value.
1491  * Margin in radians around a
1492  target tilt value to consider the motion as final.
1493  * @return tilt_margin value
1494  */
1495 float
1497 {
1498  return data->tilt_margin;
1499 }
1500 
1501 /** Get maximum length of tilt_margin value.
1502  * @return length of tilt_margin value, can be length of the array or number of
1503  * maximum number of characters for a string
1504  */
1505 size_t
1507 {
1508  return 1;
1509 }
1510 
1511 /** Set tilt_margin value.
1512  * Margin in radians around a
1513  target tilt value to consider the motion as final.
1514  * @param new_tilt_margin new tilt_margin value
1515  */
1516 void
1518 {
1519  data->tilt_margin = new_tilt_margin;
1520 }
1521 
1522 /** Clone this message.
1523  * Produces a message of the same type as this message and copies the
1524  * data to the new message.
1525  * @return clone of this message
1526  */
1527 Message *
1529 {
1530  return new PanTiltInterface::SetMarginMessage(this);
1531 }
1532 /** Check if message is valid and can be enqueued.
1533  * @param message Message to check
1534  * @return true if the message is valid, false otherwise.
1535  */
1536 bool
1538 {
1539  const StopMessage *m0 = dynamic_cast<const StopMessage *>(message);
1540  if ( m0 != NULL ) {
1541  return true;
1542  }
1543  const FlushMessage *m1 = dynamic_cast<const FlushMessage *>(message);
1544  if ( m1 != NULL ) {
1545  return true;
1546  }
1547  const CalibrateMessage *m2 = dynamic_cast<const CalibrateMessage *>(message);
1548  if ( m2 != NULL ) {
1549  return true;
1550  }
1551  const ParkMessage *m3 = dynamic_cast<const ParkMessage *>(message);
1552  if ( m3 != NULL ) {
1553  return true;
1554  }
1555  const GotoMessage *m4 = dynamic_cast<const GotoMessage *>(message);
1556  if ( m4 != NULL ) {
1557  return true;
1558  }
1559  const TimedGotoMessage *m5 = dynamic_cast<const TimedGotoMessage *>(message);
1560  if ( m5 != NULL ) {
1561  return true;
1562  }
1563  const SetEnabledMessage *m6 = dynamic_cast<const SetEnabledMessage *>(message);
1564  if ( m6 != NULL ) {
1565  return true;
1566  }
1567  const SetVelocityMessage *m7 = dynamic_cast<const SetVelocityMessage *>(message);
1568  if ( m7 != NULL ) {
1569  return true;
1570  }
1571  const SetMarginMessage *m8 = dynamic_cast<const SetMarginMessage *>(message);
1572  if ( m8 != NULL ) {
1573  return true;
1574  }
1575  return false;
1576 }
1577 
1578 /// @cond INTERNALS
1579 EXPORT_INTERFACE(PanTiltInterface)
1580 /// @endcond
1581 
1582 
1583 } // end namespace fawkes
float tilt_margin() const
Get tilt_margin value.
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:114
float pan() const
Get pan value.
TimedGotoMessage Fawkes BlackBoard Interface Message.
void set_time_sec(const float new_time_sec)
Set time_sec value.
void set_tilt_velocity(const float new_tilt_velocity)
Set tilt_velocity value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:43
static const uint32_t ERROR_PAN_OUTOFRANGE
ERROR_PAN_OUTOFRANGE constant.
virtual Message * clone() const
Clone this message.
float tilt_velocity() const
Get tilt_velocity value.
static const uint32_t ERROR_COMMUNICATION
ERROR_COMMUNICATION constant.
static const uint32_t ERROR_UNSPECIFIC
ERROR_UNSPECIFIC constant.
void set_pan_margin(const float new_pan_margin)
Set pan_margin value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
Definition: message.h:119
SetEnabledMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_tilt() const
Get maximum length of tilt value.
float pan_margin() const
Get pan_margin value.
size_t maxlenof_tilt_margin() const
Get maximum length of tilt_margin value.
virtual Message * clone() const
Clone this message.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
float pan_velocity() const
Get pan_velocity value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
SetVelocityMessage Fawkes BlackBoard Interface Message.
static const uint32_t ERROR_NONE
ERROR_NONE constant.
void set_pan(const float new_pan)
Set pan value.
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
void set_tilt_margin(const float new_tilt_margin)
Set tilt_margin value.
virtual Message * clone() const
Clone this message.
ParkMessage Fawkes BlackBoard Interface Message.
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:206
size_t maxlenof_pan_margin() const
Get maximum length of pan_margin value.
void set_tilt(const float new_tilt)
Set tilt value.
static const uint32_t FLAG_SUPPORTS_PAN
FLAG_SUPPORTS_PAN constant.
size_t maxlenof_tilt() const
Get maximum length of tilt value.
FlushMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
size_t maxlenof_pan() const
Get maximum length of pan value.
void set_pan_velocity(const float new_pan_velocity)
Set pan_velocity value.
size_t maxlenof_pan_velocity() const
Get maximum length of pan_velocity value.
static const uint32_t ERROR_TILT_OUTOFRANGE
ERROR_TILT_OUTOFRANGE constant.
GotoMessage Fawkes BlackBoard Interface Message.
float field
Definition: types.h:43
void set_pan(const float new_pan)
Set pan value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
float tilt() const
Get tilt value.
SetMarginMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
CalibrateMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_time_sec() const
Get maximum length of time_sec value.
static const uint32_t FLAG_SUPPORTS_TILT
FLAG_SUPPORTS_TILT constant.
PanTiltInterface Fawkes BlackBoard Interface.
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
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
float time_sec() const
Get time_sec value.
boolean field
Definition: types.h:34
size_t maxlenof_pan() const
Get maximum length of pan value.
const char * type() const
Get type of interface.
Definition: interface.cpp:635
void set_tilt(const float new_tilt)
Set tilt value.
bool is_enabled() const
Get enabled value.
StopMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_tilt_velocity() const
Get maximum length of tilt_velocity value.
void set_enabled(const bool new_enabled)
Set enabled value.
virtual Message * clone() const
Clone this message.