Navigator: fix VTOL land waypoint calculation

The setpoint.yaw can be NAN, and this made the calculated land point NAN
as well. Looking at the current yaw is anyway a better way to approximate
the course over ground that fundamentally should be used.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2024-02-19 13:14:18 +01:00 committed by Matthias Grob
parent 1032dd3470
commit 8a75733511
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ Land::on_active()
// create a virtual wp 1m in front of the vehicle to track during the backtransition // create a virtual wp 1m in front of the vehicle to track during the backtransition
waypoint_from_heading_and_distance(_navigator->get_global_position()->lat, _navigator->get_global_position()->lon, waypoint_from_heading_and_distance(_navigator->get_global_position()->lat, _navigator->get_global_position()->lon,
_navigator->get_position_setpoint_triplet()->current.yaw, 1.f, _navigator->get_local_position()->heading, 1.f,
&pos_sp_triplet->current.lat, &pos_sp_triplet->current.lon); &pos_sp_triplet->current.lat, &pos_sp_triplet->current.lon);
_navigator->set_position_setpoint_triplet_updated(); _navigator->set_position_setpoint_triplet_updated();