Fawkes API  Fawkes Development Version
HumanoidMotionInterface.cpp
1 
2 /***************************************************************************
3  * HumanoidMotionInterface.cpp - Fawkes BlackBoard Interface - HumanoidMotionInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2008 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/HumanoidMotionInterface.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 HumanoidMotionInterface <interfaces/HumanoidMotionInterface.h>
36  * HumanoidMotionInterface Fawkes BlackBoard Interface.
37  *
38  This interface provides acces to basic humanoid motion patterns.
39 
40  * @ingroup FawkesInterfaces
41  */
42 
43 
44 
45 /** Constructor */
46 HumanoidMotionInterface::HumanoidMotionInterface() : Interface()
47 {
48  data_size = sizeof(HumanoidMotionInterface_data_t);
49  data_ptr = malloc(data_size);
50  data = (HumanoidMotionInterface_data_t *)data_ptr;
51  data_ts = (interface_data_ts_t *)data_ptr;
52  memset(data_ptr, 0, data_size);
53  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
54  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
55  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
56  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
57  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
58  add_fieldinfo(IFT_BOOL, "moving", 1, &data->moving);
59  add_fieldinfo(IFT_BOOL, "arms_enabled", 1, &data->arms_enabled);
60  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
61  add_messageinfo("StopMessage");
62  add_messageinfo("WalkStraightMessage");
63  add_messageinfo("WalkSidewaysMessage");
64  add_messageinfo("WalkArcMessage");
65  add_messageinfo("WalkVelocityMessage");
66  add_messageinfo("TurnMessage");
67  add_messageinfo("KickMessage");
68  add_messageinfo("ParkMessage");
69  add_messageinfo("GetUpMessage");
70  add_messageinfo("StandupMessage");
71  add_messageinfo("MoveHeadMessage");
72  unsigned char tmp_hash[] = {0x58, 0x4e, 0xd5, 0x1c, 0xbb, 0xf7, 0x6d, 0x85, 0x15, 0x52, 0x3b, 0x5a, 0x2b, 0x99, 0x5d, 0xc6};
73  set_hash(tmp_hash);
74 }
75 
76 /** Destructor */
77 HumanoidMotionInterface::~HumanoidMotionInterface()
78 {
79  free(data_ptr);
80 }
81 /** Convert LegEnum constant to string.
82  * @param value value to convert to string
83  * @return constant value as string.
84  */
85 const char *
87 {
88  switch (value) {
89  case LEG_LEFT: return "LEG_LEFT";
90  case LEG_RIGHT: return "LEG_RIGHT";
91  default: return "UNKNOWN";
92  }
93 }
94 /** Convert StandupEnum constant to string.
95  * @param value value to convert to string
96  * @return constant value as string.
97  */
98 const char *
100 {
101  switch (value) {
102  case STANDUP_DETECT: return "STANDUP_DETECT";
103  case STANDUP_BACK: return "STANDUP_BACK";
104  case STANDUP_FRONT: return "STANDUP_FRONT";
105  default: return "UNKNOWN";
106  }
107 }
108 /* Methods */
109 /** Get moving value.
110  * True if the robot is moving.
111  * @return moving value
112  */
113 bool
115 {
116  return data->moving;
117 }
118 
119 /** Get maximum length of moving value.
120  * @return length of moving value, can be length of the array or number of
121  * maximum number of characters for a string
122  */
123 size_t
125 {
126  return 1;
127 }
128 
129 /** Set moving value.
130  * True if the robot is moving.
131  * @param new_moving new moving value
132  */
133 void
135 {
136  data->moving = new_moving;
137  data_changed = true;
138 }
139 
140 /** Get arms_enabled value.
141  *
142  If true the arms are controlled during walking for balancing.
143 
144  * @return arms_enabled value
145  */
146 bool
148 {
149  return data->arms_enabled;
150 }
151 
152 /** Get maximum length of arms_enabled value.
153  * @return length of arms_enabled value, can be length of the array or number of
154  * maximum number of characters for a string
155  */
156 size_t
158 {
159  return 1;
160 }
161 
162 /** Set arms_enabled value.
163  *
164  If true the arms are controlled during walking for balancing.
165 
166  * @param new_arms_enabled new arms_enabled value
167  */
168 void
169 HumanoidMotionInterface::set_arms_enabled(const bool new_arms_enabled)
170 {
171  data->arms_enabled = new_arms_enabled;
172  data_changed = true;
173 }
174 
175 /** Get msgid value.
176  *
177  The ID of the message that is currently being
178  processed, or 0 if no message is being processed.
179 
180  * @return msgid value
181  */
182 uint32_t
184 {
185  return data->msgid;
186 }
187 
188 /** Get maximum length of msgid value.
189  * @return length of msgid value, can be length of the array or number of
190  * maximum number of characters for a string
191  */
192 size_t
194 {
195  return 1;
196 }
197 
198 /** Set msgid value.
199  *
200  The ID of the message that is currently being
201  processed, or 0 if no message is being processed.
202 
203  * @param new_msgid new msgid value
204  */
205 void
206 HumanoidMotionInterface::set_msgid(const uint32_t new_msgid)
207 {
208  data->msgid = new_msgid;
209  data_changed = true;
210 }
211 
212 /* =========== message create =========== */
213 Message *
215 {
216  if ( strncmp("StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
217  return new StopMessage();
218  } else if ( strncmp("WalkStraightMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
219  return new WalkStraightMessage();
220  } else if ( strncmp("WalkSidewaysMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
221  return new WalkSidewaysMessage();
222  } else if ( strncmp("WalkArcMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
223  return new WalkArcMessage();
224  } else if ( strncmp("WalkVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
225  return new WalkVelocityMessage();
226  } else if ( strncmp("TurnMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
227  return new TurnMessage();
228  } else if ( strncmp("KickMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
229  return new KickMessage();
230  } else if ( strncmp("ParkMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
231  return new ParkMessage();
232  } else if ( strncmp("GetUpMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
233  return new GetUpMessage();
234  } else if ( strncmp("StandupMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
235  return new StandupMessage();
236  } else if ( strncmp("MoveHeadMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
237  return new MoveHeadMessage();
238  } else {
239  throw UnknownTypeException("The given type '%s' does not match any known "
240  "message type for this interface type.", type);
241  }
242 }
243 
244 
245 /** Copy values from other interface.
246  * @param other other interface to copy values from
247  */
248 void
250 {
251  const HumanoidMotionInterface *oi = dynamic_cast<const HumanoidMotionInterface *>(other);
252  if (oi == NULL) {
253  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
254  type(), other->type());
255  }
256  memcpy(data, oi->data, sizeof(HumanoidMotionInterface_data_t));
257 }
258 
259 const char *
260 HumanoidMotionInterface::enum_tostring(const char *enumtype, int val) const
261 {
262  if (strcmp(enumtype, "LegEnum") == 0) {
263  return tostring_LegEnum((LegEnum)val);
264  }
265  if (strcmp(enumtype, "StandupEnum") == 0) {
266  return tostring_StandupEnum((StandupEnum)val);
267  }
268  throw UnknownTypeException("Unknown enum type %s", enumtype);
269 }
270 
271 /* =========== messages =========== */
272 /** @class HumanoidMotionInterface::StopMessage <interfaces/HumanoidMotionInterface.h>
273  * StopMessage Fawkes BlackBoard Interface Message.
274  *
275 
276  */
277 
278 
279 /** Constructor */
281 {
282  data_size = sizeof(StopMessage_data_t);
283  data_ptr = malloc(data_size);
284  memset(data_ptr, 0, data_size);
285  data = (StopMessage_data_t *)data_ptr;
287  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
288  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
289  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
290  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
291  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
292 }
293 
294 /** Destructor */
296 {
297  free(data_ptr);
298 }
299 
300 /** Copy constructor.
301  * @param m message to copy from
302  */
304 {
305  data_size = m->data_size;
306  data_ptr = malloc(data_size);
307  memcpy(data_ptr, m->data_ptr, data_size);
308  data = (StopMessage_data_t *)data_ptr;
310 }
311 
312 /* Methods */
313 /** Clone this message.
314  * Produces a message of the same type as this message and copies the
315  * data to the new message.
316  * @return clone of this message
317  */
318 Message *
320 {
321  return new HumanoidMotionInterface::StopMessage(this);
322 }
323 /** @class HumanoidMotionInterface::WalkStraightMessage <interfaces/HumanoidMotionInterface.h>
324  * WalkStraightMessage Fawkes BlackBoard Interface Message.
325  *
326 
327  */
328 
329 
330 /** Constructor with initial values.
331  * @param ini_distance initial value for distance
332  */
333 HumanoidMotionInterface::WalkStraightMessage::WalkStraightMessage(const float ini_distance) : Message("WalkStraightMessage")
334 {
335  data_size = sizeof(WalkStraightMessage_data_t);
336  data_ptr = malloc(data_size);
337  memset(data_ptr, 0, data_size);
338  data = (WalkStraightMessage_data_t *)data_ptr;
340  data->distance = ini_distance;
341  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
342  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
343  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
344  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
345  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
346  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
347 }
348 /** Constructor */
350 {
351  data_size = sizeof(WalkStraightMessage_data_t);
352  data_ptr = malloc(data_size);
353  memset(data_ptr, 0, data_size);
354  data = (WalkStraightMessage_data_t *)data_ptr;
356  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
357  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
358  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
359  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
360  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
361  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
362 }
363 
364 /** Destructor */
366 {
367  free(data_ptr);
368 }
369 
370 /** Copy constructor.
371  * @param m message to copy from
372  */
374 {
375  data_size = m->data_size;
376  data_ptr = malloc(data_size);
377  memcpy(data_ptr, m->data_ptr, data_size);
378  data = (WalkStraightMessage_data_t *)data_ptr;
380 }
381 
382 /* Methods */
383 /** Get distance value.
384  * Distance in m to walk.
385  * @return distance value
386  */
387 float
389 {
390  return data->distance;
391 }
392 
393 /** Get maximum length of distance value.
394  * @return length of distance value, can be length of the array or number of
395  * maximum number of characters for a string
396  */
397 size_t
399 {
400  return 1;
401 }
402 
403 /** Set distance value.
404  * Distance in m to walk.
405  * @param new_distance new distance value
406  */
407 void
409 {
410  data->distance = new_distance;
411 }
412 
413 /** Clone this message.
414  * Produces a message of the same type as this message and copies the
415  * data to the new message.
416  * @return clone of this message
417  */
418 Message *
420 {
422 }
423 /** @class HumanoidMotionInterface::WalkSidewaysMessage <interfaces/HumanoidMotionInterface.h>
424  * WalkSidewaysMessage Fawkes BlackBoard Interface Message.
425  *
426 
427  */
428 
429 
430 /** Constructor with initial values.
431  * @param ini_distance initial value for distance
432  */
433 HumanoidMotionInterface::WalkSidewaysMessage::WalkSidewaysMessage(const float ini_distance) : Message("WalkSidewaysMessage")
434 {
435  data_size = sizeof(WalkSidewaysMessage_data_t);
436  data_ptr = malloc(data_size);
437  memset(data_ptr, 0, data_size);
438  data = (WalkSidewaysMessage_data_t *)data_ptr;
440  data->distance = ini_distance;
441  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
442  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
443  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
444  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
445  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
446  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
447 }
448 /** Constructor */
450 {
451  data_size = sizeof(WalkSidewaysMessage_data_t);
452  data_ptr = malloc(data_size);
453  memset(data_ptr, 0, data_size);
454  data = (WalkSidewaysMessage_data_t *)data_ptr;
456  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
457  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
458  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
459  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
460  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
461  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
462 }
463 
464 /** Destructor */
466 {
467  free(data_ptr);
468 }
469 
470 /** Copy constructor.
471  * @param m message to copy from
472  */
474 {
475  data_size = m->data_size;
476  data_ptr = malloc(data_size);
477  memcpy(data_ptr, m->data_ptr, data_size);
478  data = (WalkSidewaysMessage_data_t *)data_ptr;
480 }
481 
482 /* Methods */
483 /** Get distance value.
484  * Distance in m to walk.
485  * @return distance value
486  */
487 float
489 {
490  return data->distance;
491 }
492 
493 /** Get maximum length of distance value.
494  * @return length of distance value, can be length of the array or number of
495  * maximum number of characters for a string
496  */
497 size_t
499 {
500  return 1;
501 }
502 
503 /** Set distance value.
504  * Distance in m to walk.
505  * @param new_distance new distance value
506  */
507 void
509 {
510  data->distance = new_distance;
511 }
512 
513 /** Clone this message.
514  * Produces a message of the same type as this message and copies the
515  * data to the new message.
516  * @return clone of this message
517  */
518 Message *
520 {
522 }
523 /** @class HumanoidMotionInterface::WalkArcMessage <interfaces/HumanoidMotionInterface.h>
524  * WalkArcMessage Fawkes BlackBoard Interface Message.
525  *
526 
527  */
528 
529 
530 /** Constructor with initial values.
531  * @param ini_angle initial value for angle
532  * @param ini_radius initial value for radius
533  */
534 HumanoidMotionInterface::WalkArcMessage::WalkArcMessage(const float ini_angle, const float ini_radius) : Message("WalkArcMessage")
535 {
536  data_size = sizeof(WalkArcMessage_data_t);
537  data_ptr = malloc(data_size);
538  memset(data_ptr, 0, data_size);
539  data = (WalkArcMessage_data_t *)data_ptr;
541  data->angle = ini_angle;
542  data->radius = ini_radius;
543  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
544  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
545  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
546  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
547  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
548  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
549  add_fieldinfo(IFT_FLOAT, "radius", 1, &data->radius);
550 }
551 /** Constructor */
553 {
554  data_size = sizeof(WalkArcMessage_data_t);
555  data_ptr = malloc(data_size);
556  memset(data_ptr, 0, data_size);
557  data = (WalkArcMessage_data_t *)data_ptr;
559  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
560  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
561  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
562  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
563  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
564  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
565  add_fieldinfo(IFT_FLOAT, "radius", 1, &data->radius);
566 }
567 
568 /** Destructor */
570 {
571  free(data_ptr);
572 }
573 
574 /** Copy constructor.
575  * @param m message to copy from
576  */
578 {
579  data_size = m->data_size;
580  data_ptr = malloc(data_size);
581  memcpy(data_ptr, m->data_ptr, data_size);
582  data = (WalkArcMessage_data_t *)data_ptr;
584 }
585 
586 /* Methods */
587 /** Get angle value.
588  * Angle in radians to turn over the way.
589  * @return angle value
590  */
591 float
593 {
594  return data->angle;
595 }
596 
597 /** Get maximum length of angle value.
598  * @return length of angle value, can be length of the array or number of
599  * maximum number of characters for a string
600  */
601 size_t
603 {
604  return 1;
605 }
606 
607 /** Set angle value.
608  * Angle in radians to turn over the way.
609  * @param new_angle new angle value
610  */
611 void
613 {
614  data->angle = new_angle;
615 }
616 
617 /** Get radius value.
618  * Radius in m of the circle in m.
619  * @return radius value
620  */
621 float
623 {
624  return data->radius;
625 }
626 
627 /** Get maximum length of radius value.
628  * @return length of radius value, can be length of the array or number of
629  * maximum number of characters for a string
630  */
631 size_t
633 {
634  return 1;
635 }
636 
637 /** Set radius value.
638  * Radius in m of the circle in m.
639  * @param new_radius new radius value
640  */
641 void
643 {
644  data->radius = new_radius;
645 }
646 
647 /** Clone this message.
648  * Produces a message of the same type as this message and copies the
649  * data to the new message.
650  * @return clone of this message
651  */
652 Message *
654 {
656 }
657 /** @class HumanoidMotionInterface::WalkVelocityMessage <interfaces/HumanoidMotionInterface.h>
658  * WalkVelocityMessage Fawkes BlackBoard Interface Message.
659  *
660 
661  */
662 
663 
664 /** Constructor with initial values.
665  * @param ini_x initial value for x
666  * @param ini_y initial value for y
667  * @param ini_theta initial value for theta
668  * @param ini_speed initial value for speed
669  */
670 HumanoidMotionInterface::WalkVelocityMessage::WalkVelocityMessage(const float ini_x, const float ini_y, const float ini_theta, const float ini_speed) : Message("WalkVelocityMessage")
671 {
672  data_size = sizeof(WalkVelocityMessage_data_t);
673  data_ptr = malloc(data_size);
674  memset(data_ptr, 0, data_size);
675  data = (WalkVelocityMessage_data_t *)data_ptr;
677  data->x = ini_x;
678  data->y = ini_y;
679  data->theta = ini_theta;
680  data->speed = ini_speed;
681  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
682  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
683  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
684  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
685  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
686  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
687  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
688  add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta);
689  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
690 }
691 /** Constructor */
693 {
694  data_size = sizeof(WalkVelocityMessage_data_t);
695  data_ptr = malloc(data_size);
696  memset(data_ptr, 0, data_size);
697  data = (WalkVelocityMessage_data_t *)data_ptr;
699  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
700  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
701  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
702  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
703  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
704  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
705  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
706  add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta);
707  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
708 }
709 
710 /** Destructor */
712 {
713  free(data_ptr);
714 }
715 
716 /** Copy constructor.
717  * @param m message to copy from
718  */
720 {
721  data_size = m->data_size;
722  data_ptr = malloc(data_size);
723  memcpy(data_ptr, m->data_ptr, data_size);
724  data = (WalkVelocityMessage_data_t *)data_ptr;
726 }
727 
728 /* Methods */
729 /** Get x value.
730  *
731  Fraction of MaxStepX. Use negative for backwards. [-1.0 to 1.0].
732 
733  * @return x value
734  */
735 float
737 {
738  return data->x;
739 }
740 
741 /** Get maximum length of x value.
742  * @return length of x value, can be length of the array or number of
743  * maximum number of characters for a string
744  */
745 size_t
747 {
748  return 1;
749 }
750 
751 /** Set x value.
752  *
753  Fraction of MaxStepX. Use negative for backwards. [-1.0 to 1.0].
754 
755  * @param new_x new x value
756  */
757 void
759 {
760  data->x = new_x;
761 }
762 
763 /** Get y value.
764  *
765  Fraction of MaxStepY. Use negative for right. [-1.0 to 1.0].
766 
767  * @return y value
768  */
769 float
771 {
772  return data->y;
773 }
774 
775 /** Get maximum length of y value.
776  * @return length of y value, can be length of the array or number of
777  * maximum number of characters for a string
778  */
779 size_t
781 {
782  return 1;
783 }
784 
785 /** Set y value.
786  *
787  Fraction of MaxStepY. Use negative for right. [-1.0 to 1.0].
788 
789  * @param new_y new y value
790  */
791 void
793 {
794  data->y = new_y;
795 }
796 
797 /** Get theta value.
798  *
799  Fraction of MaxStepTheta. Use negative for clockwise [-1.0 to 1.0].
800 
801  * @return theta value
802  */
803 float
805 {
806  return data->theta;
807 }
808 
809 /** Get maximum length of theta value.
810  * @return length of theta value, can be length of the array or number of
811  * maximum number of characters for a string
812  */
813 size_t
815 {
816  return 1;
817 }
818 
819 /** Set theta value.
820  *
821  Fraction of MaxStepTheta. Use negative for clockwise [-1.0 to 1.0].
822 
823  * @param new_theta new theta value
824  */
825 void
827 {
828  data->theta = new_theta;
829 }
830 
831 /** Get speed value.
832  *
833  Fraction of MaxStepFrequency [0.0 to 1.0].
834 
835  * @return speed value
836  */
837 float
839 {
840  return data->speed;
841 }
842 
843 /** Get maximum length of speed value.
844  * @return length of speed value, can be length of the array or number of
845  * maximum number of characters for a string
846  */
847 size_t
849 {
850  return 1;
851 }
852 
853 /** Set speed value.
854  *
855  Fraction of MaxStepFrequency [0.0 to 1.0].
856 
857  * @param new_speed new speed value
858  */
859 void
861 {
862  data->speed = new_speed;
863 }
864 
865 /** Clone this message.
866  * Produces a message of the same type as this message and copies the
867  * data to the new message.
868  * @return clone of this message
869  */
870 Message *
872 {
874 }
875 /** @class HumanoidMotionInterface::TurnMessage <interfaces/HumanoidMotionInterface.h>
876  * TurnMessage Fawkes BlackBoard Interface Message.
877  *
878 
879  */
880 
881 
882 /** Constructor with initial values.
883  * @param ini_angle initial value for angle
884  */
885 HumanoidMotionInterface::TurnMessage::TurnMessage(const float ini_angle) : Message("TurnMessage")
886 {
887  data_size = sizeof(TurnMessage_data_t);
888  data_ptr = malloc(data_size);
889  memset(data_ptr, 0, data_size);
890  data = (TurnMessage_data_t *)data_ptr;
892  data->angle = ini_angle;
893  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
894  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
895  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
896  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
897  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
898  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
899 }
900 /** Constructor */
902 {
903  data_size = sizeof(TurnMessage_data_t);
904  data_ptr = malloc(data_size);
905  memset(data_ptr, 0, data_size);
906  data = (TurnMessage_data_t *)data_ptr;
908  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
909  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
910  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
911  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
912  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
913  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
914 }
915 
916 /** Destructor */
918 {
919  free(data_ptr);
920 }
921 
922 /** Copy constructor.
923  * @param m message to copy from
924  */
926 {
927  data_size = m->data_size;
928  data_ptr = malloc(data_size);
929  memcpy(data_ptr, m->data_ptr, data_size);
930  data = (TurnMessage_data_t *)data_ptr;
932 }
933 
934 /* Methods */
935 /** Get angle value.
936  * Angle in radians to turn.
937  * @return angle value
938  */
939 float
941 {
942  return data->angle;
943 }
944 
945 /** Get maximum length of angle value.
946  * @return length of angle value, can be length of the array or number of
947  * maximum number of characters for a string
948  */
949 size_t
951 {
952  return 1;
953 }
954 
955 /** Set angle value.
956  * Angle in radians to turn.
957  * @param new_angle new angle value
958  */
959 void
961 {
962  data->angle = new_angle;
963 }
964 
965 /** Clone this message.
966  * Produces a message of the same type as this message and copies the
967  * data to the new message.
968  * @return clone of this message
969  */
970 Message *
972 {
973  return new HumanoidMotionInterface::TurnMessage(this);
974 }
975 /** @class HumanoidMotionInterface::KickMessage <interfaces/HumanoidMotionInterface.h>
976  * KickMessage Fawkes BlackBoard Interface Message.
977  *
978 
979  */
980 
981 
982 /** Constructor with initial values.
983  * @param ini_leg initial value for leg
984  * @param ini_strength initial value for strength
985  */
986 HumanoidMotionInterface::KickMessage::KickMessage(const LegEnum ini_leg, const float ini_strength) : Message("KickMessage")
987 {
988  data_size = sizeof(KickMessage_data_t);
989  data_ptr = malloc(data_size);
990  memset(data_ptr, 0, data_size);
991  data = (KickMessage_data_t *)data_ptr;
993  data->leg = ini_leg;
994  data->strength = ini_strength;
995  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
996  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
997  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
998  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
999  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1000  add_fieldinfo(IFT_ENUM, "leg", 1, &data->leg, "LegEnum", &enum_map_LegEnum);
1001  add_fieldinfo(IFT_FLOAT, "strength", 1, &data->strength);
1002 }
1003 /** Constructor */
1005 {
1006  data_size = sizeof(KickMessage_data_t);
1007  data_ptr = malloc(data_size);
1008  memset(data_ptr, 0, data_size);
1009  data = (KickMessage_data_t *)data_ptr;
1011  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1012  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1013  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1014  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1015  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1016  add_fieldinfo(IFT_ENUM, "leg", 1, &data->leg, "LegEnum", &enum_map_LegEnum);
1017  add_fieldinfo(IFT_FLOAT, "strength", 1, &data->strength);
1018 }
1019 
1020 /** Destructor */
1022 {
1023  free(data_ptr);
1024 }
1025 
1026 /** Copy constructor.
1027  * @param m message to copy from
1028  */
1030 {
1031  data_size = m->data_size;
1032  data_ptr = malloc(data_size);
1033  memcpy(data_ptr, m->data_ptr, data_size);
1034  data = (KickMessage_data_t *)data_ptr;
1036 }
1037 
1038 /* Methods */
1039 /** Get leg value.
1040  * Leg to kick with
1041  * @return leg value
1042  */
1045 {
1046  return (HumanoidMotionInterface::LegEnum)data->leg;
1047 }
1048 
1049 /** Get maximum length of leg value.
1050  * @return length of leg value, can be length of the array or number of
1051  * maximum number of characters for a string
1052  */
1053 size_t
1055 {
1056  return 1;
1057 }
1058 
1059 /** Set leg value.
1060  * Leg to kick with
1061  * @param new_leg new leg value
1062  */
1063 void
1065 {
1066  data->leg = new_leg;
1067 }
1068 
1069 /** Get strength value.
1070  * Kick strength
1071  * @return strength value
1072  */
1073 float
1075 {
1076  return data->strength;
1077 }
1078 
1079 /** Get maximum length of strength value.
1080  * @return length of strength value, can be length of the array or number of
1081  * maximum number of characters for a string
1082  */
1083 size_t
1085 {
1086  return 1;
1087 }
1088 
1089 /** Set strength value.
1090  * Kick strength
1091  * @param new_strength new strength value
1092  */
1093 void
1095 {
1096  data->strength = new_strength;
1097 }
1098 
1099 /** Clone this message.
1100  * Produces a message of the same type as this message and copies the
1101  * data to the new message.
1102  * @return clone of this message
1103  */
1104 Message *
1106 {
1107  return new HumanoidMotionInterface::KickMessage(this);
1108 }
1109 /** @class HumanoidMotionInterface::ParkMessage <interfaces/HumanoidMotionInterface.h>
1110  * ParkMessage Fawkes BlackBoard Interface Message.
1111  *
1112 
1113  */
1114 
1115 
1116 /** Constructor */
1118 {
1119  data_size = sizeof(ParkMessage_data_t);
1120  data_ptr = malloc(data_size);
1121  memset(data_ptr, 0, data_size);
1122  data = (ParkMessage_data_t *)data_ptr;
1124  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1125  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1126  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1127  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1128  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1129 }
1130 
1131 /** Destructor */
1133 {
1134  free(data_ptr);
1135 }
1136 
1137 /** Copy constructor.
1138  * @param m message to copy from
1139  */
1141 {
1142  data_size = m->data_size;
1143  data_ptr = malloc(data_size);
1144  memcpy(data_ptr, m->data_ptr, data_size);
1145  data = (ParkMessage_data_t *)data_ptr;
1147 }
1148 
1149 /* Methods */
1150 /** Clone this message.
1151  * Produces a message of the same type as this message and copies the
1152  * data to the new message.
1153  * @return clone of this message
1154  */
1155 Message *
1157 {
1158  return new HumanoidMotionInterface::ParkMessage(this);
1159 }
1160 /** @class HumanoidMotionInterface::GetUpMessage <interfaces/HumanoidMotionInterface.h>
1161  * GetUpMessage Fawkes BlackBoard Interface Message.
1162  *
1163 
1164  */
1165 
1166 
1167 /** Constructor */
1169 {
1170  data_size = sizeof(GetUpMessage_data_t);
1171  data_ptr = malloc(data_size);
1172  memset(data_ptr, 0, data_size);
1173  data = (GetUpMessage_data_t *)data_ptr;
1175  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1176  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1177  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1178  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1179  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1180 }
1181 
1182 /** Destructor */
1184 {
1185  free(data_ptr);
1186 }
1187 
1188 /** Copy constructor.
1189  * @param m message to copy from
1190  */
1192 {
1193  data_size = m->data_size;
1194  data_ptr = malloc(data_size);
1195  memcpy(data_ptr, m->data_ptr, data_size);
1196  data = (GetUpMessage_data_t *)data_ptr;
1198 }
1199 
1200 /* Methods */
1201 /** Clone this message.
1202  * Produces a message of the same type as this message and copies the
1203  * data to the new message.
1204  * @return clone of this message
1205  */
1206 Message *
1208 {
1209  return new HumanoidMotionInterface::GetUpMessage(this);
1210 }
1211 /** @class HumanoidMotionInterface::StandupMessage <interfaces/HumanoidMotionInterface.h>
1212  * StandupMessage Fawkes BlackBoard Interface Message.
1213  *
1214 
1215  */
1216 
1217 
1218 /** Constructor with initial values.
1219  * @param ini_from_pos initial value for from_pos
1220  */
1222 {
1223  data_size = sizeof(StandupMessage_data_t);
1224  data_ptr = malloc(data_size);
1225  memset(data_ptr, 0, data_size);
1226  data = (StandupMessage_data_t *)data_ptr;
1228  data->from_pos = ini_from_pos;
1229  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1230  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1231  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1232  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1233  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1234  add_fieldinfo(IFT_ENUM, "from_pos", 1, &data->from_pos, "StandupEnum", &enum_map_StandupEnum);
1235 }
1236 /** Constructor */
1238 {
1239  data_size = sizeof(StandupMessage_data_t);
1240  data_ptr = malloc(data_size);
1241  memset(data_ptr, 0, data_size);
1242  data = (StandupMessage_data_t *)data_ptr;
1244  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1245  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1246  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1247  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1248  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1249  add_fieldinfo(IFT_ENUM, "from_pos", 1, &data->from_pos, "StandupEnum", &enum_map_StandupEnum);
1250 }
1251 
1252 /** Destructor */
1254 {
1255  free(data_ptr);
1256 }
1257 
1258 /** Copy constructor.
1259  * @param m message to copy from
1260  */
1262 {
1263  data_size = m->data_size;
1264  data_ptr = malloc(data_size);
1265  memcpy(data_ptr, m->data_ptr, data_size);
1266  data = (StandupMessage_data_t *)data_ptr;
1268 }
1269 
1270 /* Methods */
1271 /** Get from_pos value.
1272  * Position from where to standup.
1273  * @return from_pos value
1274  */
1277 {
1278  return (HumanoidMotionInterface::StandupEnum)data->from_pos;
1279 }
1280 
1281 /** Get maximum length of from_pos value.
1282  * @return length of from_pos value, can be length of the array or number of
1283  * maximum number of characters for a string
1284  */
1285 size_t
1287 {
1288  return 1;
1289 }
1290 
1291 /** Set from_pos value.
1292  * Position from where to standup.
1293  * @param new_from_pos new from_pos value
1294  */
1295 void
1297 {
1298  data->from_pos = new_from_pos;
1299 }
1300 
1301 /** Clone this message.
1302  * Produces a message of the same type as this message and copies the
1303  * data to the new message.
1304  * @return clone of this message
1305  */
1306 Message *
1308 {
1309  return new HumanoidMotionInterface::StandupMessage(this);
1310 }
1311 /** @class HumanoidMotionInterface::MoveHeadMessage <interfaces/HumanoidMotionInterface.h>
1312  * MoveHeadMessage Fawkes BlackBoard Interface Message.
1313  *
1314 
1315  */
1316 
1317 
1318 /** Constructor with initial values.
1319  * @param ini_yaw initial value for yaw
1320  * @param ini_pitch initial value for pitch
1321  * @param ini_speed initial value for speed
1322  */
1323 HumanoidMotionInterface::MoveHeadMessage::MoveHeadMessage(const float ini_yaw, const float ini_pitch, const float ini_speed) : Message("MoveHeadMessage")
1324 {
1325  data_size = sizeof(MoveHeadMessage_data_t);
1326  data_ptr = malloc(data_size);
1327  memset(data_ptr, 0, data_size);
1328  data = (MoveHeadMessage_data_t *)data_ptr;
1330  data->yaw = ini_yaw;
1331  data->pitch = ini_pitch;
1332  data->speed = ini_speed;
1333  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1334  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1335  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1336  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1337  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1338  add_fieldinfo(IFT_FLOAT, "yaw", 1, &data->yaw);
1339  add_fieldinfo(IFT_FLOAT, "pitch", 1, &data->pitch);
1340  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
1341 }
1342 /** Constructor */
1344 {
1345  data_size = sizeof(MoveHeadMessage_data_t);
1346  data_ptr = malloc(data_size);
1347  memset(data_ptr, 0, data_size);
1348  data = (MoveHeadMessage_data_t *)data_ptr;
1350  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1351  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1352  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1353  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1354  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1355  add_fieldinfo(IFT_FLOAT, "yaw", 1, &data->yaw);
1356  add_fieldinfo(IFT_FLOAT, "pitch", 1, &data->pitch);
1357  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
1358 }
1359 
1360 /** Destructor */
1362 {
1363  free(data_ptr);
1364 }
1365 
1366 /** Copy constructor.
1367  * @param m message to copy from
1368  */
1370 {
1371  data_size = m->data_size;
1372  data_ptr = malloc(data_size);
1373  memcpy(data_ptr, m->data_ptr, data_size);
1374  data = (MoveHeadMessage_data_t *)data_ptr;
1376 }
1377 
1378 /* Methods */
1379 /** Get yaw value.
1380  * Desired yaw (horizontal orientation).
1381  * @return yaw value
1382  */
1383 float
1385 {
1386  return data->yaw;
1387 }
1388 
1389 /** Get maximum length of yaw value.
1390  * @return length of yaw value, can be length of the array or number of
1391  * maximum number of characters for a string
1392  */
1393 size_t
1395 {
1396  return 1;
1397 }
1398 
1399 /** Set yaw value.
1400  * Desired yaw (horizontal orientation).
1401  * @param new_yaw new yaw value
1402  */
1403 void
1405 {
1406  data->yaw = new_yaw;
1407 }
1408 
1409 /** Get pitch value.
1410  * Desired pitch (vertical orientation).
1411  * @return pitch value
1412  */
1413 float
1415 {
1416  return data->pitch;
1417 }
1418 
1419 /** Get maximum length of pitch value.
1420  * @return length of pitch value, can be length of the array or number of
1421  * maximum number of characters for a string
1422  */
1423 size_t
1425 {
1426  return 1;
1427 }
1428 
1429 /** Set pitch value.
1430  * Desired pitch (vertical orientation).
1431  * @param new_pitch new pitch value
1432  */
1433 void
1435 {
1436  data->pitch = new_pitch;
1437 }
1438 
1439 /** Get speed value.
1440  * Maximum speed in [0.0..1.0].
1441  * @return speed value
1442  */
1443 float
1445 {
1446  return data->speed;
1447 }
1448 
1449 /** Get maximum length of speed value.
1450  * @return length of speed value, can be length of the array or number of
1451  * maximum number of characters for a string
1452  */
1453 size_t
1455 {
1456  return 1;
1457 }
1458 
1459 /** Set speed value.
1460  * Maximum speed in [0.0..1.0].
1461  * @param new_speed new speed value
1462  */
1463 void
1465 {
1466  data->speed = new_speed;
1467 }
1468 
1469 /** Clone this message.
1470  * Produces a message of the same type as this message and copies the
1471  * data to the new message.
1472  * @return clone of this message
1473  */
1474 Message *
1476 {
1478 }
1479 /** Check if message is valid and can be enqueued.
1480  * @param message Message to check
1481  * @return true if the message is valid, false otherwise.
1482  */
1483 bool
1485 {
1486  const StopMessage *m0 = dynamic_cast<const StopMessage *>(message);
1487  if ( m0 != NULL ) {
1488  return true;
1489  }
1490  const WalkStraightMessage *m1 = dynamic_cast<const WalkStraightMessage *>(message);
1491  if ( m1 != NULL ) {
1492  return true;
1493  }
1494  const WalkSidewaysMessage *m2 = dynamic_cast<const WalkSidewaysMessage *>(message);
1495  if ( m2 != NULL ) {
1496  return true;
1497  }
1498  const WalkArcMessage *m3 = dynamic_cast<const WalkArcMessage *>(message);
1499  if ( m3 != NULL ) {
1500  return true;
1501  }
1502  const WalkVelocityMessage *m4 = dynamic_cast<const WalkVelocityMessage *>(message);
1503  if ( m4 != NULL ) {
1504  return true;
1505  }
1506  const TurnMessage *m5 = dynamic_cast<const TurnMessage *>(message);
1507  if ( m5 != NULL ) {
1508  return true;
1509  }
1510  const KickMessage *m6 = dynamic_cast<const KickMessage *>(message);
1511  if ( m6 != NULL ) {
1512  return true;
1513  }
1514  const ParkMessage *m7 = dynamic_cast<const ParkMessage *>(message);
1515  if ( m7 != NULL ) {
1516  return true;
1517  }
1518  const GetUpMessage *m8 = dynamic_cast<const GetUpMessage *>(message);
1519  if ( m8 != NULL ) {
1520  return true;
1521  }
1522  const StandupMessage *m9 = dynamic_cast<const StandupMessage *>(message);
1523  if ( m9 != NULL ) {
1524  return true;
1525  }
1526  const MoveHeadMessage *m10 = dynamic_cast<const MoveHeadMessage *>(message);
1527  if ( m10 != NULL ) {
1528  return true;
1529  }
1530  return false;
1531 }
1532 
1533 /// @cond INTERNALS
1534 EXPORT_INTERFACE(HumanoidMotionInterface)
1535 /// @endcond
1536 
1537 
1538 } // end namespace fawkes
uint32_t msgid() const
Get msgid value.
void set_theta(const float new_theta)
Set theta value.
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
StandupMessage Fawkes BlackBoard Interface Message.
void set_angle(const float new_angle)
Set angle value.
TurnMessage Fawkes BlackBoard Interface Message.
virtual Message * create_message(const char *type) const
Create message based on type name.
KickMessage Fawkes BlackBoard Interface Message.
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:314
virtual Message * clone() const
Clone this message.
size_t maxlenof_theta() const
Get maximum length of theta value.
size_t maxlenof_strength() const
Get maximum length of strength value.
Fawkes library namespace.
void set_arms_enabled(const bool new_arms_enabled)
Set arms_enabled value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
Definition: message.h:129
size_t maxlenof_x() const
Get maximum length of x value.
bool is_moving() const
Get moving value.
void set_speed(const float new_speed)
Set speed value.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_y() const
Get maximum length of y value.
WalkVelocityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_speed() const
Get maximum length of speed value.
void set_moving(const bool new_moving)
Set moving value.
GetUpMessage Fawkes BlackBoard Interface Message.
void set_pitch(const float new_pitch)
Set pitch value.
StandupEnum
From which position to standup.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
size_t maxlenof_speed() const
Get maximum length of speed value.
size_t maxlenof_pitch() const
Get maximum length of pitch value.
size_t maxlenof_yaw() const
Get maximum length of yaw value.
LegEnum
Type to determinate leg side.
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
void set_distance(const float new_distance)
Set distance value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_radius() const
Get maximum length of radius value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual Message * clone() const
Clone this message.
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:373
size_t maxlenof_angle() const
Get maximum length of angle value.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
bool data_changed
Indicator if data has changed.
Definition: interface.h:222
size_t maxlenof_angle() const
Get maximum length of angle value.
WalkArcMessage Fawkes BlackBoard Interface Message.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
HumanoidMotionInterface Fawkes BlackBoard Interface.
size_t maxlenof_leg() const
Get maximum length of leg value.
size_t maxlenof_from_pos() const
Get maximum length of from_pos value.
size_t maxlenof_moving() const
Get maximum length of moving value.
bool is_arms_enabled() const
Get arms_enabled value.
StandupEnum from_pos() const
Get from_pos value.
virtual Message * clone() const
Clone this message.
void set_radius(const float new_radius)
Set radius value.
void set_speed(const float new_speed)
Set speed value.
WalkSidewaysMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_arms_enabled() const
Get maximum length of arms_enabled value.
float field
Definition: types.h:45
const char * tostring_LegEnum(LegEnum value) const
Convert LegEnum constant to string.
const char * tostring_StandupEnum(StandupEnum value) const
Convert StandupEnum constant to string.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_distance() const
Get maximum length of distance value.
void set_yaw(const float new_yaw)
Set yaw value.
void set_from_pos(const StandupEnum new_from_pos)
Set from_pos value.
ParkMessage Fawkes BlackBoard Interface Message.
WalkStraightMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
void set_distance(const float new_distance)
Set distance value.
virtual Message * clone() const
Clone this message.
MoveHeadMessage Fawkes BlackBoard Interface Message.
void set_strength(const float new_strength)
Set strength value.
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
StopMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
boolean field
Definition: types.h:36
void set_angle(const float new_angle)
Set angle value.
size_t maxlenof_distance() const
Get maximum length of distance value.
const char * type() const
Get message type.
Definition: message.cpp:378
32 bit unsigned integer field
Definition: types.h:42
field with interface specific enum type
Definition: types.h:49
virtual Message * clone() const
Clone this message.
void set_leg(const LegEnum new_leg)
Set leg value.