mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 22:32:11 +08:00
added ID field to uORB analog_measurement msg
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user