mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 11:03:35 +08:00
mag_cal: fix mag bias estimate to mag cal
- since last_us is set to 0 every time the bias is not observable, the total time was also reset -> needed 30 consecutive seconds in mag 3D to be declared "stable" - after landing, the mag_aligned_in_flight flag is reset. Using this for bias validity makes it invalid before we have a chance to save it to the calibration.
This commit is contained in:
@@ -110,7 +110,7 @@ void Magnetometer::SensorCorrectionsUpdate(bool force)
|
||||
|
||||
bool Magnetometer::set_offset(const Vector3f &offset)
|
||||
{
|
||||
if (Vector3f(_offset - offset).longerThan(0.01f)) {
|
||||
if (Vector3f(_offset - offset).longerThan(0.005f)) {
|
||||
if (offset.isAllFinite()) {
|
||||
_offset = offset;
|
||||
_calibration_count++;
|
||||
|
||||
Reference in New Issue
Block a user