mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Tools: autotest: add test for throw mode
This commit is contained in:
parent
4db011f530
commit
e045f61473
@ -2698,6 +2698,29 @@ class AutoTestCopter(AutoTest):
|
|||||||
if ex is not None:
|
if ex is not None:
|
||||||
raise ex
|
raise ex
|
||||||
|
|
||||||
|
def fly_throw_mode(self):
|
||||||
|
# test boomerang mode:
|
||||||
|
self.progress("Throwing vehicle away")
|
||||||
|
self.set_parameter("THROW_NEXTMODE", 6)
|
||||||
|
self.set_parameter("SIM_SHOVE_Z", -30)
|
||||||
|
self.set_parameter("SIM_SHOVE_X", -20)
|
||||||
|
self.change_mode('THROW')
|
||||||
|
self.wait_ready_to_arm()
|
||||||
|
self.arm_vehicle()
|
||||||
|
self.set_parameter("SIM_SHOVE_TIME", 500)
|
||||||
|
tstart = self.get_sim_time()
|
||||||
|
self.wait_mode('RTL')
|
||||||
|
max_good_tdelta = 5
|
||||||
|
tdelta = self.get_sim_time() - tstart
|
||||||
|
self.progress("Vehicle in RTL")
|
||||||
|
self.mav.motors_disarmed_wait()
|
||||||
|
self.progress("Vehicle disarmed")
|
||||||
|
if tdelta > max_good_tdelta:
|
||||||
|
self.progress("Took too long to enter RTL: %u > %u" %
|
||||||
|
(tdelta, max_good_tdelta))
|
||||||
|
raise NotAchievedException()
|
||||||
|
self.progress("Vehicle returned")
|
||||||
|
|
||||||
def fly_precision_companion(self):
|
def fly_precision_companion(self):
|
||||||
"""Use Companion PrecLand backend precision messages to loiter."""
|
"""Use Companion PrecLand backend precision messages to loiter."""
|
||||||
|
|
||||||
@ -2850,6 +2873,8 @@ class AutoTestCopter(AutoTest):
|
|||||||
|
|
||||||
("AutoTune", "Fly AUTOTUNE mode", self.fly_autotune),
|
("AutoTune", "Fly AUTOTUNE mode", self.fly_autotune),
|
||||||
|
|
||||||
|
("ThrowMode", "Fly Throw Mode", self.fly_throw_mode),
|
||||||
|
|
||||||
("RecordThenPlayMission",
|
("RecordThenPlayMission",
|
||||||
"Use switches to toggle in mission, then fly it",
|
"Use switches to toggle in mission, then fly it",
|
||||||
self.fly_square),
|
self.fly_square),
|
||||||
|
Loading…
Reference in New Issue
Block a user