BluEye-Robotics / ProtocolDefinitions

Collection of protocol definitions for the Blueye underwater drones
GNU Lesser General Public License v3.0
2 stars 3 forks source link

Include data types sent over TCP in protocol definition #4

Closed follesoe closed 2 years ago

follesoe commented 6 years ago

So far the protocol definition file only includes packages published over UDP. In addition, we have data types passed between app and drone over the TCP connection. These are defined inline in the node_telecommunication.cpp, like the AllCamParam: https://github.com/BluEye-Robotics/p2_drone/blob/dev/src/node_telecommunication/node_telecommunication.cpp#L160

The types are:

It's equally important (for backward compatibility in the app) to version and identify these types, as the app needs to know the size and how to unpack the returned from the drone.

I sugges we follow the same scheme as we do for the UDP, with a protocol version, and a message type as the two first bytes. As none of the existing messages has these two fields, we can consider the existing messages v1 (even if our protocol is currently at v2), and then simply version all the existing messages as v2.

This issue is relevant now, as we are extending the AllCamParamData message with two fields, FPS and resolution. See https://github.com/BluEye-Robotics/p2_drone/pull/93

As the existing messages do not have version or type info, I will use a feature toggle in the app and use the version number of the drone to determine which data format to expect in this concrete instance.