mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
AP_InertialSensor: correction to AP_InertialSensor_VRBRAIN
This commit is contained in:
parent
92e0bc3a2f
commit
731329fc55
@ -104,14 +104,22 @@ bool AP_InertialSensor_VRBRAIN::update(void)
|
||||
|
||||
for (uint8_t k=0; k<_num_accel_instances; k++) {
|
||||
Vector3f accel = _accel_in[k];
|
||||
_rotate_and_offset_accel(_accel_instance[k], accel);
|
||||
_last_accel_update_timestamp[k] = _last_accel_timestamp[k];
|
||||
// calling _rotate_and_offset_accel sets the sensor healthy,
|
||||
// so we only want to do this if we have new data from it
|
||||
if (_last_accel_timestamp[k] != _last_accel_update_timestamp[k]) {
|
||||
_rotate_and_offset_accel(_accel_instance[k], accel);
|
||||
_last_accel_update_timestamp[k] = _last_accel_timestamp[k];
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8_t k=0; k<_num_gyro_instances; k++) {
|
||||
Vector3f gyro = _gyro_in[k];
|
||||
_rotate_and_offset_gyro(_gyro_instance[k], gyro);
|
||||
_last_gyro_update_timestamp[k] = _last_gyro_timestamp[k];
|
||||
// calling _rotate_and_offset_accel sets the sensor healthy,
|
||||
// so we only want to do this if we have new data from it
|
||||
if (_last_gyro_timestamp[k] != _last_gyro_update_timestamp[k]) {
|
||||
_rotate_and_offset_gyro(_gyro_instance[k], gyro);
|
||||
_last_gyro_update_timestamp[k] = _last_gyro_timestamp[k];
|
||||
}
|
||||
}
|
||||
|
||||
if (_last_filter_hz != _imu.get_filter()) {
|
||||
|
Loading…
Reference in New Issue
Block a user