|
|
@ -167,6 +167,7 @@ bool AP_Mission::is_takeoff_next(uint16_t cmd_index) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
// any of these are considered "skippable" when determining if
|
|
|
|
// any of these are considered "skippable" when determining if
|
|
|
|
// we "start with a takeoff command"
|
|
|
|
// we "start with a takeoff command"
|
|
|
|
|
|
|
|
case MAV_CMD_DO_AUX_FUNCTION: |
|
|
|
case MAV_CMD_NAV_DELAY: |
|
|
|
case MAV_CMD_NAV_DELAY: |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
default: |
|
|
|
default: |
|
|
@ -338,6 +339,8 @@ bool AP_Mission::start_command(const Mission_Command& cmd) |
|
|
|
// check for landing related commands and set in_landing_sequence flag
|
|
|
|
// check for landing related commands and set in_landing_sequence flag
|
|
|
|
if (is_landing_type_cmd(cmd.id) || cmd.id == MAV_CMD_DO_LAND_START) { |
|
|
|
if (is_landing_type_cmd(cmd.id) || cmd.id == MAV_CMD_DO_LAND_START) { |
|
|
|
set_in_landing_sequence_flag(true); |
|
|
|
set_in_landing_sequence_flag(true); |
|
|
|
|
|
|
|
} else if (is_takeoff_type_cmd(cmd.id)) { |
|
|
|
|
|
|
|
set_in_landing_sequence_flag(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
gcs().send_text(MAV_SEVERITY_INFO, "Mission: %u %s", cmd.index, cmd.type()); |
|
|
|
gcs().send_text(MAV_SEVERITY_INFO, "Mission: %u %s", cmd.index, cmd.type()); |
|
|
@ -2318,6 +2321,18 @@ bool AP_Mission::is_landing_type_cmd(uint16_t id) const |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check if command is a takeoff type command.
|
|
|
|
|
|
|
|
bool AP_Mission::is_takeoff_type_cmd(uint16_t id) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (id) { |
|
|
|
|
|
|
|
case MAV_CMD_NAV_TAKEOFF: |
|
|
|
|
|
|
|
case MAV_CMD_NAV_VTOL_TAKEOFF: |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const char *AP_Mission::Mission_Command::type() const |
|
|
|
const char *AP_Mission::Mission_Command::type() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (id) { |
|
|
|
switch (id) { |
|
|
|