Skip to content

Commit

Permalink
autotest: add SmartRTL test for rapid switch between smartrtl and alt…
Browse files Browse the repository at this point in the history
…hold
  • Loading branch information
peterbarker committed Feb 29, 2024
1 parent 6a16cbf commit a380323
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9022,7 +9022,7 @@ def PositionWhenGPSIsZero(self):
self.wait_disarmed()
self.reboot_sitl()

def SMART_RTL(self):
def SMART_pathfollow_RTL(self):
'''Check SMART_RTL'''
self.progress("arm the vehicle and takeoff in Guided")
self.takeoff(20, mode='GUIDED')
Expand Down Expand Up @@ -9319,6 +9319,22 @@ def GPSForYaw(self):
self.print_exception_caught(e)
ex = e

def test_SMART_RTL_nopoints(self):
self.context_push()
ex = None
try:
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.change_mode('ALT_HOLD')
self.change_mode('SMART_RTL')
self.change_mode('ALT_HOLD')
self.change_mode('SMART_RTL')

except Exception as e:
self.print_exception_caught(e)
ex = e
self.disarm_vehicle(force=True)

self.context_pop()

self.reboot_sitl()
Expand Down Expand Up @@ -9367,6 +9383,11 @@ def AP_Avoidance(self):
self.disarm_vehicle()
self.context_pop()

def SMART_RTL(self):
'''Check SMART_RTL'''
self.test_SMART_RTL_nopoints()
self.test_SMART_RTL_pathfollow()

def PAUSE_CONTINUE(self):
'''Test MAV_CMD_DO_PAUSE_CONTINUE in AUTO mode'''
self.load_mission(filename="copter_mission.txt", strict=False)
Expand Down

0 comments on commit a380323

Please sign in to comment.