Skip to content

backend: write robot description to TrossenMCAP files#274

Open
abhichothani42 wants to merge 2 commits into
urdf-02-backend-configfrom
urdf-03-mcap-backend
Open

backend: write robot description to TrossenMCAP files#274
abhichothani42 wants to merge 2 commits into
urdf-02-backend-configfrom
urdf-03-mcap-backend

Conversation

@abhichothani42

@abhichothani42 abhichothani42 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Writes the robot's URDF into every MCAP file. On open(), when include_robot_description is set, the backend resolves the URDF through RobotDescriptionCache and logs a single message on a /robot_description channel, so each episode file carries the exact robot model it was recorded with.

Changes

  • Add git_ref to the RobotDescription proto so the file records which description version it embeds.
  • Add robot_description_topic() (/robot_description) to the TrossenMCAP topic helpers.
  • Add the channel setup and single-message write to TrossenMCAPBackend::open(), plus a robot_description_written stat and clean channel teardown in close_resources().

Test Plan

  • Builds cleanly (make build)
  • Tests pass(make test)
  • Lint passes (pre-commit run --all-files)
  • Verified on hardware

Breaking Changes

None. With include_robot_description=false (the default) the output files are unchanged.

Related Issues

None.

abhichothani42 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the trossen_mcap backend so each recorded MCAP episode can optionally embed the exact robot model (URDF) it was recorded with, improving reproducibility and downstream tooling compatibility.

Changes:

  • Add a git_ref field to the RobotDescription protobuf so the embedded URDF can be tied to a specific description version.
  • Introduce a fixed /robot_description topic helper for a dedicated robot description channel.
  • Write a single RobotDescription message during TrossenMCAPBackend::open() (when enabled), track a robot_description_written stat, and ensure the channel is closed/reset during teardown.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/backends/trossen_mcap/trossen_mcap_backend.cpp Adds URDF resolution + one-shot write on open; introduces robot description channel creation and teardown; registers the new schema blob.
include/trossen_sdk/io/backends/trossen_mcap/trossen_mcap_schemas.hpp Adds robot_description_topic() returning /robot_description.
include/trossen_sdk/io/backends/trossen_mcap/trossen_mcap_backend.hpp Adds stats + members and declares helpers for the robot description channel/message write.
include/trossen_sdk/io/backends/trossen_mcap/proto/RobotDescription.proto Extends the proto with a git_ref field for provenance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/backends/trossen_mcap/trossen_mcap_backend.cpp
Comment thread src/backends/trossen_mcap/trossen_mcap_backend.cpp
@abhichothani42
abhichothani42 force-pushed the urdf-02-backend-config branch 2 times, most recently from a7e19c7 to a51dcee Compare July 17, 2026 15:21
@abhichothani42
abhichothani42 force-pushed the urdf-02-backend-config branch from a51dcee to 7f15201 Compare July 17, 2026 16:33
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