Skip to content

Commit

Permalink
assign test_goal_pose directly
Browse files Browse the repository at this point in the history
  • Loading branch information
renan028 committed Aug 30, 2023
1 parent b8535f5 commit c44b78e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mbf_costmap_nav/src/mbf_costmap_nav/free_pose_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,9 @@ SearchSolution FreePoseSearch::search() const
goal_cell.cost = costmap2d->getCost(goal_cell.x, goal_cell.y);
costmap2d->mapToWorld(goal_cell.x, goal_cell.y, goal_cell_pose.x, goal_cell_pose.y);

bool test_goal_pose{ true };
unsigned int dummy_x, dummy_y;
if (!costmap2d->worldToMap(config_.goal.x, config_.goal.y, dummy_x, dummy_y))
{
// if goal not in bounds, we don't start the search from the goal pose
test_goal_pose = false;
}
// don't start the search from the goal pose if goal is not within bounds
bool test_goal_pose = costmap2d->worldToMap(config_.goal.x, config_.goal.y, dummy_x, dummy_y);

// add goal cell to queue if it is within linear tolerance
if (std::hypot(goal_cell_pose.x - config_.goal.x, goal_cell_pose.y - config_.goal.y) <= config_.linear_tolerance)
Expand Down

0 comments on commit c44b78e

Please sign in to comment.