diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-25 17:53:15 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-29 16:33:53 +0100 |
commit | c3eb10560ba255fdda2454e6044bb4efac35b38f (patch) | |
tree | 55aacada6dadd44ca913d545be13c2f763abfd7b /src/modules | |
parent | f641a26feee76f4a811fec34834cc818a8e8f76a (diff) | |
download | px4-firmware-c3eb10560ba255fdda2454e6044bb4efac35b38f.tar.gz px4-firmware-c3eb10560ba255fdda2454e6044bb4efac35b38f.tar.bz2 px4-firmware-c3eb10560ba255fdda2454e6044bb4efac35b38f.zip |
Move sensors to new mag interface
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/sensors/sensors.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 793b7c2b6..3f66d7995 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -1249,7 +1249,7 @@ Sensors::mag_poll(struct sensor_combined_s &raw) if (mag_updated) { struct mag_report mag_report; - orb_copy(ORB_ID(sensor_mag0), _mag_sub, &mag_report); + orb_copy(ORB_ID(sensor_mag), _mag_sub, &mag_report); math::Vector<3> vect(mag_report.x, mag_report.y, mag_report.z); @@ -1278,7 +1278,7 @@ Sensors::mag_poll(struct sensor_combined_s &raw) if (mag_updated) { struct mag_report mag_report; - orb_copy(ORB_ID(sensor_mag1), _mag1_sub, &mag_report); + orb_copy(ORB_ID(sensor_mag), _mag1_sub, &mag_report); raw.magnetometer1_raw[0] = mag_report.x_raw; raw.magnetometer1_raw[1] = mag_report.y_raw; @@ -1292,7 +1292,7 @@ Sensors::mag_poll(struct sensor_combined_s &raw) if (mag_updated) { struct mag_report mag_report; - orb_copy(ORB_ID(sensor_mag2), _mag2_sub, &mag_report); + orb_copy(ORB_ID(sensor_mag), _mag2_sub, &mag_report); raw.magnetometer2_raw[0] = mag_report.x_raw; raw.magnetometer2_raw[1] = mag_report.y_raw; @@ -1945,13 +1945,13 @@ Sensors::task_main() */ _gyro_sub = orb_subscribe(ORB_ID(sensor_gyro0)); _accel_sub = orb_subscribe(ORB_ID(sensor_accel0)); - _mag_sub = orb_subscribe(ORB_ID(sensor_mag0)); + _mag_sub = orb_subscribe_multi(ORB_ID(sensor_mag), 0); _gyro1_sub = orb_subscribe(ORB_ID(sensor_gyro1)); _accel1_sub = orb_subscribe(ORB_ID(sensor_accel1)); - _mag1_sub = orb_subscribe(ORB_ID(sensor_mag1)); + _mag1_sub = orb_subscribe_multi(ORB_ID(sensor_mag), 1); _gyro2_sub = orb_subscribe(ORB_ID(sensor_gyro2)); _accel2_sub = orb_subscribe(ORB_ID(sensor_accel2)); - _mag2_sub = orb_subscribe(ORB_ID(sensor_mag2)); + _mag2_sub = orb_subscribe_multi(ORB_ID(sensor_mag), 2); _rc_sub = orb_subscribe(ORB_ID(input_rc)); _baro_sub = orb_subscribe(ORB_ID(sensor_baro0)); _baro1_sub = orb_subscribe(ORB_ID(sensor_baro1)); |