forked from Archive/PX4-Autopilot
added ID field to uORB analog_measurement msg
This commit is contained in:
parent
126cbd5b40
commit
49055dd8ec
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue