AutoLineSV: Always publish a valid yaw setpoint

In MPC_YAW_MODE 3 (along trajectory), the flight task is asked to
produce a yaw setpoint. If the previous yaw value was NAN (e.g.: during
early takeoff), the setpoint should then be reset to the current
estimate.
This commit is contained in:
bresch 2021-11-10 13:40:28 +01:00 committed by Daniel Agar
parent f751dd2242
commit 4a14a8bc7f
1 changed files with 1 additions and 1 deletions

View File

@ -688,7 +688,7 @@ void FlightTaskAuto::_generateHeading()
{
// Generate heading along trajectory if possible, otherwise hold the previous yaw setpoint
if (!_generateHeadingAlongTraj()) {
_yaw_setpoint = _yaw_sp_prev;
_yaw_setpoint = PX4_ISFINITE(_yaw_sp_prev) ? _yaw_sp_prev : _yaw;
}
}