Skip to content
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

Merged
merged 2 commits into from
Jan 24, 2019

Conversation

DLu
Copy link
Member

@DLu DLu commented Dec 6, 2018

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)

@DLu DLu requested a review from aaronhoy January 11, 2019 21:23

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;
Copy link
Contributor

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)

??

Copy link
Member Author

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.

Copy link
Contributor

@aaronhoy aaronhoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@DLu
Copy link
Member Author

DLu commented Jan 15, 2019

Build failure seems unrelated, but I can't figure out what is causing it. Any guesses @mikeferguson ?

@DLu DLu closed this Jan 21, 2019
@DLu DLu reopened this Jan 21, 2019
@DLu DLu merged commit a520c24 into ros-planning:kinetic-devel Jan 24, 2019
@DLu DLu deleted the fix817 branch January 24, 2019 17:00
DLu added a commit that referenced this pull request Jan 24, 2019
* Fix for adjusting plan resolution

* Simpler math expression
DLu added a commit that referenced this pull request Jan 24, 2019
* Fix for adjusting plan resolution

* Simpler math expression
DLu added a commit that referenced this pull request Jan 24, 2019
* Fix for adjusting plan resolution

* Simpler math expression
@DLu DLu mentioned this pull request Jan 24, 2019
@mikeferguson
Copy link
Contributor

Should this also go into lunar/melodic ?

@DLu
Copy link
Member Author

DLu commented Jan 24, 2019

Also done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants