Commander: Adjust home position altitude after GNSS altitude correction (#25003)

Within the first 2min of a flight, check if the integrated GNSS vertical velocity and the baro
measurements disagree with the reported GNSS altitude, and in that case update the 
set home position altitude to cancel out GNSS altitude drift.

* prevent re-init when reaching negative altitudes

* only allow correction during the first 120 second after takeoff

* add dependency to COM_HOME_EN parameter. reset vel-integral for multiple takeoffs
This commit is contained in:
Marco Hauswirth
2025-06-18 13:26:45 +02:00
committed by GitHub
parent ef252481a8
commit 6604c52c98
4 changed files with 94 additions and 14 deletions
+1
View File
@@ -2110,6 +2110,7 @@ void Commander::landDetectorUpdate()
events::send(events::ID("commander_takeoff_detected"), events::Log::Info, "Takeoff detected");
_vehicle_status.takeoff_time = hrt_absolute_time();
_have_taken_off_since_arming = true;
_home_position.setTakeoffTime(_vehicle_status.takeoff_time);
}
// automatically set or update home position