mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 09:30:35 +08:00
Fixed gyro com errors. Error check was triggering if board was not moved
This commit is contained in:
@@ -357,7 +357,7 @@ BMI088_gyro::measure()
|
||||
/*
|
||||
* Fetch the full set of measurements from the BMI088 gyro in one pass.
|
||||
*/
|
||||
bmi_gyroreport.cmd = BMI088_GYR_X_L | DIR_READ;
|
||||
bmi_gyroreport.cmd = BMI088_GYR_CHIP_ID | DIR_READ;
|
||||
|
||||
const hrt_abstime timestamp_sample = hrt_absolute_time();
|
||||
|
||||
@@ -371,20 +371,19 @@ BMI088_gyro::measure()
|
||||
// Get the last temperature from the accelerometer (the Gyro does not have its own temperature measurement)
|
||||
_last_temperature = _accel_last_temperature_copy;
|
||||
|
||||
|
||||
report.gyro_x = bmi_gyroreport.gyro_x;
|
||||
report.gyro_y = bmi_gyroreport.gyro_y;
|
||||
report.gyro_z = bmi_gyroreport.gyro_z;
|
||||
|
||||
if (report.gyro_x == 0 &&
|
||||
report.gyro_y == 0 &&
|
||||
report.gyro_z == 0) {
|
||||
if ((bmi_gyroreport.chip_id & 0x0f) != BMI088_GYR_WHO_AM_I) {
|
||||
// all zero data - probably an SPI bus error
|
||||
perf_count(_bad_transfers);
|
||||
perf_end(_sample_perf);
|
||||
// note that we don't call reset() here as a reset()
|
||||
// costs 20ms with interrupts disabled. That means if
|
||||
// the bmi088 does go bad it would cause a FMU failure,
|
||||
// regardless of whether another sensor is available,
|
||||
// // note that we don't call reset() here as a reset()
|
||||
// // costs 20ms with interrupts disabled. That means if
|
||||
// // the bmi088 does go bad it would cause a FMU failure,
|
||||
// // regardless of whether another sensor is available,
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ private:
|
||||
*/
|
||||
struct BMI_GyroReport {
|
||||
uint8_t cmd;
|
||||
uint16_t chip_id;
|
||||
int16_t gyro_x;
|
||||
int16_t gyro_y;
|
||||
int16_t gyro_z;
|
||||
|
||||
Reference in New Issue
Block a user