Copter: remove check on pause state

This commit is contained in:
CharlieBurge 2023-03-08 18:24:25 +00:00 committed by Peter Hall
parent 224e7c578f
commit 62119d5bbe
2 changed files with 4 additions and 12 deletions

View File

@ -2236,26 +2236,18 @@ bool ModeAuto::verify_nav_attitude_time(const AP_Mission::Mission_Command& cmd)
bool ModeAuto::pause()
{
// do not pause if not in the WP sub mode or already reached to the destination
if(_mode != SubMode::WP || wp_nav->reached_wp_destination()) {
if (_mode != SubMode::WP || wp_nav->reached_wp_destination()) {
return false;
}
// do not pause if already paused
if (!wp_nav->paused()) {
wp_nav->set_pause();
}
wp_nav->set_pause();
return true;
}
// resume - Allow aircraft to progress along the track
bool ModeAuto::resume()
{
// do not resume if not paused before
if(wp_nav->paused()) {
wp_nav->set_resume();
}
wp_nav->set_resume();
return true;
}

View File

@ -8851,7 +8851,7 @@ class AutoTestCopter(AutoTest):
self.send_pause_command()
self.wait_groundspeed(speed_min=0, speed_max=1, minimum_duration=5)
self.send_resume_command()
# sending a pause, or resume, to the aircraft twice, doesn't result in reporting a failure
self.wait_current_waypoint(wpnum=5, timeout=500)
self.send_pause_command()