Skip to content

Commit

Permalink
Navigator: fix VTOL land waypoint calculation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sfuhrer authored and MaEtUgR committed Feb 19, 2024
1 parent 1032dd3 commit 8a75733
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/navigator/land.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8a75733

Please sign in to comment.