Skip to content

Commit

Permalink
Navigator: same logic for VTOL_TAKEOFF as for TAKEOFF (#22518)
Browse files Browse the repository at this point in the history
Set the setpoint type to POSITION if already in air, not to TAKEOFF.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed Dec 11, 2023
1 parent ebae9ae commit 8aab3e8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/modules/navigator/mission_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 8aab3e8

Please sign in to comment.