Skip to content

Commit

Permalink
autotest: neaten Copter Loiter test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed May 21, 2024
1 parent f930ba7 commit 37886b3
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,48 +435,39 @@ def LoiterToAlt(self):

self.context_push()

ex = None
try:

self.set_parameters({
"PLND_ENABLED": 1,
"PLND_TYPE": 4,
})
self.set_parameters({
"PLND_ENABLED": 1,
"PLND_TYPE": 4,
})

self.set_analog_rangefinder_parameters()
self.set_analog_rangefinder_parameters()

self.reboot_sitl()
self.reboot_sitl()

num_wp = self.load_mission("copter_loiter_to_alt.txt")
num_wp = self.load_mission("copter_loiter_to_alt.txt")

self.change_mode('LOITER')
self.change_mode('LOITER')

self.install_terrain_handlers_context()
self.wait_ready_to_arm()
self.install_terrain_handlers_context()
self.wait_ready_to_arm()

self.arm_vehicle()
self.arm_vehicle()

self.change_mode('AUTO')
self.change_mode('AUTO')

self.set_rc(3, 1550)
self.set_rc(3, 1550)

self.wait_current_waypoint(2)
self.wait_current_waypoint(2)

self.set_rc(3, 1500)
self.set_rc(3, 1500)

self.wait_waypoint(0, num_wp-1, timeout=500)
self.wait_waypoint(0, num_wp-1, timeout=500)

self.wait_disarmed()
except Exception as e:
self.print_exception_caught(e)
ex = e
self.wait_disarmed()

self.context_pop()
self.reboot_sitl()

if ex is not None:
raise ex

# Tests all actions and logic behind the radio failsafe
def ThrottleFailsafe(self, side=60, timeout=360):
'''Test Throttle Failsafe'''
Expand Down

0 comments on commit 37886b3

Please sign in to comment.