Fawkes API Fawkes Development Version
NavGraphGeneratorInterface.h
1
2/***************************************************************************
3 * NavGraphGeneratorInterface.h - Fawkes BlackBoard Interface - NavGraphGeneratorInterface
4 *
5 * Templated created: Thu Oct 12 10:49:19 2006
6 * Copyright 2015-2017 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#ifndef _INTERFACES_NAVGRAPHGENERATORINTERFACE_H_
25#define _INTERFACES_NAVGRAPHGENERATORINTERFACE_H_
26
27#include <interface/interface.h>
28#include <interface/message.h>
29#include <interface/field_iterator.h>
30
31namespace fawkes {
32
34{
35 /// @cond INTERNALS
36 INTERFACE_MGMT_FRIENDS(NavGraphGeneratorInterface)
37 /// @endcond
38 public:
39 /* constants */
40
41 /** Describe how to connect nodes to the graph. */
42 typedef enum {
43 NOT_CONNECTED /**<
44 The node is will not be initially connected.
45
46 The difference to UNCONNECTED is that we do not connect the
47 nodes just now, but will do so later, e.g. by adding
48 edges. Note that it is an error not to connect the node later.
49 */,
50 UNCONNECTED /**<
51 The node is marked as unconnected and will not be connected to
52 another node. This kind of nodes is useful to mark points and
53 possibly assign properties without needing to travel to it.
54
55 The difference to NOT_CONNECTED is that the nodes will be
56 explicitly marked as not being connected and it is an error to
57 connect them.
58 */,
59 CLOSEST_NODE /**<
60 Connect point to the node on the graph closest to the given
61 point.
62 */,
63 CLOSEST_EDGE /**<
64 Connect point to the edge in which segment it lies, i.e. search
65 for an edge where we can find a perpendicular line going
66 through the given point and any point on the edge's line
67 segment. If no such segment is found, the point cannot be
68 added.
69 */,
71 First try the CLOSEST_EDGE method. If that yields no result,
72 use the CLOSEST_NODE method as a fallback.
73 */
75 const char * tostring_ConnectionMode(ConnectionMode value) const;
76
77 /** Post-processing filtering type. */
78 typedef enum {
80 If enabled, filters out all edges after the map generation that
81 pass too close by an occupied cell of the map. Use this to get
82 rid of connections which "pass through walls".
83 Note that this step is done before adding points of interest.
84 Therefore edges going to POIs might still pass through or close
85 by occupied cells.
86
87 Parameters:
88 distance: minimum distance from edges to occupied map grid
89 cells to consider it safe.
90 */,
92 If enabled, filters out all nodes which are not connected to
93 any other node. These can occur, for example, after performing
94 the FILTER_EDGES_BY_MAP filter.
95 */,
97 Sometimes after applying other filters one can end up with
98 multiple disconnected graphs. Enabling this filter will keep
99 only the largest connected graph and simply remove all nodes
100 and edges from smaller graphs not connected to the largest.
101 */
103 const char * tostring_FilterType(FilterType value) const;
104
105 /**
106 When adding edges, the mode defines how to add edges.
107 */
108 typedef enum {
109 NO_INTERSECTION /**<
110 Only insert edge if it does not intersect with any other
111 existing edge in the graph.
112 */,
114 If the new edge intersects with one or more edges, add new
115 points at the intersections and split the edges for this
116 point.
117 */,
118 FORCE /**<
119 The edge is added as-is, it may overlap or intersect with
120 other edges.
121 */
123 const char * tostring_EdgeMode(EdgeMode value) const;
124
125 /**
126 Available generator algorithms.
127 */
128 typedef enum {
130 Voronoi-based algorithm for navgraph generation.
131 This is the default if no algorithm is set.
132 */,
133 ALGORITHM_GRID /**<
134 Grid-based algorithm with customizable spacing.
135
136 Parameters:
137 - spacing: the grid spacing in meters
138 (float, m, mandatory)
139 - margin: the minimum distances of edges to obstacles
140 (float, m, mandatory)
141 - add-diagonals: enable adding of diagonal edges in grid cells
142 (bool, optional, default: false)
143 */
145 const char * tostring_Algorithm(Algorithm value) const;
146
147 private:
148 /** Internal data storage, do NOT modify! */
149 typedef struct {
150 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
151 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
152 uint32_t msgid; /**<
153 The ID of the message that is currently being processed or
154 was processed last.
155 */
156 bool final; /**<
157 True, if the last generation triggered by a ComputeMessage has
158 been completed, false if it is still running. Also check the
159 msgid field if this field applies to the correct message.
160 */
161 bool ok; /**<
162 Indicate success (true) or failure (false) of the most recent
163 navgraph generation (valid if final equals true).
164 */
165 char error_message[128]; /**<
166 If the "ok" field is false, may give an additional clue about
167 the encountered error.
168 */
169 } NavGraphGeneratorInterface_data_t;
170
171 NavGraphGeneratorInterface_data_t *data;
172
173 interface_enum_map_t enum_map_ConnectionMode;
174 interface_enum_map_t enum_map_FilterType;
175 interface_enum_map_t enum_map_EdgeMode;
176 interface_enum_map_t enum_map_Algorithm;
177 public:
178 /* messages */
179 class ClearMessage : public Message
180 {
181 private:
182 /** Internal data storage, do NOT modify! */
183 typedef struct {
184 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
185 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
186 } ClearMessage_data_t;
187
188 ClearMessage_data_t *data;
189
190 interface_enum_map_t enum_map_ConnectionMode;
191 interface_enum_map_t enum_map_FilterType;
192 interface_enum_map_t enum_map_EdgeMode;
193 interface_enum_map_t enum_map_Algorithm;
194 public:
195 ClearMessage();
197
198 explicit ClearMessage(const ClearMessage *m);
199 /* Methods */
200 virtual Message * clone() const;
201 };
202
204 {
205 private:
206 /** Internal data storage, do NOT modify! */
207 typedef struct {
208 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
209 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
210 int32_t algorithm; /**< Algorithm to use. */
211 } SetAlgorithmMessage_data_t;
212
213 SetAlgorithmMessage_data_t *data;
214
215 interface_enum_map_t enum_map_ConnectionMode;
216 interface_enum_map_t enum_map_FilterType;
217 interface_enum_map_t enum_map_EdgeMode;
218 interface_enum_map_t enum_map_Algorithm;
219 public:
220 SetAlgorithmMessage(const Algorithm ini_algorithm);
223
224 explicit SetAlgorithmMessage(const SetAlgorithmMessage *m);
225 /* Methods */
226 Algorithm algorithm() const;
227 void set_algorithm(const Algorithm new_algorithm);
228 size_t maxlenof_algorithm() const;
229 virtual Message * clone() const;
230 };
231
233 {
234 private:
235 /** Internal data storage, do NOT modify! */
236 typedef struct {
237 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
238 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
239 char param[32]; /**< Parameter name, see
240 Algorithm enum description for algorithm-specific
241 parameters. Unknown parameters will be ignored. */
242 char value[64]; /**< Value of parameter
243 encoded as string. The algorithm will perform the conversion to
244 the required data type (e.g., float). An error will make the
245 generation fail. */
246 } SetAlgorithmParameterMessage_data_t;
247
248 SetAlgorithmParameterMessage_data_t *data;
249
250 interface_enum_map_t enum_map_ConnectionMode;
251 interface_enum_map_t enum_map_FilterType;
252 interface_enum_map_t enum_map_EdgeMode;
253 interface_enum_map_t enum_map_Algorithm;
254 public:
255 SetAlgorithmParameterMessage(const char * ini_param, const char * ini_value);
258
260 /* Methods */
261 char * param() const;
262 void set_param(const char * new_param);
263 size_t maxlenof_param() const;
264 char * value() const;
265 void set_value(const char * new_value);
266 size_t maxlenof_value() const;
267 virtual Message * clone() const;
268 };
269
271 {
272 private:
273 /** Internal data storage, do NOT modify! */
274 typedef struct {
275 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
276 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
277 float p1_x; /**< X coordinate of bbox start point in global frame. */
278 float p1_y; /**< Y coordinate of bbox start point in global frame. */
279 float p2_x; /**< X coordinate of bbox end point in global frame. */
280 float p2_y; /**< Y coordinate of bbox end point in global frame. */
281 } SetBoundingBoxMessage_data_t;
282
283 SetBoundingBoxMessage_data_t *data;
284
285 interface_enum_map_t enum_map_ConnectionMode;
286 interface_enum_map_t enum_map_FilterType;
287 interface_enum_map_t enum_map_EdgeMode;
288 interface_enum_map_t enum_map_Algorithm;
289 public:
290 SetBoundingBoxMessage(const float ini_p1_x, const float ini_p1_y, const float ini_p2_x, const float ini_p2_y);
293
295 /* Methods */
296 float p1_x() const;
297 void set_p1_x(const float new_p1_x);
298 size_t maxlenof_p1_x() const;
299 float p1_y() const;
300 void set_p1_y(const float new_p1_y);
301 size_t maxlenof_p1_y() const;
302 float p2_x() const;
303 void set_p2_x(const float new_p2_x);
304 size_t maxlenof_p2_x() const;
305 float p2_y() const;
306 void set_p2_y(const float new_p2_y);
307 size_t maxlenof_p2_y() const;
308 virtual Message * clone() const;
309 };
310
312 {
313 private:
314 /** Internal data storage, do NOT modify! */
315 typedef struct {
316 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
317 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
318 int32_t filter; /**< Which filter to
319 enable/disable. */
320 bool enable; /**< True to enable, false to
321 disable */
322 } SetFilterMessage_data_t;
323
324 SetFilterMessage_data_t *data;
325
326 interface_enum_map_t enum_map_ConnectionMode;
327 interface_enum_map_t enum_map_FilterType;
328 interface_enum_map_t enum_map_EdgeMode;
329 interface_enum_map_t enum_map_Algorithm;
330 public:
331 SetFilterMessage(const FilterType ini_filter, const bool ini_enable);
334
335 explicit SetFilterMessage(const SetFilterMessage *m);
336 /* Methods */
337 FilterType filter() const;
338 void set_filter(const FilterType new_filter);
339 size_t maxlenof_filter() const;
340 bool is_enable() const;
341 void set_enable(const bool new_enable);
342 size_t maxlenof_enable() const;
343 virtual Message * clone() const;
344 };
345
347 {
348 private:
349 /** Internal data storage, do NOT modify! */
350 typedef struct {
351 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
352 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
353 int32_t filter; /**< Which filter to
354 enable/disable. */
355 char param[32]; /**< Parameter name, see FilterType
356 description for possible values. */
357 float value; /**< True to enable, false to
358 disable */
359 } SetFilterParamFloatMessage_data_t;
360
361 SetFilterParamFloatMessage_data_t *data;
362
363 interface_enum_map_t enum_map_ConnectionMode;
364 interface_enum_map_t enum_map_FilterType;
365 interface_enum_map_t enum_map_EdgeMode;
366 interface_enum_map_t enum_map_Algorithm;
367 public:
368 SetFilterParamFloatMessage(const FilterType ini_filter, const char * ini_param, const float ini_value);
371
373 /* Methods */
374 FilterType filter() const;
375 void set_filter(const FilterType new_filter);
376 size_t maxlenof_filter() const;
377 char * param() const;
378 void set_param(const char * new_param);
379 size_t maxlenof_param() const;
380 float value() const;
381 void set_value(const float new_value);
382 size_t maxlenof_value() const;
383 virtual Message * clone() const;
384 };
385
387 {
388 private:
389 /** Internal data storage, do NOT modify! */
390 typedef struct {
391 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
392 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
393 float max_line_point_distance; /**<
394 For points generated on lines found in the map, do not exceed
395 this threshold in terms of maximum distance of points on line.
396 */
397 } AddMapObstaclesMessage_data_t;
398
399 AddMapObstaclesMessage_data_t *data;
400
401 interface_enum_map_t enum_map_ConnectionMode;
402 interface_enum_map_t enum_map_FilterType;
403 interface_enum_map_t enum_map_EdgeMode;
404 interface_enum_map_t enum_map_Algorithm;
405 public:
406 AddMapObstaclesMessage(const float ini_max_line_point_distance);
409
411 /* Methods */
412 float max_line_point_distance() const;
413 void set_max_line_point_distance(const float new_max_line_point_distance);
415 virtual Message * clone() const;
416 };
417
419 {
420 private:
421 /** Internal data storage, do NOT modify! */
422 typedef struct {
423 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
424 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
425 char name[64]; /**<
426 ID of the obstacle. Can later be used to remove it again.
427 */
428 float x; /**< X coordinate of obstacle in global frame. */
429 float y; /**< Y coordinate of obstacle in global frame. */
430 } AddObstacleMessage_data_t;
431
432 AddObstacleMessage_data_t *data;
433
434 interface_enum_map_t enum_map_ConnectionMode;
435 interface_enum_map_t enum_map_FilterType;
436 interface_enum_map_t enum_map_EdgeMode;
437 interface_enum_map_t enum_map_Algorithm;
438 public:
439 AddObstacleMessage(const char * ini_name, const float ini_x, const float ini_y);
442
443 explicit AddObstacleMessage(const AddObstacleMessage *m);
444 /* Methods */
445 char * name() const;
446 void set_name(const char * new_name);
447 size_t maxlenof_name() const;
448 float x() const;
449 void set_x(const float new_x);
450 size_t maxlenof_x() const;
451 float y() const;
452 void set_y(const float new_y);
453 size_t maxlenof_y() const;
454 virtual Message * clone() const;
455 };
456
458 {
459 private:
460 /** Internal data storage, do NOT modify! */
461 typedef struct {
462 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
463 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
464 char name[64]; /**<
465 ID of the obstacle to remove.
466 */
467 } RemoveObstacleMessage_data_t;
468
469 RemoveObstacleMessage_data_t *data;
470
471 interface_enum_map_t enum_map_ConnectionMode;
472 interface_enum_map_t enum_map_FilterType;
473 interface_enum_map_t enum_map_EdgeMode;
474 interface_enum_map_t enum_map_Algorithm;
475 public:
476 RemoveObstacleMessage(const char * ini_name);
479
481 /* Methods */
482 char * name() const;
483 void set_name(const char * new_name);
484 size_t maxlenof_name() const;
485 virtual Message * clone() const;
486 };
487
489 {
490 private:
491 /** Internal data storage, do NOT modify! */
492 typedef struct {
493 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
494 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
495 char name[64]; /**<
496 ID of the obstacle. Can later be used to remove it again.
497 */
498 float x; /**< X coordinate of obstacle in global frame. */
499 float y; /**< Y coordinate of obstacle in global frame. */
500 int32_t mode; /**<
501 The connection mode to use to connect the POI with the graph.
502 */
503 } AddPointOfInterestMessage_data_t;
504
505 AddPointOfInterestMessage_data_t *data;
506
507 interface_enum_map_t enum_map_ConnectionMode;
508 interface_enum_map_t enum_map_FilterType;
509 interface_enum_map_t enum_map_EdgeMode;
510 interface_enum_map_t enum_map_Algorithm;
511 public:
512 AddPointOfInterestMessage(const char * ini_name, const float ini_x, const float ini_y, const ConnectionMode ini_mode);
515
517 /* Methods */
518 char * name() const;
519 void set_name(const char * new_name);
520 size_t maxlenof_name() const;
521 float x() const;
522 void set_x(const float new_x);
523 size_t maxlenof_x() const;
524 float y() const;
525 void set_y(const float new_y);
526 size_t maxlenof_y() const;
527 ConnectionMode mode() const;
528 void set_mode(const ConnectionMode new_mode);
529 size_t maxlenof_mode() const;
530 virtual Message * clone() const;
531 };
532
534 {
535 private:
536 /** Internal data storage, do NOT modify! */
537 typedef struct {
538 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
539 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
540 char name[64]; /**<
541 ID of the obstacle. Can later be used to remove it again.
542 */
543 float x; /**< X coordinate of obstacle in global frame. */
544 float y; /**< Y coordinate of obstacle in global frame. */
545 float ori; /**< Orientation for target point (rad). */
546 int32_t mode; /**<
547 The connection mode to use to connect the POI with the graph.
548 */
549 } AddPointOfInterestWithOriMessage_data_t;
550
551 AddPointOfInterestWithOriMessage_data_t *data;
552
553 interface_enum_map_t enum_map_ConnectionMode;
554 interface_enum_map_t enum_map_FilterType;
555 interface_enum_map_t enum_map_EdgeMode;
556 interface_enum_map_t enum_map_Algorithm;
557 public:
558 AddPointOfInterestWithOriMessage(const char * ini_name, const float ini_x, const float ini_y, const float ini_ori, const ConnectionMode ini_mode);
561
563 /* Methods */
564 char * name() const;
565 void set_name(const char * new_name);
566 size_t maxlenof_name() const;
567 float x() const;
568 void set_x(const float new_x);
569 size_t maxlenof_x() const;
570 float y() const;
571 void set_y(const float new_y);
572 size_t maxlenof_y() const;
573 float ori() const;
574 void set_ori(const float new_ori);
575 size_t maxlenof_ori() const;
576 ConnectionMode mode() const;
577 void set_mode(const ConnectionMode new_mode);
578 size_t maxlenof_mode() const;
579 virtual Message * clone() const;
580 };
581
583 {
584 private:
585 /** Internal data storage, do NOT modify! */
586 typedef struct {
587 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
588 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
589 char name[64]; /**<
590 ID of the point of interest.
591 */
592 char property_name[64]; /**< Name of the property to set. */
593 char property_value[1024]; /**< Value of the property
594 to set. */
595 } SetPointOfInterestPropertyMessage_data_t;
596
597 SetPointOfInterestPropertyMessage_data_t *data;
598
599 interface_enum_map_t enum_map_ConnectionMode;
600 interface_enum_map_t enum_map_FilterType;
601 interface_enum_map_t enum_map_EdgeMode;
602 interface_enum_map_t enum_map_Algorithm;
603 public:
604 SetPointOfInterestPropertyMessage(const char * ini_name, const char * ini_property_name, const char * ini_property_value);
607
609 /* Methods */
610 char * name() const;
611 void set_name(const char * new_name);
612 size_t maxlenof_name() const;
613 char * property_name() const;
614 void set_property_name(const char * new_property_name);
615 size_t maxlenof_property_name() const;
616 char * property_value() const;
617 void set_property_value(const char * new_property_value);
618 size_t maxlenof_property_value() const;
619 virtual Message * clone() const;
620 };
621
622 class AddEdgeMessage : public Message
623 {
624 private:
625 /** Internal data storage, do NOT modify! */
626 typedef struct {
627 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
628 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
629 char p1[64]; /**< ID of first node. */
630 char p2[64]; /**< ID of second node. */
631 bool directed; /**<
632 True to create a directed edge from p1 to p2, otherwise the edge
633 is assumed to be undirected.
634 */
635 int32_t mode; /**< The edge insertion mode. */
636 } AddEdgeMessage_data_t;
637
638 AddEdgeMessage_data_t *data;
639
640 interface_enum_map_t enum_map_ConnectionMode;
641 interface_enum_map_t enum_map_FilterType;
642 interface_enum_map_t enum_map_EdgeMode;
643 interface_enum_map_t enum_map_Algorithm;
644 public:
645 AddEdgeMessage(const char * ini_p1, const char * ini_p2, const bool ini_directed, const EdgeMode ini_mode);
648
649 explicit AddEdgeMessage(const AddEdgeMessage *m);
650 /* Methods */
651 char * p1() const;
652 void set_p1(const char * new_p1);
653 size_t maxlenof_p1() const;
654 char * p2() const;
655 void set_p2(const char * new_p2);
656 size_t maxlenof_p2() const;
657 bool is_directed() const;
658 void set_directed(const bool new_directed);
659 size_t maxlenof_directed() const;
660 EdgeMode mode() const;
661 void set_mode(const EdgeMode new_mode);
662 size_t maxlenof_mode() const;
663 virtual Message * clone() const;
664 };
665
667 {
668 private:
669 /** Internal data storage, do NOT modify! */
670 typedef struct {
671 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
672 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
673 char property_name[64]; /**< Name of the property to set. */
674 char property_value[1024]; /**< Value of the property
675 to set. */
676 } SetGraphDefaultPropertyMessage_data_t;
677
678 SetGraphDefaultPropertyMessage_data_t *data;
679
680 interface_enum_map_t enum_map_ConnectionMode;
681 interface_enum_map_t enum_map_FilterType;
682 interface_enum_map_t enum_map_EdgeMode;
683 interface_enum_map_t enum_map_Algorithm;
684 public:
685 SetGraphDefaultPropertyMessage(const char * ini_property_name, const char * ini_property_value);
688
690 /* Methods */
691 char * property_name() const;
692 void set_property_name(const char * new_property_name);
693 size_t maxlenof_property_name() const;
694 char * property_value() const;
695 void set_property_value(const char * new_property_value);
696 size_t maxlenof_property_value() const;
697 virtual Message * clone() const;
698 };
699
701 {
702 private:
703 /** Internal data storage, do NOT modify! */
704 typedef struct {
705 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
706 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
707 bool enable_copy; /**< True to enable copying
708 (default) false to disable). */
709 } SetCopyGraphDefaultPropertiesMessage_data_t;
710
711 SetCopyGraphDefaultPropertiesMessage_data_t *data;
712
713 interface_enum_map_t enum_map_ConnectionMode;
714 interface_enum_map_t enum_map_FilterType;
715 interface_enum_map_t enum_map_EdgeMode;
716 interface_enum_map_t enum_map_Algorithm;
717 public:
718 SetCopyGraphDefaultPropertiesMessage(const bool ini_enable_copy);
721
723 /* Methods */
724 bool is_enable_copy() const;
725 void set_enable_copy(const bool new_enable_copy);
726 size_t maxlenof_enable_copy() const;
727 virtual Message * clone() const;
728 };
729
731 {
732 private:
733 /** Internal data storage, do NOT modify! */
734 typedef struct {
735 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
736 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
737 char name[64]; /**<
738 ID of the obstacle to remove.
739 */
740 } RemovePointOfInterestMessage_data_t;
741
742 RemovePointOfInterestMessage_data_t *data;
743
744 interface_enum_map_t enum_map_ConnectionMode;
745 interface_enum_map_t enum_map_FilterType;
746 interface_enum_map_t enum_map_EdgeMode;
747 interface_enum_map_t enum_map_Algorithm;
748 public:
749 RemovePointOfInterestMessage(const char * ini_name);
752
754 /* Methods */
755 char * name() const;
756 void set_name(const char * new_name);
757 size_t maxlenof_name() const;
758 virtual Message * clone() const;
759 };
760
761 class ComputeMessage : public Message
762 {
763 private:
764 /** Internal data storage, do NOT modify! */
765 typedef struct {
766 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
767 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
768 } ComputeMessage_data_t;
769
770 ComputeMessage_data_t *data;
771
772 interface_enum_map_t enum_map_ConnectionMode;
773 interface_enum_map_t enum_map_FilterType;
774 interface_enum_map_t enum_map_EdgeMode;
775 interface_enum_map_t enum_map_Algorithm;
776 public:
779
780 explicit ComputeMessage(const ComputeMessage *m);
781 /* Methods */
782 virtual Message * clone() const;
783 };
784
785 virtual bool message_valid(const Message *message) const;
786 private:
789
790 public:
791 /* Methods */
792 uint32_t msgid() const;
793 void set_msgid(const uint32_t new_msgid);
794 size_t maxlenof_msgid() const;
795 bool is_final() const;
796 void set_final(const bool new_final);
797 size_t maxlenof_final() const;
798 bool is_ok() const;
799 void set_ok(const bool new_ok);
800 size_t maxlenof_ok() const;
801 char * error_message() const;
802 void set_error_message(const char * new_error_message);
803 size_t maxlenof_error_message() const;
804 virtual Message * create_message(const char *type) const;
805
806 virtual void copy_values(const Interface *other);
807 virtual const char * enum_tostring(const char *enumtype, int val) const;
808
809};
810
811} // end namespace fawkes
812
813#endif
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
const char * type() const
Get type of interface.
Definition: interface.cpp:652
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
AddEdgeMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_mode(const EdgeMode new_mode)
Set mode value.
size_t maxlenof_mode() const
Get maximum length of mode value.
size_t maxlenof_directed() const
Get maximum length of directed value.
void set_directed(const bool new_directed)
Set directed value.
size_t maxlenof_p1() const
Get maximum length of p1 value.
size_t maxlenof_p2() const
Get maximum length of p2 value.
AddMapObstaclesMessage Fawkes BlackBoard Interface Message.
void set_max_line_point_distance(const float new_max_line_point_distance)
Set max_line_point_distance value.
size_t maxlenof_max_line_point_distance() const
Get maximum length of max_line_point_distance value.
float max_line_point_distance() const
Get max_line_point_distance value.
AddObstacleMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_name() const
Get maximum length of name value.
AddPointOfInterestMessage Fawkes BlackBoard Interface Message.
void set_mode(const ConnectionMode new_mode)
Set mode value.
AddPointOfInterestWithOriMessage Fawkes BlackBoard Interface Message.
ClearMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
ComputeMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
RemoveObstacleMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_name() const
Get maximum length of name value.
RemovePointOfInterestMessage Fawkes BlackBoard Interface Message.
SetAlgorithmMessage Fawkes BlackBoard Interface Message.
void set_algorithm(const Algorithm new_algorithm)
Set algorithm value.
size_t maxlenof_algorithm() const
Get maximum length of algorithm value.
SetAlgorithmParameterMessage Fawkes BlackBoard Interface Message.
SetBoundingBoxMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_p1_y() const
Get maximum length of p1_y value.
size_t maxlenof_p2_y() const
Get maximum length of p2_y value.
size_t maxlenof_p1_x() const
Get maximum length of p1_x value.
size_t maxlenof_p2_x() const
Get maximum length of p2_x value.
SetCopyGraphDefaultPropertiesMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_enable_copy() const
Get maximum length of enable_copy value.
SetFilterMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_enable() const
Get maximum length of enable value.
void set_enable(const bool new_enable)
Set enable value.
void set_filter(const FilterType new_filter)
Set filter value.
size_t maxlenof_filter() const
Get maximum length of filter value.
SetFilterParamFloatMessage Fawkes BlackBoard Interface Message.
void set_filter(const FilterType new_filter)
Set filter value.
size_t maxlenof_filter() const
Get maximum length of filter value.
SetGraphDefaultPropertyMessage Fawkes BlackBoard Interface Message.
void set_property_value(const char *new_property_value)
Set property_value value.
void set_property_name(const char *new_property_name)
Set property_name value.
size_t maxlenof_property_name() const
Get maximum length of property_name value.
size_t maxlenof_property_value() const
Get maximum length of property_value value.
SetPointOfInterestPropertyMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_property_name() const
Get maximum length of property_name value.
void set_property_value(const char *new_property_value)
Set property_value value.
void set_property_name(const char *new_property_name)
Set property_name value.
size_t maxlenof_property_value() const
Get maximum length of property_value value.
NavGraphGeneratorInterface Fawkes BlackBoard Interface.
char * error_message() const
Get error_message value.
void set_ok(const bool new_ok)
Set ok value.
const char * tostring_EdgeMode(EdgeMode value) const
Convert EdgeMode constant to string.
ConnectionMode
Describe how to connect nodes to the graph.
@ CLOSEST_EDGE
Connect point to the edge in which segment it lies, i.e.
@ UNCONNECTED
The node is marked as unconnected and will not be connected to another node.
@ CLOSEST_EDGE_OR_NODE
First try the CLOSEST_EDGE method.
@ CLOSEST_NODE
Connect point to the node on the graph closest to the given point.
@ NOT_CONNECTED
The node is will not be initially connected.
size_t maxlenof_error_message() const
Get maximum length of error_message value.
uint32_t msgid() const
Get msgid value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
FilterType
Post-processing filtering type.
@ FILTER_MULTI_GRAPH
Sometimes after applying other filters one can end up with multiple disconnected graphs.
@ FILTER_EDGES_BY_MAP
If enabled, filters out all edges after the map generation that pass too close by an occupied cell of...
@ FILTER_ORPHAN_NODES
If enabled, filters out all nodes which are not connected to any other node.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
void set_error_message(const char *new_error_message)
Set error_message value.
const char * tostring_FilterType(FilterType value) const
Convert FilterType constant to string.
size_t maxlenof_ok() const
Get maximum length of ok value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_final() const
Get maximum length of final value.
const char * tostring_ConnectionMode(ConnectionMode value) const
Convert ConnectionMode constant to string.
virtual Message * create_message(const char *type) const
Create message based on type name.
const char * tostring_Algorithm(Algorithm value) const
Convert Algorithm constant to string.
Algorithm
Available generator algorithms.
@ ALGORITHM_VORONOI
Voronoi-based algorithm for navgraph generation.
@ ALGORITHM_GRID
Grid-based algorithm with customizable spacing.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
EdgeMode
When adding edges, the mode defines how to add edges.
@ NO_INTERSECTION
Only insert edge if it does not intersect with any other existing edge in the graph.
@ SPLIT_INTERSECTION
If the new edge intersects with one or more edges, add new points at the intersections and split the ...
@ FORCE
The edge is added as-is, it may overlap or intersect with other edges.
void set_final(const bool new_final)
Set final value.
Fawkes library namespace.
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
Definition: types.h:54