paparazzi / pprzlink

Message and communication library for the Paparazzi UAV system
Other
24 stars 55 forks source link

Added message to send control effectiveness matrix #42

Closed EwoudSmeur closed 7 years ago

EwoudSmeur commented 7 years ago

This corresponds to https://github.com/paparazzi/paparazzi/pull/1916

gautierhattenberger commented 7 years ago

At least the C API of pprzlink is not handling correctly multiple variable length arrays (for reading at least). Reading this downlink message with the C interface should not happen, but are we still allowing this ? Is the Ocaml part (GCS, messages,...) working correctly for this (never tried it actually) ?

EwoudSmeur commented 7 years ago

I copied it from other messages, like PAYLOAD. It works fine in messages, even plotting the entire array by dragging it in a real time plotter works like a charm

podhrmic commented 7 years ago

@gautierhattenberger How much work is it to fix/update the C api to handle multiple arrays?

gautierhattenberger commented 7 years ago

Just some headaches to compute the correct index in the reading macros

EwoudSmeur commented 7 years ago

I don't think I have ever used the C API, but I don't understand what the difference is wrt messages that are already there, such as PAYLOAD, MOTOR_MIXING and many others. If these messages are giving problems with the C API, I am in favour of fixing that, but perhaps we can merge this in the meantime?

gautierhattenberger commented 7 years ago

This message have only one variable length array as the last field of the message. If you don't do this, the indexes of any following fields would be wrong. We could merge this as reading this message from a C program is very unlikely, but fixing the original issue would be even better (and I don't have much time to do it myself).

EwoudSmeur commented 7 years ago

In that case I would vote for merging this now, such that I can move on. We could make an issue about this.

I would like to help out (I guess you are talking about pprzlink_utils.h?) but I don't completely understand what is happening there.

gautierhattenberger commented 7 years ago

There is nothing to change here I think. But in the generator (tools/generator/gen_messages_c.py) the index passed as a second argument of the pprzlink_utils.h macros are statically computed while it should take into account the length of the arrays when relevant (so for all fields after variable length arrays). I'll merge this, but I would really appreciate if someone solves this issue.