mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 00:30:50 +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:
1 parent
f751dd2242
commit
4a14a8bc7f
1 file changed
+1
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user