Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autotest: neaten Copter Loiter test #27113

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading