cyclonedds icon indicating copy to clipboard operation
cyclonedds copied to clipboard

how can I use proto define file to define cyclonedds msg struct

Open sgf201 opened this issue 3 years ago • 1 comments

For historical reasons, many message structure definitions in the project use the definition format of protobuf. Is it possible to continue to use or maximize the reuse of these proto definition files after switching to dds?

sgf201 avatar Sep 25 '22 14:09 sgf201

There is a spectrum of possibilities:

  • "do nothing" and you'll have to rewrite your applications
  • create topics that store the protobuf data in a big blob, that you may be able to do with minimally invasive changes
  • create a protobuf binding, tying the protobuf (de)serialisation to Cyclone (that means using some non-stable interface of Cyclone, the serdata interface)
  • see if there is a way of transforming protobuf message formats to IDL, and using an alternative mapping of IDL to C++ (assuming you use C++)

In a way, the last two are arguably the most elegant as they provide the tightest integration. I have no idea how hard the last one is, but the next-to-last before is pretty straightforward if the topics are all keyless. I know there are ways of annotating protobuf message definitions with custom annotations and, so it is definitely possible.

Indeed, OpenSplice essentially did the 2nd option with some custom annotations in protobuf to make keys work. I dare say one could take the support code from OpenSplice and make it work on Cyclone with truly minimal changes.

I won't be able to look into it any time soon, but if you can figure out the details of the integration in OpenSplice (I only know the high-level version) then I think you'll have a very practical way forward. Would that be an option?

eboasson avatar Sep 26 '22 10:09 eboasson