summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/common-cc/path.cc
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.cc
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.cc')
-rw-r--r--digital/io-hub/src/common-cc/path.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/digital/io-hub/src/common-cc/path.cc b/digital/io-hub/src/common-cc/path.cc
index 151eedd0..411ce9de 100644
--- a/digital/io-hub/src/common-cc/path.cc
+++ b/digital/io-hub/src/common-cc/path.cc
@@ -56,12 +56,6 @@ extern "C" {
#define PATH_IN_CIRCLE(pOINT, cENTER, rADIUS) \
(distance_point_point((pOINT), (cENTER)) <= (rADIUS))
-/** Static nodes index for the endpoints */
-enum {
- PATH_NAVPOINT_SRC_IDX = 0,
- PATH_NAVPOINT_DST_IDX
-};
-
static int32_t pos_dot_product(vect_t* pa, vect_t* pb, vect_t* pc, vect_t* pd)
{
vect_t vab = *pb; vect_sub(&vab, pa);
@@ -287,7 +281,7 @@ void Path::compute(weight_t escape)
if (path_found)
{
/* Store next node to go to */
- next_node = astar_nodes[0].prev;
+ next_node = astar_nodes[PATH_NAVPOINT_SRC_IDX].prev;
#ifdef PATH_DEBUG
/* Log and display the path found */