Skip to content

PoseModelStateSpace: Reintroduce Cartesian interpolation#3655

Merged
rhaschke merged 4 commits intomoveit:masterfrom
ubi-agni:fix-pose-model-state-space
Oct 31, 2024
Merged

PoseModelStateSpace: Reintroduce Cartesian interpolation#3655
rhaschke merged 4 commits intomoveit:masterfrom
ubi-agni:fix-pose-model-state-space

Conversation

@rhaschke
Copy link
Copy Markdown
Contributor

@rhaschke rhaschke commented Oct 14, 2024

I noticed that #3615 resulted in planning timeouts for code that previously worked. I had to drastically increase the timeout or relax the path constraints to make it work again.
Obviously, using joint-space interpolation much more often results in rejection of tight path constraints than Cartesian interpolation did.
Reintroducing Cartesian interpolation, it turns out that this wasn't really the culprit. Only measuring distances in Cartesian space was.

@rhaschke rhaschke requested a review from mamoll as a code owner October 14, 2024 12:47
@rhaschke
Copy link
Copy Markdown
Contributor Author

@LeroyR: Can you please test this for your grasping pipeline?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 14, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 47.23%. Comparing base (c174715) to head (17353f2).
Report is 44 commits behind head on master.

Files with missing lines Patch % Lines
...meterization/work_space/pose_model_state_space.cpp 83.34% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3655      +/-   ##
==========================================
+ Coverage   47.15%   47.23%   +0.09%     
==========================================
  Files         603      604       +1     
  Lines       58999    59291     +292     
  Branches     6969     7039      +70     
==========================================
+ Hits        27814    28001     +187     
- Misses      30773    30872      +99     
- Partials      412      418       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rhaschke rhaschke force-pushed the fix-pose-model-state-space branch from 996088c to 17353f2 Compare October 15, 2024 16:52
@rhaschke
Copy link
Copy Markdown
Contributor Author

Having dropped "jump testing", I observed jumps in trajectory again. So, I reintroduced it. The problem with Cartesian interpolation in principle remains, which is a dilemma of the current design:

  • We do need Cartesian interpolation to reduce the risk of state rejection due to a failing path constraint, which currently cannot be checked during interpolation.
  • Ideally, we would do joint interpolation and only resort to Cartesian interpolation if the path constraint is violated, i.e. follow a similar approach as in New implementation for computeCartesianPath() #3618. However, this would require access to the path constraint...

I tried seeding IK from the from state or from a state retrieved via joint-space interpolation between from and to.
Additionally, I switched jump-testing on or off:

IK seed no jump testing jump testing
start ik-from-start ik-from-start-jump
middle ik-from-middle ik-from-middle-jump

Most Cartesian interpolation approaches yield jumps. Seeding from start state even results in invalid trajectories - having collisions. (Why the hell?) The most smooth approach results from middle seeding + jump testing. However, I'm afraid we cannot fully reject jumps.

@dholzmann
Copy link
Copy Markdown

@LeroyR: Can you please test this for your grasping pipeline?

I tested it for @LeroyR. Since our robot is used in a study, I tried it out in a simulation. With this pull request the planning is stuck and seems to be calculating indefinitely (I stopped after waiting ~15 minutes). The searchPositionIK in the kinematic solver is being called repeatedly as can be seen in the moveit_kinematics debug logs. This does not always happen but still very often. This is already the case with the first commit in the PR.

@rhaschke
Copy link
Copy Markdown
Contributor Author

In principle, this PR should use Cartesian interpolation like before #3615.
Did you have issues with Cartesian interpolation there already? Did you change parameters since then?

This is already the case with the first commit in the PR.

Did you test the final commit too?

@rhaschke
Copy link
Copy Markdown
Contributor Author

Maybe we should make the interpolation mode configurable via a ROS parameter?

@dholzmann
Copy link
Copy Markdown

In principle, this PR should use Cartesian interpolation like before #3615. Did you have issues with Cartesian interpolation there already? Did you change parameters since then?

We didn't had this issues before and we changed no parameters.

Did you test the final commit too?

Yes, and the problem remains.

@rhaschke
Copy link
Copy Markdown
Contributor Author

Please try then the last commit before #3615. I think you have misconfigured your IK solver somehow.

@dholzmann
Copy link
Copy Markdown

Please try then the last commit before #3615. I think you have misconfigured your IK solver somehow.

Just tried it, seems to work fine with the same configuration.

Using other configurations for the IK solver as well as the default one does not solve the issue.

@rhaschke
Copy link
Copy Markdown
Contributor Author

This is weird. Could you give f126e35 a final try? This uses the same old Cartesian interpolation but disables jump checking, which might reject too many states. Seeing calls to searchPositionIK means that getPositionIK already failed:

if (!kinematics_solver_->getPositionIK(pose, seed_values, solution, err_code))
{
if (err_code.val != moveit_msgs::MoveItErrorCodes::TIMED_OUT ||
!kinematics_solver_->searchPositionIK(pose, seed_values, kinematics_solver_->getDefaultTimeout() * 2.0,

@dholzmann
Copy link
Copy Markdown

This is weird. Could you give f126e35 a final try?

Unfortunately, the issue remains.

@rhaschke
Copy link
Copy Markdown
Contributor Author

I'm going to merge this. In the current state PoseModelStateSpace and ModelBasedStateSpace are identical (both using joint-space interpolation and distance measure), which doesn't make sense. One can easily enforce joint-space behavior via the ROS parameter enforce_joint_model_state_space.

@rhaschke rhaschke merged commit 4b01062 into moveit:master Oct 31, 2024
@rhaschke rhaschke deleted the fix-pose-model-state-space branch October 31, 2024 11:08
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