Skip to content

Commit

Permalink
fix: bug with distance's unit
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejaxon committed Apr 8, 2024
1 parent f618e91 commit ab1177a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/route_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void constructPath(std::vector<RouteModel::Node> &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
Expand All @@ -101,6 +101,8 @@ std::vector<RouteModel::Node> RoutePlanner::ConstructFinalPath(RouteModel::Node
std::vector<RouteModel::Node> 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;
}

Expand Down

0 comments on commit ab1177a

Please sign in to comment.