Skip to content
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

use protobuf for data encoding #34

Closed
asherikov opened this issue Nov 4, 2024 · 1 comment
Closed

use protobuf for data encoding #34

asherikov opened this issue Nov 4, 2024 · 1 comment

Comments

@asherikov
Copy link

Hello,

I suggest to switch to protobuf encoding instead of a custom protocol:

  • this would make adaptation much easier, e.g., Decode mcap files with Python #15;
  • the protobuf schemas would provide clear documentation;
  • protocol can be evolved much easier;
  • protobuf is already supported in PlotJuggler, so most likely it would only be necessary to add custom handlers similar to pal_statisitcs.

How:

  1. define protobuf schemas;
  2. generate code using https://github.com/nanopb/nanopb, in order to avoid heavy dependencies on protobuf libraries and potential issues with library/generator compatibility;
  3. generate protobuf binary descriptors with protoc;
  4. embed descriptors in the source code;
  5. at runtime write protobuf descriptors and messages to mcap as documented https://mcap.dev/guides/cpp/protobuf

I did a similar thing for a toy project -- it works.

@facontidavide
Copy link
Collaborator

facontidavide commented Dec 6, 2024

Sooooo....

Protobuf is a schema based serialization protocol. BY DEFINITION, data tamer is schema-less.

The steps you describe are simply not possible, in particular step 3.

IF we create the schema at run time and IF we use probuf introspection to serialize without code generation, then it MIGHT be possible to do something similar to what you have in mind.

Lot of work that I am not planning to do yet. But hey! PR welcome :)

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

No branches or pull requests

2 participants