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

New implementation for computeCartesianPath() #2916

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

rhaschke
Copy link
Contributor

This is a port of moveit/moveit#3618

The Cartesian interpolator uses a JumpThreshold parameter to detect and reject a switch between IK solution branches leading to larger joint-space jumps. However, this approach is rather fragile: It is difficult to find a suitable threshold parameter and the approach requires a long-enough trajectory to work (at least 10 waypoints).
Particularly if the last requirement is not met, joint-space jumps can still occur unnoticed leading to a dangerous execution of an unchecked, large-volume trajectory.

This PR proposes a fundamentally different way to check for joint-space jumps, which works robustly and locally for any two adjacent waypoints: If the two waypoints are distant in joint-space, their half-way interpolation state will typically lead to a very strong deviation from the straight-line Cartesian path between them. This PR measures this deviation and rejects a trajectory if it exceeds a "precision" threshold.
Actually, the approach (recursively) introduces more waypoints in between to improve the precision of the linear Cartesian path. Thus, the method doesn't need to be provided with a good estimate of the MaxEEFStep parameter, it adjusts the step size dynamically to meet the given precision requirement. (This statement only holds if IK succeeds at all. In order to evaluate IK on a fine-grained grid and detect obstacles, one still needs the MaxEEFStep parameter.)

The following plots illustrate the new behavior. They all use the extremely coarse MaxEEFStep > 1m, resulting in a single initial step and then adjust the precision to introduce additional waypoints:

1 step, 0.3m precision 1 step, collision not detected!
1 step collision
1 + 1 steps, 0.1m precision 1 + 3 steps, 0.025m precision
2 steps 4 steps

I kept but deprecated the old JumpThreshold-based methods. I'm not sure how to best migrate the MoveGroup interface. To expose the new interface, we would need to introduce the CartesianPrecision argument as a message.
For now, I just dropped the JumpThreshold argument and resort to the default precision, which is 1mm. Given a reasonable MaxEEFStep, this should perfectly resolve the jump issues. I think, fiddling with the new parameter shouldn't be necessary in most cases.

@rhaschke rhaschke force-pushed the computeCartesianPath branch from 2dd55fb to ffc38fb Compare July 17, 2024 10:12
@sjahr sjahr self-requested a review August 2, 2024 14:47
Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

Interesting! I like this promise of being able to run less IK solves with these (adjustable) checks. Only some minor comments.

Copy link
Contributor

@sjahr sjahr left a comment

Choose a reason for hiding this comment

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

Cool, looks good thank you!

@sjahr sjahr merged commit dae6126 into moveit:main Aug 13, 2024
9 of 11 checks passed
@rhaschke rhaschke deleted the computeCartesianPath branch August 13, 2024 09:50
@DaniGarciaLopez
Copy link
Contributor

Thanks for the contribution @rhaschke! Any plans to backport this to humble?

@rhaschke
Copy link
Contributor Author

No. This PR involves a big API change.

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.

4 participants