From 511c663996b56b4f3cbe7f9d92c0c20213c2499a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 28 Dec 2015 15:14:40 +0100 Subject: [PATCH] Takeoff: Set home yaw if executed as flight mode command. --- src/modules/navigator/takeoff.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/navigator/takeoff.cpp b/src/modules/navigator/takeoff.cpp index f669429449..5ea96f8b3f 100644 --- a/src/modules/navigator/takeoff.cpp +++ b/src/modules/navigator/takeoff.cpp @@ -81,6 +81,8 @@ Takeoff::on_activation() pos_sp_triplet->previous.valid = false; mission_item_to_position_setpoint(&_mission_item, &pos_sp_triplet->current); pos_sp_triplet->current.type = position_setpoint_s::SETPOINT_TYPE_LOITER; + pos_sp_triplet->current.yaw = _navigator->get_home_position()->yaw; + pos_sp_triplet->current.yaw_valid = true; pos_sp_triplet->next.valid = false; _navigator->set_can_loiter_at_sp(pos_sp_triplet->current.type == position_setpoint_s::SETPOINT_TYPE_LOITER);