Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nav2_smac_planner/src/node_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ float Node2D::getHeuristicCost(
{
// Using Moore distance as it more accurately represents the distances
// even a Van Neumann neighborhood robot can navigate.
return hypotf(goal_coordinates.x - node_coords.x, goal_coordinates.y - node_coords.y);
auto dx = goal_coordinates.x - node_coords.x;
auto dy = goal_coordinates.y - node_coords.y;
return std::sqrt(dx * dx + dy * dy);
}

void Node2D::initMotionModel(
Expand Down
6 changes: 3 additions & 3 deletions nav2_smac_planner/src/node_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ inline float distanceHeuristic2D(
const unsigned int idx, const unsigned int size_x,
const unsigned int target_x, const unsigned int target_y)
{
return std::hypotf(
static_cast<int>(idx % size_x) - static_cast<int>(target_x),
static_cast<int>(idx / size_x) - static_cast<int>(target_y));
int dx = static_cast<int>(idx % size_x) - static_cast<int>(target_x);
int dy = static_cast<int>(idx / size_x) - static_cast<int>(target_y);
return std::sqrt(dx * dx + dy * dy);
}

void NodeHybrid::resetObstacleHeuristic(
Expand Down
2 changes: 2 additions & 0 deletions tools/planner_benchmarking/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def getPlannerResults(navigator, initial_pose, goal_pose, planners):
path = navigator._getPathImpl(initial_pose, goal_pose, planner, use_start=True)
if path is not None:
results.append(path)
else:
return results
return results


Expand Down