ArduCopter: allow Copter to emit MISSION_STATE_PAUSED when paused in auto

This commit is contained in:
Peter Barker 2023-04-19 16:53:38 +10:00 committed by Peter Barker
parent 15ec9f6f82
commit f33e5e7847
4 changed files with 16 additions and 0 deletions

View File

@ -579,6 +579,14 @@ const struct GCS_MAVLINK::stream_entries GCS_MAVLINK::all_stream_entries[] = {
MAV_STREAM_TERMINATOR // must have this at end of stream_entries MAV_STREAM_TERMINATOR // must have this at end of stream_entries
}; };
MISSION_STATE GCS_MAVLINK_Copter::mission_state(const class AP_Mission &mission) const
{
if (copter.mode_auto.paused()) {
return MISSION_STATE_PAUSED;
}
return GCS_MAVLINK::mission_state(mission);
}
bool GCS_MAVLINK_Copter::handle_guided_request(AP_Mission::Mission_Command &cmd) bool GCS_MAVLINK_Copter::handle_guided_request(AP_Mission::Mission_Command &cmd)
{ {
#if MODE_AUTO_ENABLED == ENABLED #if MODE_AUTO_ENABLED == ENABLED

View File

@ -55,6 +55,8 @@ protected:
private: private:
MISSION_STATE mission_state(const class AP_Mission &mission) const override;
void handleMessage(const mavlink_message_t &msg) override; void handleMessage(const mavlink_message_t &msg) override;
void handle_command_ack(const mavlink_message_t &msg) override; void handle_command_ack(const mavlink_message_t &msg) override;
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override; bool handle_guided_request(AP_Mission::Mission_Command &cmd) override;

View File

@ -462,6 +462,7 @@ public:
// pause continue in auto mode // pause continue in auto mode
bool pause() override; bool pause() override;
bool resume() override; bool resume() override;
bool paused() const;
bool loiter_start(); bool loiter_start();
void rtl_start(); void rtl_start();

View File

@ -2251,4 +2251,9 @@ bool ModeAuto::resume()
return true; return true;
} }
bool ModeAuto::paused() const
{
return wp_nav->paused();
}
#endif #endif