From ec2cd3b1be17341a05d996b361ce8e1212298fb5 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 10 May 2020 15:24:32 -0400 Subject: [PATCH] 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. --- src/modules/sensors/voted_sensors_update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sensors/voted_sensors_update.cpp b/src/modules/sensors/voted_sensors_update.cpp index 22dc492d8a..5572a0c93b 100644 --- a/src/modules/sensors/voted_sensors_update.cpp +++ b/src/modules/sensors/voted_sensors_update.cpp @@ -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]); }