Rover: AP_Arming ensures mission items present when in auto mode

Co-authored-by: Henry Wurzburg <hwurzburg@yahoo.com>
This commit is contained in:
Peter Barker 2023-04-12 15:23:26 +10:00 committed by Peter Barker
parent 43c6bb3864
commit 941bb6a45b
2 changed files with 4 additions and 3 deletions

View File

@ -196,9 +196,6 @@ bool AP_Arming_Rover::mode_checks(bool report)
if (!rover.control_mode->allows_arming()) {
check_failed(report, "Mode not armable");
return false;
} else if (rover.control_mode == &rover.mode_auto && rover.mode_auto.mission.num_commands() <= 1) {
check_failed(report, "AUTO requires mission");
return false;
}
return true;
}

View File

@ -362,6 +362,10 @@ private:
bool set_mode(Mode &new_mode, ModeReason reason);
bool set_mode(const uint8_t new_mode, ModeReason reason) override;
uint8_t get_mode() const override { return (uint8_t)control_mode->mode_number(); }
bool current_mode_requires_mission() const override {
return control_mode == &mode_auto;
}
void startup_INS_ground(void);
void notify_mode(const Mode *new_mode);
uint8_t check_digital_pin(uint8_t pin);