mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 06:41:37 +08:00
FlightTask Auto: use yaw setpoint from Navigator if disable_weather_vane is true
When disable_weather_vane is true, the vehicle is aligning for the transition waypoint (VTOL) and thus the yaw setpoint from Navigator should be used. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Mathieu Bresciani
parent
a93052f9b2
commit
7a71cbb9bf
@@ -277,10 +277,12 @@ bool FlightTaskAuto::_evaluateTriplets()
|
|||||||
_yaw_setpoint = NAN;
|
_yaw_setpoint = NAN;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (_type != WaypointType::takeoff
|
if ((_type != WaypointType::takeoff || _sub_triplet_setpoint.get().current.disable_weather_vane)
|
||||||
&& _sub_triplet_setpoint.get().current.yaw_valid) {
|
&& _sub_triplet_setpoint.get().current.yaw_valid) {
|
||||||
// Use the yaw computed in Navigator except during takeoff because
|
// Use the yaw computed in Navigator except during takeoff because
|
||||||
// Navigator is not handling the yaw reset properly
|
// Navigator is not handling the yaw reset properly.
|
||||||
|
// But: use if from Navigator during takeoff if disable_weather_vane is true,
|
||||||
|
// because we're then aligning to the transition waypoint.
|
||||||
// TODO: fix in navigator
|
// TODO: fix in navigator
|
||||||
_yaw_setpoint = _sub_triplet_setpoint.get().current.yaw;
|
_yaw_setpoint = _sub_triplet_setpoint.get().current.yaw;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user