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 *
86 HumanoidMotionInterface::tostring_LegEnum(LegEnum value) const
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 *
99 HumanoidMotionInterface::tostring_StandupEnum(StandupEnum value) const
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
114 HumanoidMotionInterface::is_moving() const
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
124 HumanoidMotionInterface::maxlenof_moving() const
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
134 HumanoidMotionInterface::set_moving(const bool new_moving)
135 {
136  set_field(data->moving, new_moving);
137 }
138 
139 /** Get arms_enabled value.
140  *
141  If true the arms are controlled during walking for balancing.
142 
143  * @return arms_enabled value
144  */
145 bool
146 HumanoidMotionInterface::is_arms_enabled() const
147 {
148  return data->arms_enabled;
149 }
150 
151 /** Get maximum length of arms_enabled value.
152  * @return length of arms_enabled value, can be length of the array or number of
153  * maximum number of characters for a string
154  */
155 size_t
156 HumanoidMotionInterface::maxlenof_arms_enabled() const
157 {
158  return 1;
159 }
160 
161 /** Set arms_enabled value.
162  *
163  If true the arms are controlled during walking for balancing.
164 
165  * @param new_arms_enabled new arms_enabled value
166  */
167 void
168 HumanoidMotionInterface::set_arms_enabled(const bool new_arms_enabled)
169 {
170  set_field(data->arms_enabled, new_arms_enabled);
171 }
172 
173 /** Get msgid value.
174  *
175  The ID of the message that is currently being
176  processed, or 0 if no message is being processed.
177 
178  * @return msgid value
179  */
180 uint32_t
181 HumanoidMotionInterface::msgid() const
182 {
183  return data->msgid;
184 }
185 
186 /** Get maximum length of msgid value.
187  * @return length of msgid value, can be length of the array or number of
188  * maximum number of characters for a string
189  */
190 size_t
191 HumanoidMotionInterface::maxlenof_msgid() const
192 {
193  return 1;
194 }
195 
196 /** Set msgid value.
197  *
198  The ID of the message that is currently being
199  processed, or 0 if no message is being processed.
200 
201  * @param new_msgid new msgid value
202  */
203 void
204 HumanoidMotionInterface::set_msgid(const uint32_t new_msgid)
205 {
206  set_field(data->msgid, new_msgid);
207 }
208 
209 /* =========== message create =========== */
210 Message *
211 HumanoidMotionInterface::create_message(const char *type) const
212 {
213  if ( strncmp("StopMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
214  return new StopMessage();
215  } else if ( strncmp("WalkStraightMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
216  return new WalkStraightMessage();
217  } else if ( strncmp("WalkSidewaysMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
218  return new WalkSidewaysMessage();
219  } else if ( strncmp("WalkArcMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
220  return new WalkArcMessage();
221  } else if ( strncmp("WalkVelocityMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
222  return new WalkVelocityMessage();
223  } else if ( strncmp("TurnMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
224  return new TurnMessage();
225  } else if ( strncmp("KickMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
226  return new KickMessage();
227  } else if ( strncmp("ParkMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
228  return new ParkMessage();
229  } else if ( strncmp("GetUpMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
230  return new GetUpMessage();
231  } else if ( strncmp("StandupMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
232  return new StandupMessage();
233  } else if ( strncmp("MoveHeadMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
234  return new MoveHeadMessage();
235  } else {
236  throw UnknownTypeException("The given type '%s' does not match any known "
237  "message type for this interface type.", type);
238  }
239 }
240 
241 
242 /** Copy values from other interface.
243  * @param other other interface to copy values from
244  */
245 void
246 HumanoidMotionInterface::copy_values(const Interface *other)
247 {
248  const HumanoidMotionInterface *oi = dynamic_cast<const HumanoidMotionInterface *>(other);
249  if (oi == NULL) {
250  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
251  type(), other->type());
252  }
253  memcpy(data, oi->data, sizeof(HumanoidMotionInterface_data_t));
254 }
255 
256 const char *
257 HumanoidMotionInterface::enum_tostring(const char *enumtype, int val) const
258 {
259  if (strcmp(enumtype, "LegEnum") == 0) {
260  return tostring_LegEnum((LegEnum)val);
261  }
262  if (strcmp(enumtype, "StandupEnum") == 0) {
263  return tostring_StandupEnum((StandupEnum)val);
264  }
265  throw UnknownTypeException("Unknown enum type %s", enumtype);
266 }
267 
268 /* =========== messages =========== */
269 /** @class HumanoidMotionInterface::StopMessage <interfaces/HumanoidMotionInterface.h>
270  * StopMessage Fawkes BlackBoard Interface Message.
271  *
272 
273  */
274 
275 
276 /** Constructor */
277 HumanoidMotionInterface::StopMessage::StopMessage() : Message("StopMessage")
278 {
279  data_size = sizeof(StopMessage_data_t);
280  data_ptr = malloc(data_size);
281  memset(data_ptr, 0, data_size);
282  data = (StopMessage_data_t *)data_ptr;
284  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
285  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
286  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
287  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
288  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
289 }
290 
291 /** Destructor */
293 {
294  free(data_ptr);
295 }
296 
297 /** Copy constructor.
298  * @param m message to copy from
299  */
301 {
302  data_size = m->data_size;
303  data_ptr = malloc(data_size);
304  memcpy(data_ptr, m->data_ptr, data_size);
305  data = (StopMessage_data_t *)data_ptr;
307 }
308 
309 /* Methods */
310 /** Clone this message.
311  * Produces a message of the same type as this message and copies the
312  * data to the new message.
313  * @return clone of this message
314  */
315 Message *
317 {
318  return new HumanoidMotionInterface::StopMessage(this);
319 }
320 /** @class HumanoidMotionInterface::WalkStraightMessage <interfaces/HumanoidMotionInterface.h>
321  * WalkStraightMessage Fawkes BlackBoard Interface Message.
322  *
323 
324  */
325 
326 
327 /** Constructor with initial values.
328  * @param ini_distance initial value for distance
329  */
330 HumanoidMotionInterface::WalkStraightMessage::WalkStraightMessage(const float ini_distance) : Message("WalkStraightMessage")
331 {
332  data_size = sizeof(WalkStraightMessage_data_t);
333  data_ptr = malloc(data_size);
334  memset(data_ptr, 0, data_size);
335  data = (WalkStraightMessage_data_t *)data_ptr;
337  data->distance = ini_distance;
338  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
339  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
340  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
341  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
342  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
343  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
344 }
345 /** Constructor */
347 {
348  data_size = sizeof(WalkStraightMessage_data_t);
349  data_ptr = malloc(data_size);
350  memset(data_ptr, 0, data_size);
351  data = (WalkStraightMessage_data_t *)data_ptr;
353  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
354  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
355  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
356  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
357  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
358  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
359 }
360 
361 /** Destructor */
363 {
364  free(data_ptr);
365 }
366 
367 /** Copy constructor.
368  * @param m message to copy from
369  */
371 {
372  data_size = m->data_size;
373  data_ptr = malloc(data_size);
374  memcpy(data_ptr, m->data_ptr, data_size);
375  data = (WalkStraightMessage_data_t *)data_ptr;
377 }
378 
379 /* Methods */
380 /** Get distance value.
381  * Distance in m to walk.
382  * @return distance value
383  */
384 float
386 {
387  return data->distance;
388 }
389 
390 /** Get maximum length of distance value.
391  * @return length of distance value, can be length of the array or number of
392  * maximum number of characters for a string
393  */
394 size_t
396 {
397  return 1;
398 }
399 
400 /** Set distance value.
401  * Distance in m to walk.
402  * @param new_distance new distance value
403  */
404 void
406 {
407  set_field(data->distance, new_distance);
408 }
409 
410 /** Clone this message.
411  * Produces a message of the same type as this message and copies the
412  * data to the new message.
413  * @return clone of this message
414  */
415 Message *
417 {
419 }
420 /** @class HumanoidMotionInterface::WalkSidewaysMessage <interfaces/HumanoidMotionInterface.h>
421  * WalkSidewaysMessage Fawkes BlackBoard Interface Message.
422  *
423 
424  */
425 
426 
427 /** Constructor with initial values.
428  * @param ini_distance initial value for distance
429  */
430 HumanoidMotionInterface::WalkSidewaysMessage::WalkSidewaysMessage(const float ini_distance) : Message("WalkSidewaysMessage")
431 {
432  data_size = sizeof(WalkSidewaysMessage_data_t);
433  data_ptr = malloc(data_size);
434  memset(data_ptr, 0, data_size);
435  data = (WalkSidewaysMessage_data_t *)data_ptr;
437  data->distance = ini_distance;
438  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
439  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
440  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
441  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
442  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
443  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
444 }
445 /** Constructor */
447 {
448  data_size = sizeof(WalkSidewaysMessage_data_t);
449  data_ptr = malloc(data_size);
450  memset(data_ptr, 0, data_size);
451  data = (WalkSidewaysMessage_data_t *)data_ptr;
453  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
454  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
455  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
456  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
457  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
458  add_fieldinfo(IFT_FLOAT, "distance", 1, &data->distance);
459 }
460 
461 /** Destructor */
463 {
464  free(data_ptr);
465 }
466 
467 /** Copy constructor.
468  * @param m message to copy from
469  */
471 {
472  data_size = m->data_size;
473  data_ptr = malloc(data_size);
474  memcpy(data_ptr, m->data_ptr, data_size);
475  data = (WalkSidewaysMessage_data_t *)data_ptr;
477 }
478 
479 /* Methods */
480 /** Get distance value.
481  * Distance in m to walk.
482  * @return distance value
483  */
484 float
486 {
487  return data->distance;
488 }
489 
490 /** Get maximum length of distance value.
491  * @return length of distance value, can be length of the array or number of
492  * maximum number of characters for a string
493  */
494 size_t
496 {
497  return 1;
498 }
499 
500 /** Set distance value.
501  * Distance in m to walk.
502  * @param new_distance new distance value
503  */
504 void
506 {
507  set_field(data->distance, new_distance);
508 }
509 
510 /** Clone this message.
511  * Produces a message of the same type as this message and copies the
512  * data to the new message.
513  * @return clone of this message
514  */
515 Message *
517 {
519 }
520 /** @class HumanoidMotionInterface::WalkArcMessage <interfaces/HumanoidMotionInterface.h>
521  * WalkArcMessage Fawkes BlackBoard Interface Message.
522  *
523 
524  */
525 
526 
527 /** Constructor with initial values.
528  * @param ini_angle initial value for angle
529  * @param ini_radius initial value for radius
530  */
531 HumanoidMotionInterface::WalkArcMessage::WalkArcMessage(const float ini_angle, const float ini_radius) : Message("WalkArcMessage")
532 {
533  data_size = sizeof(WalkArcMessage_data_t);
534  data_ptr = malloc(data_size);
535  memset(data_ptr, 0, data_size);
536  data = (WalkArcMessage_data_t *)data_ptr;
538  data->angle = ini_angle;
539  data->radius = ini_radius;
540  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
541  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
542  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
543  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
544  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
545  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
546  add_fieldinfo(IFT_FLOAT, "radius", 1, &data->radius);
547 }
548 /** Constructor */
550 {
551  data_size = sizeof(WalkArcMessage_data_t);
552  data_ptr = malloc(data_size);
553  memset(data_ptr, 0, data_size);
554  data = (WalkArcMessage_data_t *)data_ptr;
556  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
557  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
558  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
559  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
560  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
561  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
562  add_fieldinfo(IFT_FLOAT, "radius", 1, &data->radius);
563 }
564 
565 /** Destructor */
567 {
568  free(data_ptr);
569 }
570 
571 /** Copy constructor.
572  * @param m message to copy from
573  */
575 {
576  data_size = m->data_size;
577  data_ptr = malloc(data_size);
578  memcpy(data_ptr, m->data_ptr, data_size);
579  data = (WalkArcMessage_data_t *)data_ptr;
581 }
582 
583 /* Methods */
584 /** Get angle value.
585  * Angle in radians to turn over the way.
586  * @return angle value
587  */
588 float
590 {
591  return data->angle;
592 }
593 
594 /** Get maximum length of angle value.
595  * @return length of angle value, can be length of the array or number of
596  * maximum number of characters for a string
597  */
598 size_t
600 {
601  return 1;
602 }
603 
604 /** Set angle value.
605  * Angle in radians to turn over the way.
606  * @param new_angle new angle value
607  */
608 void
610 {
611  set_field(data->angle, new_angle);
612 }
613 
614 /** Get radius value.
615  * Radius in m of the circle in m.
616  * @return radius value
617  */
618 float
620 {
621  return data->radius;
622 }
623 
624 /** Get maximum length of radius value.
625  * @return length of radius value, can be length of the array or number of
626  * maximum number of characters for a string
627  */
628 size_t
630 {
631  return 1;
632 }
633 
634 /** Set radius value.
635  * Radius in m of the circle in m.
636  * @param new_radius new radius value
637  */
638 void
640 {
641  set_field(data->radius, new_radius);
642 }
643 
644 /** Clone this message.
645  * Produces a message of the same type as this message and copies the
646  * data to the new message.
647  * @return clone of this message
648  */
649 Message *
651 {
653 }
654 /** @class HumanoidMotionInterface::WalkVelocityMessage <interfaces/HumanoidMotionInterface.h>
655  * WalkVelocityMessage Fawkes BlackBoard Interface Message.
656  *
657 
658  */
659 
660 
661 /** Constructor with initial values.
662  * @param ini_x initial value for x
663  * @param ini_y initial value for y
664  * @param ini_theta initial value for theta
665  * @param ini_speed initial value for speed
666  */
667 HumanoidMotionInterface::WalkVelocityMessage::WalkVelocityMessage(const float ini_x, const float ini_y, const float ini_theta, const float ini_speed) : Message("WalkVelocityMessage")
668 {
669  data_size = sizeof(WalkVelocityMessage_data_t);
670  data_ptr = malloc(data_size);
671  memset(data_ptr, 0, data_size);
672  data = (WalkVelocityMessage_data_t *)data_ptr;
674  data->x = ini_x;
675  data->y = ini_y;
676  data->theta = ini_theta;
677  data->speed = ini_speed;
678  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
679  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
680  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
681  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
682  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
683  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
684  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
685  add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta);
686  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
687 }
688 /** Constructor */
690 {
691  data_size = sizeof(WalkVelocityMessage_data_t);
692  data_ptr = malloc(data_size);
693  memset(data_ptr, 0, data_size);
694  data = (WalkVelocityMessage_data_t *)data_ptr;
696  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
697  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
698  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
699  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
700  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
701  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
702  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
703  add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta);
704  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
705 }
706 
707 /** Destructor */
709 {
710  free(data_ptr);
711 }
712 
713 /** Copy constructor.
714  * @param m message to copy from
715  */
717 {
718  data_size = m->data_size;
719  data_ptr = malloc(data_size);
720  memcpy(data_ptr, m->data_ptr, data_size);
721  data = (WalkVelocityMessage_data_t *)data_ptr;
723 }
724 
725 /* Methods */
726 /** Get x value.
727  *
728  Fraction of MaxStepX. Use negative for backwards. [-1.0 to 1.0].
729 
730  * @return x value
731  */
732 float
734 {
735  return data->x;
736 }
737 
738 /** Get maximum length of x value.
739  * @return length of x value, can be length of the array or number of
740  * maximum number of characters for a string
741  */
742 size_t
744 {
745  return 1;
746 }
747 
748 /** Set x value.
749  *
750  Fraction of MaxStepX. Use negative for backwards. [-1.0 to 1.0].
751 
752  * @param new_x new x value
753  */
754 void
756 {
757  set_field(data->x, new_x);
758 }
759 
760 /** Get y value.
761  *
762  Fraction of MaxStepY. Use negative for right. [-1.0 to 1.0].
763 
764  * @return y value
765  */
766 float
768 {
769  return data->y;
770 }
771 
772 /** Get maximum length of y value.
773  * @return length of y value, can be length of the array or number of
774  * maximum number of characters for a string
775  */
776 size_t
778 {
779  return 1;
780 }
781 
782 /** Set y value.
783  *
784  Fraction of MaxStepY. Use negative for right. [-1.0 to 1.0].
785 
786  * @param new_y new y value
787  */
788 void
790 {
791  set_field(data->y, new_y);
792 }
793 
794 /** Get theta value.
795  *
796  Fraction of MaxStepTheta. Use negative for clockwise [-1.0 to 1.0].
797 
798  * @return theta value
799  */
800 float
802 {
803  return data->theta;
804 }
805 
806 /** Get maximum length of theta value.
807  * @return length of theta value, can be length of the array or number of
808  * maximum number of characters for a string
809  */
810 size_t
812 {
813  return 1;
814 }
815 
816 /** Set theta value.
817  *
818  Fraction of MaxStepTheta. Use negative for clockwise [-1.0 to 1.0].
819 
820  * @param new_theta new theta value
821  */
822 void
824 {
825  set_field(data->theta, new_theta);
826 }
827 
828 /** Get speed value.
829  *
830  Fraction of MaxStepFrequency [0.0 to 1.0].
831 
832  * @return speed value
833  */
834 float
836 {
837  return data->speed;
838 }
839 
840 /** Get maximum length of speed value.
841  * @return length of speed value, can be length of the array or number of
842  * maximum number of characters for a string
843  */
844 size_t
846 {
847  return 1;
848 }
849 
850 /** Set speed value.
851  *
852  Fraction of MaxStepFrequency [0.0 to 1.0].
853 
854  * @param new_speed new speed value
855  */
856 void
858 {
859  set_field(data->speed, new_speed);
860 }
861 
862 /** Clone this message.
863  * Produces a message of the same type as this message and copies the
864  * data to the new message.
865  * @return clone of this message
866  */
867 Message *
869 {
871 }
872 /** @class HumanoidMotionInterface::TurnMessage <interfaces/HumanoidMotionInterface.h>
873  * TurnMessage Fawkes BlackBoard Interface Message.
874  *
875 
876  */
877 
878 
879 /** Constructor with initial values.
880  * @param ini_angle initial value for angle
881  */
882 HumanoidMotionInterface::TurnMessage::TurnMessage(const float ini_angle) : Message("TurnMessage")
883 {
884  data_size = sizeof(TurnMessage_data_t);
885  data_ptr = malloc(data_size);
886  memset(data_ptr, 0, data_size);
887  data = (TurnMessage_data_t *)data_ptr;
889  data->angle = ini_angle;
890  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
891  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
892  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
893  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
894  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
895  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
896 }
897 /** Constructor */
899 {
900  data_size = sizeof(TurnMessage_data_t);
901  data_ptr = malloc(data_size);
902  memset(data_ptr, 0, data_size);
903  data = (TurnMessage_data_t *)data_ptr;
905  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
906  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
907  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
908  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
909  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
910  add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle);
911 }
912 
913 /** Destructor */
915 {
916  free(data_ptr);
917 }
918 
919 /** Copy constructor.
920  * @param m message to copy from
921  */
923 {
924  data_size = m->data_size;
925  data_ptr = malloc(data_size);
926  memcpy(data_ptr, m->data_ptr, data_size);
927  data = (TurnMessage_data_t *)data_ptr;
929 }
930 
931 /* Methods */
932 /** Get angle value.
933  * Angle in radians to turn.
934  * @return angle value
935  */
936 float
938 {
939  return data->angle;
940 }
941 
942 /** Get maximum length of angle value.
943  * @return length of angle value, can be length of the array or number of
944  * maximum number of characters for a string
945  */
946 size_t
948 {
949  return 1;
950 }
951 
952 /** Set angle value.
953  * Angle in radians to turn.
954  * @param new_angle new angle value
955  */
956 void
958 {
959  set_field(data->angle, new_angle);
960 }
961 
962 /** Clone this message.
963  * Produces a message of the same type as this message and copies the
964  * data to the new message.
965  * @return clone of this message
966  */
967 Message *
969 {
970  return new HumanoidMotionInterface::TurnMessage(this);
971 }
972 /** @class HumanoidMotionInterface::KickMessage <interfaces/HumanoidMotionInterface.h>
973  * KickMessage Fawkes BlackBoard Interface Message.
974  *
975 
976  */
977 
978 
979 /** Constructor with initial values.
980  * @param ini_leg initial value for leg
981  * @param ini_strength initial value for strength
982  */
983 HumanoidMotionInterface::KickMessage::KickMessage(const LegEnum ini_leg, const float ini_strength) : Message("KickMessage")
984 {
985  data_size = sizeof(KickMessage_data_t);
986  data_ptr = malloc(data_size);
987  memset(data_ptr, 0, data_size);
988  data = (KickMessage_data_t *)data_ptr;
990  data->leg = ini_leg;
991  data->strength = ini_strength;
992  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
993  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
994  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
995  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
996  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
997  add_fieldinfo(IFT_ENUM, "leg", 1, &data->leg, "LegEnum", &enum_map_LegEnum);
998  add_fieldinfo(IFT_FLOAT, "strength", 1, &data->strength);
999 }
1000 /** Constructor */
1002 {
1003  data_size = sizeof(KickMessage_data_t);
1004  data_ptr = malloc(data_size);
1005  memset(data_ptr, 0, data_size);
1006  data = (KickMessage_data_t *)data_ptr;
1008  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1009  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1010  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1011  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1012  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1013  add_fieldinfo(IFT_ENUM, "leg", 1, &data->leg, "LegEnum", &enum_map_LegEnum);
1014  add_fieldinfo(IFT_FLOAT, "strength", 1, &data->strength);
1015 }
1016 
1017 /** Destructor */
1019 {
1020  free(data_ptr);
1021 }
1022 
1023 /** Copy constructor.
1024  * @param m message to copy from
1025  */
1027 {
1028  data_size = m->data_size;
1029  data_ptr = malloc(data_size);
1030  memcpy(data_ptr, m->data_ptr, data_size);
1031  data = (KickMessage_data_t *)data_ptr;
1033 }
1034 
1035 /* Methods */
1036 /** Get leg value.
1037  * Leg to kick with
1038  * @return leg value
1039  */
1042 {
1043  return (HumanoidMotionInterface::LegEnum)data->leg;
1044 }
1045 
1046 /** Get maximum length of leg value.
1047  * @return length of leg value, can be length of the array or number of
1048  * maximum number of characters for a string
1049  */
1050 size_t
1052 {
1053  return 1;
1054 }
1055 
1056 /** Set leg value.
1057  * Leg to kick with
1058  * @param new_leg new leg value
1059  */
1060 void
1062 {
1063  set_field(data->leg, new_leg);
1064 }
1065 
1066 /** Get strength value.
1067  * Kick strength
1068  * @return strength value
1069  */
1070 float
1072 {
1073  return data->strength;
1074 }
1075 
1076 /** Get maximum length of strength value.
1077  * @return length of strength value, can be length of the array or number of
1078  * maximum number of characters for a string
1079  */
1080 size_t
1082 {
1083  return 1;
1084 }
1085 
1086 /** Set strength value.
1087  * Kick strength
1088  * @param new_strength new strength value
1089  */
1090 void
1092 {
1093  set_field(data->strength, new_strength);
1094 }
1095 
1096 /** Clone this message.
1097  * Produces a message of the same type as this message and copies the
1098  * data to the new message.
1099  * @return clone of this message
1100  */
1101 Message *
1103 {
1104  return new HumanoidMotionInterface::KickMessage(this);
1105 }
1106 /** @class HumanoidMotionInterface::ParkMessage <interfaces/HumanoidMotionInterface.h>
1107  * ParkMessage Fawkes BlackBoard Interface Message.
1108  *
1109 
1110  */
1111 
1112 
1113 /** Constructor */
1115 {
1116  data_size = sizeof(ParkMessage_data_t);
1117  data_ptr = malloc(data_size);
1118  memset(data_ptr, 0, data_size);
1119  data = (ParkMessage_data_t *)data_ptr;
1121  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1122  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1123  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1124  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1125  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1126 }
1127 
1128 /** Destructor */
1130 {
1131  free(data_ptr);
1132 }
1133 
1134 /** Copy constructor.
1135  * @param m message to copy from
1136  */
1138 {
1139  data_size = m->data_size;
1140  data_ptr = malloc(data_size);
1141  memcpy(data_ptr, m->data_ptr, data_size);
1142  data = (ParkMessage_data_t *)data_ptr;
1144 }
1145 
1146 /* Methods */
1147 /** Clone this message.
1148  * Produces a message of the same type as this message and copies the
1149  * data to the new message.
1150  * @return clone of this message
1151  */
1152 Message *
1154 {
1155  return new HumanoidMotionInterface::ParkMessage(this);
1156 }
1157 /** @class HumanoidMotionInterface::GetUpMessage <interfaces/HumanoidMotionInterface.h>
1158  * GetUpMessage Fawkes BlackBoard Interface Message.
1159  *
1160 
1161  */
1162 
1163 
1164 /** Constructor */
1166 {
1167  data_size = sizeof(GetUpMessage_data_t);
1168  data_ptr = malloc(data_size);
1169  memset(data_ptr, 0, data_size);
1170  data = (GetUpMessage_data_t *)data_ptr;
1172  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1173  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1174  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1175  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1176  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1177 }
1178 
1179 /** Destructor */
1181 {
1182  free(data_ptr);
1183 }
1184 
1185 /** Copy constructor.
1186  * @param m message to copy from
1187  */
1189 {
1190  data_size = m->data_size;
1191  data_ptr = malloc(data_size);
1192  memcpy(data_ptr, m->data_ptr, data_size);
1193  data = (GetUpMessage_data_t *)data_ptr;
1195 }
1196 
1197 /* Methods */
1198 /** Clone this message.
1199  * Produces a message of the same type as this message and copies the
1200  * data to the new message.
1201  * @return clone of this message
1202  */
1203 Message *
1205 {
1206  return new HumanoidMotionInterface::GetUpMessage(this);
1207 }
1208 /** @class HumanoidMotionInterface::StandupMessage <interfaces/HumanoidMotionInterface.h>
1209  * StandupMessage Fawkes BlackBoard Interface Message.
1210  *
1211 
1212  */
1213 
1214 
1215 /** Constructor with initial values.
1216  * @param ini_from_pos initial value for from_pos
1217  */
1219 {
1220  data_size = sizeof(StandupMessage_data_t);
1221  data_ptr = malloc(data_size);
1222  memset(data_ptr, 0, data_size);
1223  data = (StandupMessage_data_t *)data_ptr;
1225  data->from_pos = ini_from_pos;
1226  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1227  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1228  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1229  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1230  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1231  add_fieldinfo(IFT_ENUM, "from_pos", 1, &data->from_pos, "StandupEnum", &enum_map_StandupEnum);
1232 }
1233 /** Constructor */
1235 {
1236  data_size = sizeof(StandupMessage_data_t);
1237  data_ptr = malloc(data_size);
1238  memset(data_ptr, 0, data_size);
1239  data = (StandupMessage_data_t *)data_ptr;
1241  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1242  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1243  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1244  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1245  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1246  add_fieldinfo(IFT_ENUM, "from_pos", 1, &data->from_pos, "StandupEnum", &enum_map_StandupEnum);
1247 }
1248 
1249 /** Destructor */
1251 {
1252  free(data_ptr);
1253 }
1254 
1255 /** Copy constructor.
1256  * @param m message to copy from
1257  */
1259 {
1260  data_size = m->data_size;
1261  data_ptr = malloc(data_size);
1262  memcpy(data_ptr, m->data_ptr, data_size);
1263  data = (StandupMessage_data_t *)data_ptr;
1265 }
1266 
1267 /* Methods */
1268 /** Get from_pos value.
1269  * Position from where to standup.
1270  * @return from_pos value
1271  */
1274 {
1275  return (HumanoidMotionInterface::StandupEnum)data->from_pos;
1276 }
1277 
1278 /** Get maximum length of from_pos value.
1279  * @return length of from_pos value, can be length of the array or number of
1280  * maximum number of characters for a string
1281  */
1282 size_t
1284 {
1285  return 1;
1286 }
1287 
1288 /** Set from_pos value.
1289  * Position from where to standup.
1290  * @param new_from_pos new from_pos value
1291  */
1292 void
1294 {
1295  set_field(data->from_pos, new_from_pos);
1296 }
1297 
1298 /** Clone this message.
1299  * Produces a message of the same type as this message and copies the
1300  * data to the new message.
1301  * @return clone of this message
1302  */
1303 Message *
1305 {
1306  return new HumanoidMotionInterface::StandupMessage(this);
1307 }
1308 /** @class HumanoidMotionInterface::MoveHeadMessage <interfaces/HumanoidMotionInterface.h>
1309  * MoveHeadMessage Fawkes BlackBoard Interface Message.
1310  *
1311 
1312  */
1313 
1314 
1315 /** Constructor with initial values.
1316  * @param ini_yaw initial value for yaw
1317  * @param ini_pitch initial value for pitch
1318  * @param ini_speed initial value for speed
1319  */
1320 HumanoidMotionInterface::MoveHeadMessage::MoveHeadMessage(const float ini_yaw, const float ini_pitch, const float ini_speed) : Message("MoveHeadMessage")
1321 {
1322  data_size = sizeof(MoveHeadMessage_data_t);
1323  data_ptr = malloc(data_size);
1324  memset(data_ptr, 0, data_size);
1325  data = (MoveHeadMessage_data_t *)data_ptr;
1327  data->yaw = ini_yaw;
1328  data->pitch = ini_pitch;
1329  data->speed = ini_speed;
1330  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1331  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1332  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1333  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1334  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1335  add_fieldinfo(IFT_FLOAT, "yaw", 1, &data->yaw);
1336  add_fieldinfo(IFT_FLOAT, "pitch", 1, &data->pitch);
1337  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
1338 }
1339 /** Constructor */
1341 {
1342  data_size = sizeof(MoveHeadMessage_data_t);
1343  data_ptr = malloc(data_size);
1344  memset(data_ptr, 0, data_size);
1345  data = (MoveHeadMessage_data_t *)data_ptr;
1347  enum_map_LegEnum[(int)LEG_LEFT] = "LEG_LEFT";
1348  enum_map_LegEnum[(int)LEG_RIGHT] = "LEG_RIGHT";
1349  enum_map_StandupEnum[(int)STANDUP_DETECT] = "STANDUP_DETECT";
1350  enum_map_StandupEnum[(int)STANDUP_BACK] = "STANDUP_BACK";
1351  enum_map_StandupEnum[(int)STANDUP_FRONT] = "STANDUP_FRONT";
1352  add_fieldinfo(IFT_FLOAT, "yaw", 1, &data->yaw);
1353  add_fieldinfo(IFT_FLOAT, "pitch", 1, &data->pitch);
1354  add_fieldinfo(IFT_FLOAT, "speed", 1, &data->speed);
1355 }
1356 
1357 /** Destructor */
1359 {
1360  free(data_ptr);
1361 }
1362 
1363 /** Copy constructor.
1364  * @param m message to copy from
1365  */
1367 {
1368  data_size = m->data_size;
1369  data_ptr = malloc(data_size);
1370  memcpy(data_ptr, m->data_ptr, data_size);
1371  data = (MoveHeadMessage_data_t *)data_ptr;
1373 }
1374 
1375 /* Methods */
1376 /** Get yaw value.
1377  * Desired yaw (horizontal orientation).
1378  * @return yaw value
1379  */
1380 float
1382 {
1383  return data->yaw;
1384 }
1385 
1386 /** Get maximum length of yaw value.
1387  * @return length of yaw value, can be length of the array or number of
1388  * maximum number of characters for a string
1389  */
1390 size_t
1392 {
1393  return 1;
1394 }
1395 
1396 /** Set yaw value.
1397  * Desired yaw (horizontal orientation).
1398  * @param new_yaw new yaw value
1399  */
1400 void
1402 {
1403  set_field(data->yaw, new_yaw);
1404 }
1405 
1406 /** Get pitch value.
1407  * Desired pitch (vertical orientation).
1408  * @return pitch value
1409  */
1410 float
1412 {
1413  return data->pitch;
1414 }
1415 
1416 /** Get maximum length of pitch value.
1417  * @return length of pitch value, can be length of the array or number of
1418  * maximum number of characters for a string
1419  */
1420 size_t
1422 {
1423  return 1;
1424 }
1425 
1426 /** Set pitch value.
1427  * Desired pitch (vertical orientation).
1428  * @param new_pitch new pitch value
1429  */
1430 void
1432 {
1433  set_field(data->pitch, new_pitch);
1434 }
1435 
1436 /** Get speed value.
1437  * Maximum speed in [0.0..1.0].
1438  * @return speed value
1439  */
1440 float
1442 {
1443  return data->speed;
1444 }
1445 
1446 /** Get maximum length of speed value.
1447  * @return length of speed value, can be length of the array or number of
1448  * maximum number of characters for a string
1449  */
1450 size_t
1452 {
1453  return 1;
1454 }
1455 
1456 /** Set speed value.
1457  * Maximum speed in [0.0..1.0].
1458  * @param new_speed new speed value
1459  */
1460 void
1462 {
1463  set_field(data->speed, new_speed);
1464 }
1465 
1466 /** Clone this message.
1467  * Produces a message of the same type as this message and copies the
1468  * data to the new message.
1469  * @return clone of this message
1470  */
1471 Message *
1473 {
1475 }
1476 /** Check if message is valid and can be enqueued.
1477  * @param message Message to check
1478  * @return true if the message is valid, false otherwise.
1479  */
1480 bool
1482 {
1483  const StopMessage *m0 = dynamic_cast<const StopMessage *>(message);
1484  if ( m0 != NULL ) {
1485  return true;
1486  }
1487  const WalkStraightMessage *m1 = dynamic_cast<const WalkStraightMessage *>(message);
1488  if ( m1 != NULL ) {
1489  return true;
1490  }
1491  const WalkSidewaysMessage *m2 = dynamic_cast<const WalkSidewaysMessage *>(message);
1492  if ( m2 != NULL ) {
1493  return true;
1494  }
1495  const WalkArcMessage *m3 = dynamic_cast<const WalkArcMessage *>(message);
1496  if ( m3 != NULL ) {
1497  return true;
1498  }
1499  const WalkVelocityMessage *m4 = dynamic_cast<const WalkVelocityMessage *>(message);
1500  if ( m4 != NULL ) {
1501  return true;
1502  }
1503  const TurnMessage *m5 = dynamic_cast<const TurnMessage *>(message);
1504  if ( m5 != NULL ) {
1505  return true;
1506  }
1507  const KickMessage *m6 = dynamic_cast<const KickMessage *>(message);
1508  if ( m6 != NULL ) {
1509  return true;
1510  }
1511  const ParkMessage *m7 = dynamic_cast<const ParkMessage *>(message);
1512  if ( m7 != NULL ) {
1513  return true;
1514  }
1515  const GetUpMessage *m8 = dynamic_cast<const GetUpMessage *>(message);
1516  if ( m8 != NULL ) {
1517  return true;
1518  }
1519  const StandupMessage *m9 = dynamic_cast<const StandupMessage *>(message);
1520  if ( m9 != NULL ) {
1521  return true;
1522  }
1523  const MoveHeadMessage *m10 = dynamic_cast<const MoveHeadMessage *>(message);
1524  if ( m10 != NULL ) {
1525  return true;
1526  }
1527  return false;
1528 }
1529 
1530 /// @cond INTERNALS
1531 EXPORT_INTERFACE(HumanoidMotionInterface)
1532 /// @endcond
1533 
1534 
1535 } // end namespace fawkes
GetUpMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
KickMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_strength(const float new_strength)
Set strength value.
size_t maxlenof_strength() const
Get maximum length of strength value.
void set_leg(const LegEnum new_leg)
Set leg value.
size_t maxlenof_leg() const
Get maximum length of leg value.
MoveHeadMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_speed() const
Get maximum length of speed value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_pitch() const
Get maximum length of pitch value.
void set_speed(const float new_speed)
Set speed value.
void set_pitch(const float new_pitch)
Set pitch value.
size_t maxlenof_yaw() const
Get maximum length of yaw value.
ParkMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
StandupMessage Fawkes BlackBoard Interface Message.
void set_from_pos(const StandupEnum new_from_pos)
Set from_pos value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_from_pos() const
Get maximum length of from_pos value.
StopMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
TurnMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_angle() const
Get maximum length of angle value.
virtual Message * clone() const
Clone this message.
void set_angle(const float new_angle)
Set angle value.
WalkArcMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_angle() const
Get maximum length of angle value.
void set_angle(const float new_angle)
Set angle value.
void set_radius(const float new_radius)
Set radius value.
size_t maxlenof_radius() const
Get maximum length of radius value.
virtual Message * clone() const
Clone this message.
WalkSidewaysMessage Fawkes BlackBoard Interface Message.
void set_distance(const float new_distance)
Set distance value.
size_t maxlenof_distance() const
Get maximum length of distance value.
virtual Message * clone() const
Clone this message.
WalkStraightMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_distance() const
Get maximum length of distance value.
void set_distance(const float new_distance)
Set distance value.
virtual Message * clone() const
Clone this message.
WalkVelocityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_speed() const
Get maximum length of speed value.
void set_speed(const float new_speed)
Set speed value.
void set_theta(const float new_theta)
Set theta value.
size_t maxlenof_x() const
Get maximum length of x value.
size_t maxlenof_theta() const
Get maximum length of theta value.
size_t maxlenof_y() const
Get maximum length of y value.
virtual Message * clone() const
Clone this message.
HumanoidMotionInterface Fawkes BlackBoard Interface.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
LegEnum
Type to determinate leg side.
StandupEnum
From which position to standup.
@ STANDUP_DETECT
Detect via accelerometer.
@ STANDUP_BACK
Standup from lying on the back.
@ STANDUP_FRONT
Standup from lying on the tummy.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
const char * type() const
Get type of interface.
Definition: interface.cpp:652
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:244
void set_field(FieldT &field, DataT &data)
Set a field, set data_changed to true and update data_changed accordingly.
Definition: interface.h:304
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
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:435
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:146
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:156
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:147
Fawkes library namespace.
@ IFT_FLOAT
float field
Definition: types.h:46
@ IFT_ENUM
field with interface specific enum type
Definition: types.h:50
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:152