mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:36:48 +08:00
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:
@@ -688,7 +688,7 @@ void FlightTaskAuto::_generateHeading()
|
|||||||
{
|
{
|
||||||
// Generate heading along trajectory if possible, otherwise hold the previous yaw setpoint
|
// Generate heading along trajectory if possible, otherwise hold the previous yaw setpoint
|
||||||
if (!_generateHeadingAlongTraj()) {
|
if (!_generateHeadingAlongTraj()) {
|
||||||
_yaw_setpoint = _yaw_sp_prev;
|
_yaw_setpoint = PX4_ISFINITE(_yaw_sp_prev) ? _yaw_sp_prev : _yaw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user