added ID field to uORB analog_measurement msg

This commit is contained in:
Jacob Dahl 2020-08-18 13:34:03 -08:00
parent 126cbd5b40
commit 49055dd8ec
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,5 @@
uint64 timestamp # time since system start (microseconds)
int32 id # Source node ID
uint8[4] unit_type # Units: mV, mA, Kelvin*10
uint16[4] values # mV, mA, Kelvin*10

View File

@ -64,12 +64,15 @@ UavcanAnalogMeasurementBridge::analog_measurement_sub_cb(const
uavcan::ReceivedDataStructure<com::volansi::equipment::adc::AnalogMeasurement> &msg)
{
analog_measurement_s report{};
int numIndices = msg.values.size();
int node_id = msg.getSrcNodeID().get();
report.id = node_id;
int numIndices = msg.values.size();
for (int i = 0; i < numIndices; i++) {
report.values[i] = msg.values[i];
report.unit_type[i] = msg.unit_type[i];
}
publish(msg.getSrcNodeID().get(), &report);
publish(node_id, &report);
}