Use use_count in LockedRobotState - #3792
Open
Tobias-Fischer wants to merge 1 commit into
Open
Conversation
This upstreams the C++20-compatible part of the RoboStack moveit_ros_robot_interaction build fix. std::shared_ptr::unique() was removed in C++20. Comparing use_count() with one keeps the existing copy-on-write behavior while avoiding the removed API in toolchains that build MoveIt with newer C++ standards. Origin: patch/ros-rolling-moveit-ros-robot-interaction.patch, authored by Daisuke Nishimatsu. Signed-off-by: Tobias Fischer <info@tobiasfischer.info>
Contributor
Author
|
FYI @wep21 and @traversaro: I opened this while upstreaming RoboStack patches tracked in RoboStack/robostack.github.io#16. This one comes from |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3792 +/- ##
==========================================
- Coverage 46.23% 46.23% -0.00%
==========================================
Files 726 726
Lines 59512 59510 -2
Branches 7622 7623 +1
==========================================
- Hits 27509 27506 -3
Misses 31836 31836
- Partials 167 168 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rhaschke
approved these changes
Jul 20, 2026
|
Tick the box to add this pull request to the merge queue (same as
|
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.
This is part of an effort to contribute RoboStack downstream patches back upstream.
Origin:
patch/ros-rolling-moveit-ros-robot-interaction.patch, authored by Daisuke Nishimatsu.LockedRobotStatecurrently usesstd::shared_ptr::unique()to decide whether it can modify the stored state in place. That API was removed in C++20. Comparinguse_count()with one preserves the existing copy-on-write behavior while keeping this code compatible with toolchains that build MoveIt with newer C++ standards.