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

chomp: fix potential calculation #1651

Merged
merged 3 commits into from
Aug 31, 2019
Merged

Conversation

rhaschke
Copy link
Contributor

Fix #1650. The potential is a piecewise function as follows:

image

To have a smooth transition at zero, we need

double gradient_magnitude = diff / clearance;

as was stated in the comment.

@rhaschke rhaschke requested a review from bmagyar as a code owner August 30, 2019 06:55
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, I am surprised the GSoC project didn't encounter it

Also big thanks for converting this function to an early return style, one step closer to a cleaner moveit codebase!

double gradient_magnitude = diff * clearence; // (diff / clearance)
potential = 0.5 * gradient_magnitude * diff;
double gradient_magnitude = diff / clearence;
return 0.5 * gradient_magnitude * diff; // 0.5 * (d - clearance)^2 / clearance
Copy link
Member

Choose a reason for hiding this comment

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

It may be worth referencing the formula here, I don't remember by heart if the CHOMP papers have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which formula do you want to reference? I already added the formula as a comment.

Copy link
Member

Choose a reason for hiding this comment

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

I saw the comment. I meant if there's a good reference an interested reader could go to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. Ok. No idea, where to find such a reference.
I just verified the formula using my mathematical common sense 😉

@rhaschke rhaschke merged commit 8fcff1d into moveit:master Aug 31, 2019
@rhaschke rhaschke deleted the fix-chomp-gradient branch August 31, 2019 18:38
henningkayser pushed a commit to PickNikRobotics/moveit that referenced this pull request Nov 21, 2019
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.

This line should be diff / clearance as comment suggested?
2 participants