-
Notifications
You must be signed in to change notification settings - Fork 158
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
Propagate errors from planners. #525
Propagate errors from planners. #525
Conversation
95917d0
to
823899f
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## ros2 #525 +/- ##
==========================================
+ Coverage 42.40% 42.47% +0.08%
==========================================
Files 83 83
Lines 8049 8080 +31
==========================================
+ Hits 3412 3431 +19
- Misses 4637 4649 +12 ☔ View full report in Codecov by Sentry. |
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.
Thank you! This change will help a lot with debug-ability!
While reading the code I was wondering if it make sense to keep the boolean return type if we always return true or unexpected? Maybe I am missing something but what about changing this to either:
return tl::expected<void, std::string> or return MoveItErrorCode?
core/include/moveit/task_constructor/solvers/pipeline_planner.h
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.
You'll need to apply some small cleanups but otherwise this is good to go in my opinion 👍
Thanks a lot @Abishalini for this feature! Is there any chance it can be backported to humble? |
@DaniGarciaLopez If you are building from source, the main branch of MoveIt2 and ros2 branch of MTC are compatible with humble. If not, feel free to cherry-pick these changes and make a PR to the humble branch. |
I actually compiled MoveIt and MTC from source, but encountered numerous errors related to MoveItErrorCodes because I didn't realize I was using moveit_msgs from humble binaries. After compiling moveit_msgs from the ros2 branch, MoveIt from the main, and MTC from ros2, it is now working fine. Thanks! |
Sometimes, it is hard to follow why a planner failed for stages
Connect
,MoveTo
, andMoveRelative
.Here is an effort to propagate the error messages from the planners. I have incorporated the use of
tl::expected
so that the plan function can now return a bool success or an error string. The stages which use planners have been modified to add the error string to the solutions.Example -
![image](https://private-user-images.githubusercontent.com/17363793/297900624-864ae613-d2dc-46aa-b12e-5284bf1b50d1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODc0NDcsIm5iZiI6MTczODg4NzE0NywicGF0aCI6Ii8xNzM2Mzc5My8yOTc5MDA2MjQtODY0YWU2MTMtZDJkYy00NmFhLWIxMmUtNTI4NGJmMWI1MGQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAwMTIyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEyNGYyYzFkODNjYmY2YmJiYTU1NzU0YTVhYzMwMTA0MTdhNzRjMmU0ZDI0ZjU3ODQyMDVjYTE4ZDJjZmM2MTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4Z1vK-BR_8uvnEkFmLe6YrOX9IWLKeUzQsGXjQHbxm4)
Before this PR, the comment would be empty and I couldn't see any errors on console too which would help debug.