Add a buttons field that's a uint16_t bitfield representing each button: 0 means off, 1 means on. This is nice because it supports both momentary and toggle switches.
Compress the 4 *_control fields into a single uint8_t bitfield utilizing just the lowest four bytes to indicate their control mode.
Change the 'roll', 'pitch', 'yaw', and 'thrust' fields all into 'int8_t's ranging from -100 to 100. The precision to 1% is probably good enough for most uses. If necessary, this field can be upgraded to int16_ts with either -1000...1000 or -10000...10000 range.
So what this gives us is now button inputs along with a negligible loss of precision on the four control channels. As this message will probably be sent quite quickly, my changes also reduce the size of the packet from 21 to 8 to minimize the required bandwidth (at 8 bytes this message becomes transmittable at 50Hz on a 9600baud channel).
I propose the following changes:
buttons
field that's a uint16_t bitfield representing each button: 0 means off, 1 means on. This is nice because it supports both momentary and toggle switches.*_control
fields into a singleuint8_t
bitfield utilizing just the lowest four bytes to indicate their control mode.int16_t
s with either -1000...1000 or -10000...10000 range.So what this gives us is now button inputs along with a negligible loss of precision on the four control channels. As this message will probably be sent quite quickly, my changes also reduce the size of the packet from 21 to 8 to minimize the required bandwidth (at 8 bytes this message becomes transmittable at 50Hz on a 9600baud channel).