sensors: use sensor_gyro timestamp_sample for sensor_combined timestamp

The timestamp actually used by ekf2 is the sensor_combined timestamp, so we should be setting it with the actual data sample timestamp, rather than the aggregated sensors topic publication metadata.

Later the sensor_combined message will be replaced with vehicle_imu that carries a separate publication timestamp and raw sample timestamp.
This commit is contained in:
Daniel Agar
2020-05-10 15:24:32 -04:00
committed by GitHub
parent 49981627dd
commit ec2cd3b1be
+1 -1
View File
@@ -596,7 +596,7 @@ void VotedSensorsUpdate::gyroPoll(struct sensor_combined_s &raw)
_last_sensor_data[uorb_index].gyro_rad[1] = gyro_rate(1);
_last_sensor_data[uorb_index].gyro_rad[2] = gyro_rate(2);
_last_sensor_data[uorb_index].timestamp = gyro_report.timestamp;
_last_sensor_data[uorb_index].timestamp = gyro_report.timestamp_sample;
_gyro.voter.put(uorb_index, gyro_report.timestamp, _last_sensor_data[uorb_index].gyro_rad,
gyro_report.error_count, _gyro.priority[uorb_index]);
}