From 1d7670a98bb61bc026f33df41d4a63f78b63c8f7 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Fri, 8 Dec 2023 17:30:01 +0100 Subject: [PATCH] Navigator: same logic for VTOL_TAKEOFF as for TAKEOFF Set the setpoint type to POSITION if already in air, not to TAKEOFF. Signed-off-by: Silvan Fuhrer --- src/modules/navigator/mission_block.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/navigator/mission_block.cpp b/src/modules/navigator/mission_block.cpp index 6781b38bbdf4..40de1418e28a 100644 --- a/src/modules/navigator/mission_block.cpp +++ b/src/modules/navigator/mission_block.cpp @@ -694,6 +694,7 @@ MissionBlock::mission_item_to_position_setpoint(const mission_item_s &item, posi break; case NAV_CMD_TAKEOFF: + case NAV_CMD_VTOL_TAKEOFF: // if already flying (armed and !landed) treat TAKEOFF like regular POSITION if ((_navigator->get_vstatus()->arming_state == vehicle_status_s::ARMING_STATE_ARMED) @@ -707,10 +708,6 @@ MissionBlock::mission_item_to_position_setpoint(const mission_item_s &item, posi break; - case NAV_CMD_VTOL_TAKEOFF: - sp->type = position_setpoint_s::SETPOINT_TYPE_TAKEOFF; - break; - case NAV_CMD_LAND: case NAV_CMD_VTOL_LAND: sp->type = position_setpoint_s::SETPOINT_TYPE_LAND;