sensors (accel/gyro/mag) determine if external with device id

This commit is contained in:
Daniel Agar
2022-01-10 10:31:07 -05:00
committed by GitHub
parent 45040be669
commit e731fcdbc0
36 changed files with 187 additions and 205 deletions
@@ -535,8 +535,6 @@ bool ADIS16448::Configure()
_px4_accel.set_range(18.f * CONSTANTS_ONE_G);
_px4_gyro.set_range(math::radians(1000.f));
_px4_mag.set_external(external());
return success;
}
@@ -51,7 +51,6 @@ ICM20948_AK09916::ICM20948_AK09916(ICM20948 &icm20948, enum Rotation rotation) :
_px4_mag(icm20948.get_device_id(), rotation)
{
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_AK09916);
_px4_mag.set_external(icm20948.external());
// mag resolution is 1.5 milli Gauss per bit (0.15 μT/LSB)
_px4_mag.set_scale(1.5e-3f);
@@ -51,7 +51,6 @@ MPU9250_AK8963::MPU9250_AK8963(MPU9250 &mpu9250, enum Rotation rotation) :
_px4_mag(mpu9250.get_device_id(), rotation)
{
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_AK8963);
_px4_mag.set_external(mpu9250.external());
// in 16-bit sampling mode the mag resolution is 1.5 milli Gauss per bit */
_px4_mag.set_scale(1.5e-3f);
-2
View File
@@ -64,7 +64,6 @@ LSM303D::LSM303D(const I2CSPIDriverConfig &config) :
_bad_values(perf_alloc(PC_COUNT, "lsm303d: bad_val")),
_accel_duplicates(perf_alloc(PC_COUNT, "lsm303d: acc_dupe"))
{
_px4_mag.set_external(external());
}
LSM303D::~LSM303D()
@@ -558,7 +557,6 @@ LSM303D::measureMagnetometer()
_px4_mag.set_temperature(_last_temperature);
_px4_mag.set_error_count(perf_event_count(_bad_registers) + perf_event_count(_bad_values));
_px4_mag.set_external(external());
_px4_mag.update(timestamp_sample, raw_mag_report.x, raw_mag_report.y, raw_mag_report.z);
_mag_last_measure = timestamp_sample;