From 8a7573351182bcc7181bb0377e35f62b2ad267ff Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 19 Feb 2024 13:14:18 +0100 Subject: [PATCH] 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 --- src/modules/navigator/land.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/navigator/land.cpp b/src/modules/navigator/land.cpp index ad242d10a350..b6a951d1b766 100644 --- a/src/modules/navigator/land.cpp +++ b/src/modules/navigator/land.cpp @@ -83,7 +83,7 @@ Land::on_active() // 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, - _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); _navigator->set_position_setpoint_triplet_updated();