Skip to content

Use use_count in LockedRobotState - #3792

Open
Tobias-Fischer wants to merge 1 commit into
moveit:mainfrom
Tobias-Fischer:codex/robostack-moveit-robot-interaction-use-count
Open

Use use_count in LockedRobotState#3792
Tobias-Fischer wants to merge 1 commit into
moveit:mainfrom
Tobias-Fischer:codex/robostack-moveit-robot-interaction-use-count

Conversation

@Tobias-Fischer

Copy link
Copy Markdown
Contributor

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.

LockedRobotState currently uses std::shared_ptr::unique() to decide whether it can modify the stored state in place. That API was removed in C++20. Comparing use_count() with one preserves the existing copy-on-write behavior while keeping this code compatible with toolchains that build MoveIt with newer C++ standards.

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>
@Tobias-Fischer

Copy link
Copy Markdown
Contributor Author

FYI @wep21 and @traversaro: I opened this while upstreaming RoboStack patches tracked in RoboStack/robostack.github.io#16. This one comes from patch/ros-rolling-moveit-ros-robot-interaction.patch.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.23%. Comparing base (4a766fd) to head (385ca55).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify

mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants