Skip to content

feat(parser_data_tamer): read data_tamer 2.x recordings (0.10.0) - #330

Open
facontidavide wants to merge 1 commit into
mainfrom
feat/parser-data-tamer-v2
Open

facontidavide wants to merge 1 commit into
mainfrom
feat/parser-data-tamer-v2

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

parser_data_tamer now reads recordings of data_tamer 2.x as well as 1.x (manifest 0.10.0). data_tamer 2.x is a new major version, developed at https://github.com/facontidavide/data_tamer; PlotJuggler 4 is the release that reads its files.

Changes

  • Dependency: the CPM download of PickNikRobotics/data_tamer 1.0.3 becomes the data_tamer 2.x sources. They are pinned by commit and SHA256 (7b4dc82), since 2.0.0 is not tagged yet; a comment says the pin moves to the 2.0.0 tag once it is released. The include directory is data_tamer_cpp/include (data_tamer_v2/data_tamer_parser.hpp).
  • Parser API, 2.x:
    • BuildSchemaFromText() replaces the misspelled BuilSchemaFromText().
    • SplitMcapMessage() replaces the plugin's hand-written MCAP body framing.
    • The [[nodiscard]] bool result of ParseSnapshot() is checked, and malformed input becomes an error status instead of a crash. Everything is caught as std::exception, since this is a C ABI boundary.
    • The new VarNumber alternatives map to their own types: bool stays boolean, and char becomes a uint8 byte.
  • Schemas:
    • read: version 4 (data_tamer 1.x), 5 (2.x line text) and 6 (the YAML rendering used by the 2.x ROS 2 publisher);
    • rejected, with a clear error: version-less schema texts from releases before 0.7.0.
  • Tests: 23 cases.
    • Golden tests against the data_tamer wire-format vectors, read from the pinned sources rather than copied: text and YAML, plain and nested, full and masked snapshots, every field checked against expected.json.
    • data_tamer 1.x schema texts.
    • Malformed-input tests: oversized mask size, truncation, oversized payload size, version-less text.
  • Docs: CHANGELOG, README and manifest version.

Tested

Release build with 0 warnings; 23/23 gtest and 7/7 ctest, with the pinned archive downloaded and hash-checked by CPM; pre-commit clean.

Follow-ups

  • PJ4's WASM build compiles these plugin sources with its own data_tamer 1.0.3 (cmake/PjWasmDependencies.cmake) and never runs this CMake. When PJ4 updates its pin of this repository, it has to move to the same data_tamer 2.x commit.
  • Faster parser: data_tamer main has since made the parser 2 to 7.6 times faster, with the same API. Updating the pin to a newer commit, or to the 2.0.0 tag, picks that up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UHSVkk2paVU7LhxqzUoHAH

data_tamer 2.x writes schema version 5 (and YAML, version 6, from its ROS 2
publisher), which the bundled 1.0.3 parser rejects. The plugin now builds
against the 2.x standalone parser, from facontidavide/data_tamer at a main
commit pinned by SHA256 (to become the 2.0.0 tag), and still reads 1.x
recordings (version 4).

- data_tamer_v2/data_tamer_parser.hpp, BuildSchemaFromText(), and
  SplitMcapMessage() instead of the hand-written framing checks.
- ParseSnapshot()'s result and exceptions become error statuses; parse()
  appends no partial record. Any std::exception is caught: the plugin is
  called through a C ABI.
- bool stays bool; char is passed as its uint8 wire byte.
- Schema texts without a "### version:" line (releases before 0.7.0) are
  rejected with a clear error.
- Tests use real schema texts and check data_tamer's golden vectors (line
  and YAML schemas, full and masked snapshots, nested types, the 1.x v4
  schemas) plus malformed framing, truncated fields and trailing bytes.

Tested: Release build, no warnings in parser_data_tamer; 23/23 gtest cases,
7/7 ctest, with the pinned archive downloaded and hash-checked by CPM;
pre-commit clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fc2Mg5PYjZ4ap5DnC3nUHZ
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.

1 participant