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

Pilz multi-group incompatibility #1856

Merged

Conversation

MarcoMagriDev
Copy link
Contributor

Description

The current pilz implementation does not support a robot with multiple groups. In particular the problem is that in internal FK and IK functions, the whole state of the robot is set to default values. By doing so, the state of the other groups (that are not the one that is currently moved) does not match the current state of the robot (if those groups are not in default value).

The proposed solution consists in using the current robot state provided by the planning scene.

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Patch coverage: 90.00% and project coverage change: -0.02 ⚠️

Comparison is base (b98bb6b) 50.53% compared to head (328e1e9) 50.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1856      +/-   ##
==========================================
- Coverage   50.53%   50.51%   -0.02%     
==========================================
  Files         386      386              
  Lines       31736    31730       -6     
==========================================
- Hits        16034    16024      -10     
- Misses      15702    15706       +4     
Impacted Files Coverage Δ
moveit_ros/moveit_servo/src/servo_calcs.cpp 71.14% <0.00%> (ø)
...strial_motion_planner/src/trajectory_functions.cpp 100.00% <100.00%> (ø)
...l_motion_planner/src/trajectory_generator_circ.cpp 99.09% <100.00%> (-0.01%) ⬇️
...al_motion_planner/src/trajectory_generator_lin.cpp 94.45% <100.00%> (-0.15%) ⬇️
...anning_scene_monitor/src/current_state_monitor.cpp 74.32% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

Ok, this is clearly broken. Thank you!

moveit::core::RobotState rstate(robot_model);
// By setting the robot state to default values, we basically allow
// the user of this function to supply an incomplete or even empty seed.
rstate.setToDefaultValues();
Copy link
Member

Choose a reason for hiding this comment

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

As stated here, we would drop support for incomplete states by removing this line. This is not necessarily a blocker, though. But I agree that it would be unsafe to assume that default values are given as long as the other groups are not initialized. If the user wants to ignore other groups, this should be done by providing a fixed ACM. We should check that this info is not lost or that it won't conflict with the tutorials.

Copy link
Member

Choose a reason for hiding this comment

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

It's also problematic that we can't check for a complete state here since there is no access to the PSM. Maybe we should enforce this more on the runtime interface side: MoveItCpp/MoveGroup could run "CurrentStateMonitor::waitForCompleteState()" by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As stated here, we would drop support for incomplete states by removing this line. This is not necessarily a blocker, though. But I agree that it would be unsafe to assume that default values are given as long as the other groups are not initialized. If the user wants to ignore other groups, this should be done by providing a fixed ACM. We should check that this info is not lost or that it won't conflict with the tutorials.

I think that we are still supporting incomplete and even empty seed with the only difference that joint values not specified are set from the current robot state instead of the default one.

It's also problematic that we can't check for a complete state here since there is no access to the PSM. Maybe we should enforce this more on the runtime interface side: MoveItCpp/MoveGroup could run "CurrentStateMonitor::waitForCompleteState()" by default.

Totally agree with you on this point.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we open follow-up issues for this?

Copy link
Member

Choose a reason for hiding this comment

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

yes, please do

@github-actions
Copy link

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions bot added the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Mar 27, 2023
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.

Tested the PR with the PILZ tutorial & it works 👍

@sjahr sjahr requested a review from henningkayser June 13, 2023 08:47
@henningkayser henningkayser merged commit 5bbe21b into moveit:main Jun 13, 2023
8 checks passed
@sjahr sjahr added backport-humble Mergify label that triggers a PR backport to Humble and removed backport-humble Mergify label that triggers a PR backport to Humble labels Aug 16, 2023
mergify bot pushed a commit that referenced this pull request Aug 16, 2023
henningkayser pushed a commit that referenced this pull request Aug 22, 2023
(cherry picked from commit 5bbe21b)

Co-authored-by: Marco Magri <94347649+MarcoMagriDev@users.noreply.github.com>
Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Inactive issues and PRs are marked as stale and may be closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants