feat(data_load_mcap): always-include transform-tree channels (/tf et al.) in the topic picker#192
Open
facontidavide wants to merge 12 commits into
Open
feat(data_load_mcap): always-include transform-tree channels (/tf et al.) in the topic picker#192facontidavide wants to merge 12 commits into
facontidavide wants to merge 12 commits into
Conversation
Users narrowing their topic selection can leave out /tf and /tf_static, silently breaking Scene3D transform-tree rendering. Design keeps the plugin format-agnostic: a generic (topic, encoding) whitelist forces these channels selected and locked in the picker, verified against real ROS 2 bags (message_encoding=cdr, not the schema's ros2msg tag). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Topic-name matching (/tf, /tf_static) breaks on real Foxglove-recorded files, which have no fixed topic-name convention for transforms (verified with the mcap CLI: a real file uses topic "tf", no leading slash). Key the whitelist on message type instead — tf2_msgs/msg/TFMessage (cdr) and foxglove.FrameTransform (protobuf), both already classified as kFrameTransforms in parser_ros/parser_protobuf — so it works regardless of topic naming. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…Transform) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… smoke test Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ebrtc pickers Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eFile() Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…he picker Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t All / host selection changes Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ks can't pass vacuously Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Problem
The MCAP topic-picker treats every channel identically. When a user narrows their selection instead of loading everything,
/tf//tf_staticare easy to leave out — and PJ4's Scene3D then silently fails to placePointCloud/Mesh3D/other 3D objects, because the transform tree never reaches the ObjectStore.Mechanism: generic (schema, encoding) whitelist — no ROS code path
Channels whose (schema name, message encoding) matches
kAlwaysIncludeRulesare always loaded — pre-checked and locked (disabled row + tooltip) in the picker:tf2_msgs/msg/TFMessagecdrfoxglove.FrameTransformprotobufMatching is deliberately on message type, not topic name: verified with the
mcapCLI on real recordings, Foxglove files publish transforms under arbitrary topic names (e.g.tf, no leading slash —example-023-av-argo-2.mcap), so a/tfname rule would silently miss them. Likewise the encoding is the channel'smessage_encoding(cdr), not the schema-record encoding (ros2msg) — an easy field to confuse. The loader stays format-agnostic: the whitelist is data, the mechanism knows nothing about ROS.Enforcement is model-layer, view is garnish
reassertAlwaysIncluded()(idempotent) re-inserts whitelisted non-empty channels intoselected_topics_after every mutation point:analyzeFile()(coversloadConfig()restore of pre-feature layouts),onSelectionChanged, andbtnDeselectAll. Zero-message channels are never force-included.mcap_source.cppis untouched — it already reads onlyselectedTopics(), so the guarantee holds even if the view desyncs.Also included: selection restore switched from index-keyed
setSelectedRowsto text-keyedsetSelectedItems, the same sort-safety pattern as #188 (the table hassortingEnabled=true; index restore desyncs after a user sort).disabled_rowsstays index-keyed — cosmetic-only risk, documented in the spec.Tests
Restored the
mcap_dialog_testtarget deleted in #144 (McapDialog previously had zero direct coverage) — now 10 tests: whitelist hit/near-miss matrix, force-include surviving stale saved configs,Deselect All, host-reported deselection, zero-message exclusion, locked-row disabled+tooltip rendering, text-keyed selection, and fixture pinning. New fixturetest_dialog_whitelist.mcap(5 channels incl. a non-conventional-name Foxglove transform and a right-schema/wrong-encoding near miss) generated viagenerate_verification_mcaps.py. Full plugin suite: 6/6 targets green.Codex review
Independent Codex review verdict: ship with fixes — guarantee coverage confirmed complete; its minor test-vacuity finding is fixed here (fixture pinning). Its major finding is real but pre-existing and cross-cutting: the PJ4 host applies
selected_itemsonly toQListWidget— theQTableWidgetbranch inpj_dialog_host/src/widget_binding.cpphonorsselected_rowsonly (verified on PJ4origin/mainand every branch). This affects foxglove onmainand #188's ros2/webrtc identically: the model round-trips fine (table selection read-back is already text-based), but visual pre-selection isn't restored on dialog open. Follow-up: small PJ4 host patch mirroring the QListWidgetselected_itemsapply into the QTableWidget branch — fixes all three plugins at once.Spec and plan:
docs/superpowers/specs/2026-07-06-mcap-always-include-tf-design.md,docs/superpowers/plans/2026-07-06-mcap-always-include-tf.md.🤖 Generated with Claude Code