We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2225c7 commit bdb53bdCopy full SHA for bdb53bd
nav2_navfn_planner/src/navfn_planner.cpp
@@ -293,11 +293,13 @@ NavfnPlanner::makePlan(
293
p.position.x = goal.position.x - tolerance;
294
while (p.position.x <= goal.position.x + tolerance) {
295
potential = getPointPotential(p.position);
296
- double sdist = squared_distance(p, goal);
297
- if (potential < POT_HIGH && sdist < best_sdist) {
298
- best_sdist = sdist;
299
- best_pose = p;
300
- found_legal = true;
+ if (potential < POT_HIGH) {
+ double sdist = squared_distance(p, goal);
+ if (sdist < best_sdist) {
+ best_sdist = sdist;
+ best_pose = p;
301
+ found_legal = true;
302
+ }
303
}
304
p.position.x += resolution;
305
0 commit comments