For a project I need to send a message containing 1 timestamp and a number of sensor data values (magnetic induction in my case), which have a sufficiently precise sample rate (50 Hz in my case), so that each value can be assigned with a timestamp. I added this to my own ArduCopter code.
Do you think a message of this kind is useful to others too, so I should do some changes to it and add it to the official ardupilotmega dialect, if the community thinks, it’s adequate? Or do you think this use case is too custom built?
My message (which in this state is for internal use only and open to improvement) is specified by:
message name: CSMAG0
message id# 240
time_usec uint64_t timestamp
induction int32_t[N] magnetic induction values
N ::= 1 … 62 (I chose N=10 for now)
to Ardupilotmega.xml I added:
<message id=“240” name=“CSMAG0”>
<description>Magnetometer sensor data</description>
<field type=“uint64_t” name=“time_usec” units=“us”>Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.</field>
<field type=“int32_t” name=“induction”>Measured magnetic induction values, which can be converted into magnetic induction in Nanoteslas.</field>
In case this message is useful, I would generalize it to “sensor values” or something like that, and of course change the name. At this point I’m also not sure, what to do with N for a generalized message.