-
Notifications
You must be signed in to change notification settings - Fork 540
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
Fix logic in CheckStartStateBounds adapter #3143
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3143 +/- ##
==========================================
- Coverage 46.00% 45.57% -0.43%
==========================================
Files 483 482 -1
Lines 40632 40431 -201
==========================================
- Hits 18689 18421 -268
- Misses 21943 22010 +67 ☔ View full report in Codecov by Sentry. |
@sjahr I also want to check whether it's intentional that we're not checking the bounds for planar/floating joints at all? Is this because URDF also doesn't specify limits for this joint type? |
moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_bounds.cpp
Outdated
Show resolved
Hide resolved
Posted this in the issue ticket - but: The original logic was:
I think we actually just need to pull the "default" case outside the switch statement and do it for all joints? This is the original code - before being replaced: https://github.com/moveit/moveit2/blob/e064a8497a72b7e417f911fa2b4cb87d7c809a59/moveit_ros/planning/planning_request_adapter_plugins/src/fix_start_state_bounds.cpp |
The fact that this is broken, also makes me think we should really have a test for this... since it seems pretty important to not violate the joint limits in a motion planning software... |
I also didn't look at this... and there are no tests for any of the adapters? Oof. Yeah, I'd like to add one. |
Looking at the original adapter - that code is basically unchanged since 2013 other than formatting and then porting to ROS 2... guess it didn't need any tests back then! |
Hah, yeah. It shouldn't be that bad to create a planning scene from e.g. a PR2 or Panda and add some quick tests for the "revolute joint out of bounds" case. It's more the other paths like continuous joints that will likely require making more robot models. Though PR2 I assume has a planar joint available... I'm internally debating how much to bite off here... |
PR2 has continuous joints in the forearm/wrist roll and it looks like the SRDF in moveit_resources has a planar "world_joint" |
I added some tests and the logic is... more broken than we thought. @sjahr @mikeferguson do you guys mind lending me a hand w.r.t. what the expected behavior should be? Right now:
It appears that |
moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_bounds.cpp
Show resolved
Hide resolved
So, my understanding (taking into account the notes in 2849) is that, the following should happen:
So then, the logic really is:
to catch the case that we need to fix the start state for PLANAR, FLOATING or continuous REVOLUTE.
|
That's about in line with what I was thinking. Meaning the doc in the parameters YAML also needs to be fixed. Will wait til Sebastian confirms this behavior and will clean up / fill out the test suite as well. Thanks! |
moveit_ros/planning/planning_request_adapter_plugins/test/test_check_start_state_bounds.cpp
Show resolved
Hide resolved
moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_bounds.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this (and sorry for breaking it 🙈). My comment's aren't blocking the merge. I think this looks good!
moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_bounds.cpp
Show resolved
Hide resolved
moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_bounds.cpp
Show resolved
Hide resolved
Uhh... why is a bunch of new stuff failing suddenly? Will we ever get some peace in this repo? Lol Weirdly enough, the checks pass here, just not in the merge queue. |
I deleted some GHA caches and the merqe queue jobs seem to be working now. 🤷🏻 |
* Fix logic in CheckStartStateBoundsAdapter * Explicit fallthrough * Fix switch statement and add basic test scaffolding * Remove extra variable * Fix logic and add tests for continuous joints * Validate changed start state * Appeasing our Lord and Savior clang-tidy * Update status message (cherry picked from commit f82cdcd)
Description
This PR aims to fix the logic in the
CheckStartStateBounds
adapter, as @chama1176 pointed out.It also adds some basic unit tests to prevent further breakages and maintain expected behavior.
Closes #2924
Checklist