Skip to content

Preserve planning scene and request diagnostic contracts - #3907

Open
Yuhx141 wants to merge 1 commit into
moveit:mainfrom
Yuhx141:fix/planning-scene-contracts
Open

Yuhx141 wants to merge 1 commit into
moveit:mainfrom
Yuhx141:fix/planning-scene-contracts

Conversation

@Yuhx141

@Yuhx141 Yuhx141 commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

Planning-scene ingestion and request diagnostics lose state in four normal API paths. This change:

  • defaults an attached object's empty touch_links to its link_name;
  • stops both world-geometry subscriptions instead of only the first active one;
  • preserves a request adapter's complete error status (val, message, and source); and
  • reports collision contacts from the request start state that was actually checked.

Each path has a focused regression test. No public API or GUI behavior changes require tutorial, migration, or screenshot updates.

Fixes #3885
Fixes #3897
Fixes #3899
Fixes #3900

Tested on Ubuntu 24.04 with ROS 2 Jazzy against a9004a4:

  • test_collision_objects
  • moveit_planning_pipeline_test
  • test_check_start_state_collision
  • PlanningSceneMonitor.StopWorldGeometryMonitorStopsAllSubscriptions

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference (not applicable)
  • Document API changes relevant to the user in the MIGRATION.md notes (not applicable)
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI (not applicable)
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

Assisted-by: OpenAI Codex (GPT-6)

Summary by CodeRabbit

  • Bug Fixes
    • Attached collision objects now default to treating their attached link as a touch link when none are specified.
    • Planning failures now retain their error code and details, and start-state collision reports reflect the requested state.
    • Stopping world-geometry monitoring now stops both monitored subscriptions.

Assisted-by: OpenAI Codex (GPT-6)
Signed-off-by: Yuhx141 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f62000ac-aad0-4037-bd1e-41d60f907ffa

📥 Commits

Reviewing files that changed from the base of the PR and between a9004a4 and 821818f.

📒 Files selected for processing (11)
  • moveit_core/planning_scene/src/planning_scene.cpp
  • moveit_core/planning_scene/test/test_collision_objects.cpp
  • moveit_ros/planning/planning_pipeline/src/planning_pipeline.cpp
  • moveit_ros/planning/planning_pipeline/test/planning_pipeline_test_plugins.cpp
  • moveit_ros/planning/planning_pipeline/test/planning_pipeline_tests.cpp
  • moveit_ros/planning/planning_pipeline_test_plugins_description.xml
  • moveit_ros/planning/planning_request_adapter_plugins/CMakeLists.txt
  • moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_collision.cpp
  • moveit_ros/planning/planning_request_adapter_plugins/test/test_check_start_state_collision.cpp
  • moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
  • moveit_ros/planning/planning_scene_monitor/test/planning_scene_monitor_test.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The changes update default touch links for attached collision objects, preserve request-adapter error details in planning responses, use the request start state for collision contacts, and reset both world-geometry subscribers when monitoring stops.

Changes

Attached Object Touch Links

Layer / File(s) Summary
Default touch link
moveit_core/planning_scene/src/planning_scene.cpp, moveit_core/planning_scene/test/test_collision_objects.cpp
When an attachment message has no touch links, the attached link is added as a touch link. A test checks that the resulting set contains that link.

Planning Pipeline Error Status

Layer / File(s) Summary
Preserve adapter status
moveit_ros/planning/planning_pipeline/src/planning_pipeline.cpp, moveit_ros/planning/planning_pipeline/test/*, moveit_ros/planning/planning_pipeline_test_plugins_description.xml
generatePlan assigns the full request-adapter status to res.error_code. A test adapter and pipeline test check that the error code, message, and source are preserved.

Start-State Collision Diagnostics

Layer / File(s) Summary
Query contacts for request start state
moveit_ros/planning/planning_request_adapter_plugins/src/check_start_state_collision.cpp, moveit_ros/planning/planning_request_adapter_plugins/test/test_check_start_state_collision.cpp, moveit_ros/planning/planning_request_adapter_plugins/CMakeLists.txt
The adapter passes the request start state to the collision-pair query. The test checks the error source and contact details, and CMake registers the test target.

World Geometry Monitor Shutdown

Layer / File(s) Summary
Reset both world subscribers
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp, moveit_ros/planning/planning_scene_monitor/test/planning_scene_monitor_test.cpp
stopWorldGeometryMonitor resets both subscribers. A test checks that both topics are removed from the monitored-topic list after stopping.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 82181

The changes correct attachment defaults, preserve adapter diagnostics, report contacts for the requested state, and stop both world-geometry subscriptions. No actionable merge-blocking risk remains on the supplied evidence; merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 82181

The fixes preserve existing interfaces while correcting attachment defaults, diagnostic propagation, and shutdown cleanup. No introduced security issue was established. Deployment-specific access to diagnostics and shutdown concurrency remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated effects are bounded to attachment state, collision diagnostics, planning responses and progress publication, and world-geometry subscriptions of the affected planning instances. Source evidence does not establish which external principals can submit scene messages, configure adapters, or receive diagnostics; deployment-wide exposure remains unknown.

Trust Boundaries and Controls

  • observed — Attachment ingestion validates the declared link and defaults an empty touch-link set to exactly that link. Explicit nonempty sets retain their previous handling, and AttachedBody stores the supplied set. The default introduces no wildcard or additional link selection.
  • observed — AlwaysFailureRequestAdapter is registered in the existing test plugin library and selected explicitly by a regression test. Library creation and manifest export are BUILD_TESTING-gated. A test-enabled installation can discover the plugin, but no production default adapter selection or new loading mechanism was established.

Resilience and Maintainability Implications

  • inferred — Normal attachment replacement and removal retain their existing ownership callbacks and octomap filtering relationship. Exceptional transactional atomicity and cancellation of callbacks queued before monitor shutdown remain unproved. These are pre-existing limitations, not established regressions from the new default or dual-subscription reset.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 9 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, specific, and accurately summarizes the pull request's main goal of preserving planning-scene behavior and request diagnostic contracts.
Linked Issues check ✅ Passed The changes implement all four active linked coding objectives. For #3885, processAttachedCollisionObjectMsg inserts link_name when touch_links is empty, and `PlanningScene.DefaultsEmptyTouchLin…
Out of Scope Changes check ✅ Passed The changes stay within the linked issue scope. The added request-adapter plugin, plugin declaration, build registration, and tests support verification of #3899 and #3900. The planning-scene and moni…
Full details: Docstring Coverage

Explanation

Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 9 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Yuhx141

Yuhx141 commented Nov 16, 2026

Copy link
Copy Markdown
Author

Hi @rhaschke, could you take a look at the planning scene and diagnostic fixes here? I'm happy to split them up if that would make review easier. Thanks!

@mergify

mergify Bot commented Nov 16, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • 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

1 participant