mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 22:58:10 +08:00
FlightTaskAuto: fix yaw reset issue during takeoff
During takeoff, Navigator is sending a constant yaw value. However, there is always a reset at 1.5m of the yaw estimate in EKF2 that is not handled by Navigator that produces a glitch in the rate controller. Given that in FlightTask, the yaw is already computed and properly corrected in case of an estimator reset event, we just ignore the yaw value sent by navigator during takeoff.
This commit is contained in:
committed by
Mathieu Bresciani
parent
8020d6407f
commit
67ae40e922
@@ -277,7 +277,11 @@ bool FlightTaskAuto::_evaluateTriplets()
|
||||
_yaw_setpoint = NAN;
|
||||
|
||||
} else {
|
||||
if (_sub_triplet_setpoint.get().current.yaw_valid) {
|
||||
if (_type != WaypointType::takeoff
|
||||
&& _sub_triplet_setpoint.get().current.yaw_valid) {
|
||||
// Use the yaw computed in Navigator except during takeoff because
|
||||
// Navigator is not handling the yaw reset properly
|
||||
// TODO: fix in navigator
|
||||
_yaw_setpoint = _sub_triplet_setpoint.get().current.yaw;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user