-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kinetic] Fix for adjusting plan resolution #819
Conversation
base_local_planner/src/map_grid.cpp
Outdated
|
||
for (unsigned int i = 1; i < global_plan_in.size(); ++i) { | ||
double loop_x = global_plan_in[i].pose.position.x; | ||
double loop_y = global_plan_in[i].pose.position.y; | ||
double sqdist = (loop_x - last_x) * (loop_x - last_x) + (loop_y - last_y) * (loop_y - last_y); | ||
if (sqdist > min_sq_resolution) { | ||
int steps = ((sqrt(sqdist) - sqrt(min_sq_resolution)) / resolution) - 1; | ||
int steps = ceil((sqrt(sqdist) - sqrt(min_sq_resolution)) / resolution) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This took me a bit to parse. Since sqrt(min_sq_resolution) == resolution, can't this expression be reduced to just:
ceil(sqrt(sqdist) / resolution)
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're totally right. Good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Build failure seems unrelated, but I can't figure out what is causing it. Any guesses @mikeferguson ? |
* Fix for adjusting plan resolution * Simpler math expression
* Fix for adjusting plan resolution * Simpler math expression
* Fix for adjusting plan resolution * Simpler math expression
Should this also go into lunar/melodic ? |
Also done. |
Possible fix for #817
This does change the behavior such that one of the existing tests no longer works. However, I disagree with the results of that test, and it had some suspect parts anyway (i.e. checking the same x coordinate twice each, as opposed to x and y)