Browse Source

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>
sbg
Silvan Fuhrer 5 years ago committed by Mathieu Bresciani
parent
commit
7a71cbb9bf
  1. 6
      src/lib/flight_tasks/tasks/Auto/FlightTaskAuto.cpp

6
src/lib/flight_tasks/tasks/Auto/FlightTaskAuto.cpp

@ -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;

Loading…
Cancel
Save