From ab1177ae7a563fa99db2f2c863ea3d8b5238ff12 Mon Sep 17 00:00:00 2001 From: Stephen Jackson Date: Mon, 8 Apr 2024 15:55:15 -0400 Subject: [PATCH] fix: bug with distance's unit --- src/route_planner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/route_planner.cpp b/src/route_planner.cpp index ac953385..445a02e1 100644 --- a/src/route_planner.cpp +++ b/src/route_planner.cpp @@ -89,7 +89,7 @@ void constructPath(std::vector &path, RouteModel::Node *curren } // Tips: -// - This method should take the current (final) node as an argument and iteratively follow the +// - This method should take the current (final) node as an argument and iteratively follow the // chain of parents of nodes until the starting node is found. // - For each node in the chain, add the distance from the node to its parent to the distance variable. // - The returned vector should be in the correct order: the start node should be the first element @@ -101,6 +101,8 @@ std::vector RoutePlanner::ConstructFinalPath(RouteModel::Node std::vector path_found{}; constructPath(path_found, current_node, distance); + + distance *= m_Model.MetricScale(); // Multiply the distance by the scale of the map to get meters. return path_found; }