summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/common-cc/path.hh
diff options
context:
space:
mode:
authorOlivier Lanneluc2013-05-03 15:51:05 +0200
committerNicolas Schodet2013-05-03 23:07:14 +0200
commitdf802194e956f0fd399c1a20352678d597fb278d (patch)
treeb018c398b0b5166b6a5524048fdeb17ef752d21e /digital/io-hub/src/common-cc/path.hh
parent2ff81f7f1a0088a7c6a13ca3b042a7fdaf0e5511 (diff)
digital/io-hub/src/common-cc/path.cc: clean up the endpoints index enum
1. move enum about endpoints index 2. add nb of endpoints constant in the enum 3. use the enum constant instead of hard-coded index 4. change next_node type to match astar structure
Diffstat (limited to 'digital/io-hub/src/common-cc/path.hh')
-rw-r--r--digital/io-hub/src/common-cc/path.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/digital/io-hub/src/common-cc/path.hh b/digital/io-hub/src/common-cc/path.hh
index 1232cda1..28b5a8d8 100644
--- a/digital/io-hub/src/common-cc/path.hh
+++ b/digital/io-hub/src/common-cc/path.hh
@@ -31,6 +31,13 @@ extern "C" {
#include "modules/path/astar/astar.h"
}
+/** Static nodes index for the endpoints */
+enum {
+ PATH_NAVPOINT_SRC_IDX = 0,
+ PATH_NAVPOINT_DST_IDX,
+ PATH_RESERVED_NAVPOINTS_NB
+};
+
/** Obstacle */
typedef struct path_obstacle_t
{
@@ -87,8 +94,6 @@ class Path
/** Number of points for the cake */
static const int PATH_CAKE_NAVPOINTS_NB = 14;
#endif
- /** Number of reserved points for the 2 endpoints */
- static const int PATH_RESERVED_NAVPOINTS_NB = 2;
/** Number of navigation points layers for the cake. */
static const int PATH_CAKE_NAVPOINTS_LAYERS = 1;
/** Number of navigation points layers for each obstacle. */
@@ -121,7 +126,7 @@ class Path
/** List of nodes used for A*. */
struct astar_node_t astar_nodes[PATH_NAVPOINTS_NB];
/** Which node to look at for next step. */
- int next_node;
+ uint8_t next_node;
/** TRUE when a path has been found */
bool path_found;
};