From c99923d500103d05cb8bb5e56592595d7846df86 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 27 Aug 2019 18:16:15 +1000 Subject: [PATCH] AP_InertialSensor: require gyro orientations in LSM9DS probe this prevents a bug where they are missing in hwdef.dat --- libraries/AP_InertialSensor/AP_InertialSensor.cpp | 6 ------ libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h | 6 +++--- libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS1.h | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.cpp b/libraries/AP_InertialSensor/AP_InertialSensor.cpp index b5b68ac89f..7a3e7bb067 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor.cpp @@ -860,12 +860,6 @@ AP_InertialSensor::detect_backends(void) #elif HAL_INS_DEFAULT == HAL_INS_EDGE ADD_BACKEND(AP_InertialSensor_Invensense::probe(*this, hal.spi->get_device(HAL_INS_MPU60x0_NAME), ROTATION_YAW_90)); ADD_BACKEND(AP_InertialSensor_Invensense::probe(*this, hal.spi->get_device(HAL_INS_MPU60x0_NAME_EXT), ROTATION_YAW_90)); -#elif HAL_INS_DEFAULT == HAL_INS_LSM9DS1 - ADD_BACKEND(AP_InertialSensor_LSM9DS1::probe(*this, hal.spi->get_device(HAL_INS_LSM9DS1_NAME))); -#elif HAL_INS_DEFAULT == HAL_INS_LSM9DS0 - ADD_BACKEND(AP_InertialSensor_LSM9DS0::probe(*this, - hal.spi->get_device(HAL_INS_LSM9DS0_G_NAME), - hal.spi->get_device(HAL_INS_LSM9DS0_A_NAME))); #elif HAL_INS_DEFAULT == HAL_INS_L3G4200D ADD_BACKEND(AP_InertialSensor_L3G4200D::probe(*this, hal.i2c_mgr->get_device(HAL_INS_L3G4200D_I2C_BUS, HAL_INS_L3G4200D_I2C_ADDR))); #elif HAL_INS_DEFAULT == HAL_INS_MPU9250_I2C diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h index b3a0519f36..1a8094b982 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h @@ -18,9 +18,9 @@ public: static AP_InertialSensor_Backend *probe(AP_InertialSensor &imu, AP_HAL::OwnPtr dev_gyro, AP_HAL::OwnPtr dev_accel, - enum Rotation rotation_a = ROTATION_NONE, - enum Rotation rotation_g = ROTATION_NONE, - enum Rotation rotation_gH = ROTATION_NONE); + enum Rotation rotation_a, + enum Rotation rotation_g, + enum Rotation rotation_gH); private: AP_InertialSensor_LSM9DS0(AP_InertialSensor &imu, diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS1.h b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS1.h index 6dea1c240f..f52859c1bb 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS1.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS1.h @@ -18,7 +18,7 @@ public: static AP_InertialSensor_Backend *probe(AP_InertialSensor &imu, AP_HAL::OwnPtr dev, - enum Rotation rotation = ROTATION_NONE); + enum Rotation rotation); private: AP_InertialSensor_LSM9DS1(AP_InertialSensor &imu, AP_HAL::OwnPtr dev,