Check rclcpp::ok before sleeping for clean shutdown (backport #3484)#3486
Merged
Check rclcpp::ok before sleeping for clean shutdown (backport #3484)#3486
Conversation
Calling rate.sleep() on shutdown will crash (cherry picked from commit f4cf780)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## jazzy #3486 +/- ##
==========================================
+ Coverage 46.19% 46.19% +0.01%
==========================================
Files 718 718
Lines 62667 62669 +2
Branches 7587 7589 +2
==========================================
+ Hits 28942 28943 +1
- Misses 33560 33562 +2
+ Partials 165 164 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MarqRazz
approved these changes
May 28, 2025
valmikikothare
added a commit
to valmikikothare/moveit2
that referenced
this pull request
May 28, 2025
PSM: finish thread on rclcpp::shutdown (moveit#3484) (moveit#3486)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In MTC PR#684 I found move_group fails to shut down cleanly when preempting motion. This is because we are asking the node to sleep when the stack has been requested to shut down. To fix this I added a simple guard to make sure
rclcpp::ok()before sleeping.Here is a snippet of the stack trace when shutting down.
Checklist
This is an automatic backport of pull request #3484 done by [Mergify](https://mergify.com).