summaryrefslogtreecommitdiff
path: root/digital/io-hub/src/guybrush/path.c
diff options
context:
space:
mode:
authorNicolas Schodet2012-05-12 02:02:03 +0200
committerNicolas Schodet2012-05-12 11:15:57 +0200
commit382b99e11c033f1952cbe2b9e082cd35812a13e3 (patch)
tree008571474836ee5913085089a0835911239c13cb /digital/io-hub/src/guybrush/path.c
parentfb73dbae0dc7d6b9f117c74bb8de2a073ab4253b (diff)
digital/ui-hub: add debug draw module to debug path finding
Diffstat (limited to 'digital/io-hub/src/guybrush/path.c')
-rw-r--r--digital/io-hub/src/guybrush/path.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/digital/io-hub/src/guybrush/path.c b/digital/io-hub/src/guybrush/path.c
index 5696a2f8..47427a93 100644
--- a/digital/io-hub/src/guybrush/path.c
+++ b/digital/io-hub/src/guybrush/path.c
@@ -39,6 +39,12 @@
#include "debug.host.h"
#endif
+#define PATH_DEBUG_DRAW 0
+
+#if PATH_DEBUG_DRAW
+#include "debug_draw.host.h"
+#endif
+
/**
* This year, due to the large number of obstacles, a grid like structure is
* used for path finding on the playground. The A* algorithm is used to find
@@ -425,6 +431,23 @@ path_update (void)
PATH_OBSTACLES_NB);
}
#endif
+#if PATH_DEBUG_DRAW
+ uint8_t i;
+ debug_draw_start ();
+ for (i = 0; i < UTILS_COUNT (path_blocking_point); i++)
+ debug_draw_circle (&path_blocking_point[i].pos,
+ path_blocking_point[i].radius, 0);
+ for (i = 0; i < UTILS_COUNT (path_blocking_segment); i++)
+ debug_draw_segment (&path_blocking_segment[i][0],
+ &path_blocking_segment[i][1], 0);
+ for (i = 0; i < PATH_NODES_NB; i++)
+ {
+ vect_t pos;
+ path_pos (i, &pos);
+ debug_draw_point (&pos, 1);
+ }
+ debug_draw_send ();
+#endif
}
uint8_t