osi-sensor-model-packaging icon indicating copy to clipboard operation
osi-sensor-model-packaging copied to clipboard

Initial DummySource and DummySensor conversion to Flatbuffers

Open ClemensLinnhoff opened this issue 4 years ago • 0 comments

Signed-off-by: linnhoff [email protected]

Description

This is the first implementation of OSMPDummySource and OSMPDummySensor for Flatbuffers as a decision guide for a potential switch from Protobuf to Flatbuffers in OSI 4.0. There are still some open points marked with "todo" in the code. They include mainly the following:

  1. Object type and vehicle classification are not correctly set in the generated Flatbuffers header files. Classification type is confused with vehicle type and the object types of moving and stationary object are interchanged. This is done by the flatc compiler, that generates the header files out of the .proto files.
  2. The interface version is not set at the moment. This is originally done by using Protobuf FileOptions, which do not exist in Flatbuffers.
  3. In the DummySensor, the input sensor_view is not copied into the sensor_data buffer in the initial commit. Copying buffer contents is not directly supported by Flatbuffers. Copying the offsets does not work, because they are not accessible, once the buffer is serialized (once a builder is finished). A deep copy of the object would work, but has do be done manually. There is no predefined function in Flatbuffers.

Check the checklist

  • [x] I have performed a self-review of my own code.
  • [ ] I have made corresponding changes to the documentation for osi-sensor-model-packaging.
  • [ ] My changes generate no new warnings.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [ ] New and existing unit tests / Github Actions pass locally with my changes.

ClemensLinnhoff avatar Feb 01 '22 07:02 ClemensLinnhoff