mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 19:30:34 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user