From fd0950f0463996286746679c55c5c6c8174662eb Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 30 Aug 2015 00:08:12 +0200 Subject: [PATCH] Attitude estimator Q: Update to new sensors combined topic --- .../attitude_estimator_q_main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/attitude_estimator_q/attitude_estimator_q_main.cpp b/src/modules/attitude_estimator_q/attitude_estimator_q_main.cpp index a127f9d057..b8a5481466 100644 --- a/src/modules/attitude_estimator_q/attitude_estimator_q_main.cpp +++ b/src/modules/attitude_estimator_q/attitude_estimator_q_main.cpp @@ -288,12 +288,12 @@ void AttitudeEstimatorQ::task_main() sensor_combined_s sensors; if (!orb_copy(ORB_ID(sensor_combined), _sensors_sub, &sensors)) { // Feed validator with recent sensor data - _voter_gyro.put(0, sensors.timestamp, sensors.gyro_rad_s, sensors.gyro_errcount); - _voter_gyro.put(1, sensors.gyro1_timestamp, sensors.gyro1_rad_s, sensors.gyro1_errcount); - _voter_accel.put(0, sensors.accelerometer_timestamp, sensors.accelerometer_m_s2, sensors.accelerometer_errcount); - _voter_accel.put(1, sensors.accelerometer1_timestamp, sensors.accelerometer1_m_s2, sensors.accelerometer1_errcount); - _voter_mag.put(0, sensors.magnetometer_timestamp, sensors.magnetometer_ga, sensors.magnetometer_errcount); - _voter_mag.put(1, sensors.magnetometer1_timestamp, sensors.magnetometer1_ga, sensors.magnetometer1_errcount); + + for (unsigned i = 0; i < 2; i++) { + _voter_gyro.put(i, sensors.gyro_timestamp[i], &sensors.gyro_rad_s[i * 3], sensors.gyro_errcount[i]); + _voter_accel.put(i, sensors.accelerometer_timestamp[i], &sensors.accelerometer_m_s2[i * 3], sensors.accelerometer_errcount[i]); + _voter_mag.put(i, sensors.magnetometer_timestamp[i], &sensors.magnetometer_ga[i * 3], sensors.magnetometer_errcount[i]); + } int best_gyro, best_accel, best_mag;