enable gyro_calibration for CAN nodes

- allow saving initial gyro cal if very close to 0
This commit is contained in:
Daniel Agar
2022-06-17 15:12:27 -04:00
parent db4e09d529
commit 10deb7019e
7 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ void Gyroscope::SensorCorrectionsUpdate(bool force)
bool Gyroscope::set_offset(const Vector3f &offset)
{
if (Vector3f(_offset - offset).longerThan(0.01f)) {
if (Vector3f(_offset - offset).longerThan(0.01f) || (_calibration_count == 0)) {
if (PX4_ISFINITE(offset(0)) && PX4_ISFINITE(offset(1)) && PX4_ISFINITE(offset(2))) {
_offset = offset;
_calibration_count++;