Repository navigation
feat(recording): add CDR MCAP store and native recording #4732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
12c81e0
feat(recording): record raw CDR and read schema-aware MCAP
TomCC7 95cecd4
fix(sdk): use the external CDR codec and shared message adapters
TomCC7 0fb3547
fix(cdr): integrate corrected library ownership into PR #4732
TomCC7 6eb6bf3
[autofix.ci] apply automated fixes
autofix-ci[bot] d4dbc82
release(cdr): consume published cdrgen 0.1.2 in PR #4774
TomCC7 35a1d87
release(cdr): consume published cdrgen 0.1.2 in PR #4732
TomCC7 1ca31e1
Use standard ROS TF conventions in CDR stack layer #4774
TomCC7 aaeca85
Use standard ROS TF conventions in CDR stack layer #4732
TomCC7 879c3d8
Use standard ROS TF conventions in CDR stack layer #4774
TomCC7 a712641
Use standard ROS TF conventions in CDR stack layer #4732
TomCC7 a9abfc5
Use standard ROS TF conventions in CDR stack layer #4774
TomCC7 7390d29
Use standard ROS TF conventions in CDR stack layer #4732
TomCC7 b31e792
Use standard ROS TF conventions in CDR stack layer #4774
TomCC7 a002034
Use standard ROS TF conventions in CDR stack layer #4732
TomCC7 7dacb4a
Integrate shared native CDR types into feature PR #4732
TomCC7 4511158
[autofix.ci] apply automated fixes
autofix-ci[bot] e6eb717
Build shared native messages in feature PR #4732
TomCC7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright 2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Resolve schema metadata once when registering a raw CDR recording stream.""" | ||
|
|
||
| from typing import Any | ||
|
|
||
| from dimos_cdrgen.registry import message_types, schema | ||
|
|
||
|
|
||
| def cdr_name(message_type: type[Any]) -> str | None: | ||
| if not hasattr(message_type, "__msgtype__"): | ||
| return None | ||
| return next((name for name, cls in message_types().items() if cls is message_type), None) | ||
|
|
||
|
|
||
| def recording_schema(message_type: type[Any]) -> dict[str, Any]: | ||
| name = cdr_name(message_type) | ||
| if name is None: | ||
| raise TypeError("CDR recording requires an installed, registry-owned message type") | ||
| return {"name": name, "data": schema(name)} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright 2026 Dimensional Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| //! Schema metadata for opaque CDR recording. | ||
|
|
||
| use anyhow::{ensure, Result}; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| #[derive(Clone, Debug, Deserialize, Serialize)] | ||
| #[serde(deny_unknown_fields)] | ||
| pub struct CdrSchema { | ||
| pub name: String, | ||
| pub data: String, | ||
| } | ||
|
|
||
| impl CdrSchema { | ||
| pub fn validate(&self) -> Result<()> { | ||
| ensure!( | ||
| self.name.split('/').count() == 3 && self.name.contains("/msg/"), | ||
| "CDR schema requires package/msg/Type identity" | ||
| ); | ||
| ensure!( | ||
| !self.data.trim().is_empty(), | ||
| "CDR recording requires complete ros2msg schema data" | ||
| ); | ||
| Ok(()) | ||
| } | ||
| } |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify that we do need this and can't be solved by rust's own cdr lib