markers: DELETEALL clears every namespace (fix #59 parity regression)#75
Merged
Conversation
Per the visualization_msgs spec a DELETEALL marker clears ALL markers regardless of namespace. The camp2 markers (which replaced camp's in #59) routed every marker — including DELETEALL — to the single MarkerNamespace matching the message's ns (conventionally empty), so markers in every other namespace lingered as stale visuals on the operator's map. Detect DELETEALL in Markers::updateMarker and fan it out to all MarkerNamespaces. Regression flagged in the #59 parity audit (docs/parity/markers.md); confirmed live.
There was a problem hiding this comment.
Pull request overview
Fixes a regression in camp2’s ROS markers layer so that visualization_msgs::Marker::DELETEALL clears markers across all namespaces, matching the visualization_msgs behavior and restoring parity with legacy camp behavior.
Changes:
- Detect
DELETEALLinMarkers::updateMarkerand broadcast it to every existingMarkerNamespace. - Preserve existing routing behavior for
ADD/MODIFY/DELETE(namespace-scoped handling unchanged).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rolker
pushed a commit
that referenced
this pull request
Jun 9, 2026
Completes the camp->camp2 markers parity gap flagged in #70 (the DELETEALL fan-out was already handled by PR #75). src/camp2/ros/markers: - DELETE (and DELETEALL) now remove the Marker objects outright, and Markers::pruneEmptyNamespaces drops any namespace they empty. The port previously only cleared a Marker's visual children, leaking empty Marker/MarkerNamespace husks into the scene tree and the Layers list. A DELETE for an untracked namespace is now a no-op instead of creating one (and an empty Marker) just to delete from it. - addMarkers drops markers already expired on arrival (non-zero-stamp guard mirrors Marker::checkExpired) and markers with an empty frame_id, ported from camp's markers_converter drop checks. - updateMarker warns (throttled) on unrecognized actions instead of silently creating dead state, matching the camp original. Throttles now use the node clock so intervals track sim time under use_sim_time. src/camp2/map (Layer): - Add Layer::removeFromMap(), the canonical ADR-0003 removal (detach through the Map model so rowsAboutToBeRemoved fires, drop from the scene, then deleteLater). A raw delete of a Marker/MarkerNamespace -- both are Map model rows -- would leave the Layers-tab tree view with dangling rows (use-after-free). The existing 'Remove' context action now shares this path instead of duplicating it. setMapItemParent(nullptr) detaches from childItems() synchronously, so pruneEmptyNamespaces still sees the emptied namespace within the same pass. TEXT_VIEW_FACING font sizing (the remaining #70 item) is left to #76/PR #78, which owns the TEXT rendering path in marker.cpp. Build + colcon test pass (48 tests, 0 failures). The markers scene-tree logic needs a live Node + QGraphicsScene + Map model, so it is sim-verified rather than unit tested, per PR #75's precedent. Parity matrix in docs/parity/markers.md updated. Closes #70
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.
Summary
Fixes the DELETEALL spec-violation regression from the camp→camp2 markers
replacement (#59). Addresses the headline must-fix of #70; the remaining marker
port items in that issue stay open.
The bug
visualization_msgsspec: aDELETEALLmarker clears every markerregardless of namespace. camp did this; the camp2 markers that replaced it (PR5)
route every marker — DELETEALL included — to the single
MarkerNamespacematching the message's
ns(conventionally empty). So a publisher clearingitself with DELETEALL only cleared the
""namespace, and markers in everyother namespace lingered as stale visuals on the operator's map.
Fix
Detect
DELETEALLinMarkers::updateMarkerand fan it out to allMarkerNamespaces (each already clears its own markers). One change, no behaviorchange for ADD/MODIFY/DELETE.
Test
colcon build+colcon test— 48 tests, 0 failures.Markersisn't unit-testable in isolation (needs a liveNode+ scene tree),so no gtest.
every namespace's markers clear (not just the empty one).
Remaining #70 items (separate, not in this PR): DELETE object/namespace pruning,
TEXT
scale.zfont sizing, already-expired/empty-frame ingest drops,unknown-action warn.
Authored-By:
Claude Code AgentModel:
Claude Opus 4.8 (1M context)