Tools: autotest: add parachute tests

Tools: autotest: add test for triggering parachute via mavlink

Tools: autotest: add Copter mission test for parachute release

Tools: autotest: add Plane test for parachute deployment in auto
This commit is contained in:
Peter Barker 2019-02-01 10:11:25 +11:00 committed by Randy Mackay
parent ae03ccf2ba
commit a1aefaff27
4 changed files with 50 additions and 0 deletions

View File

@ -1640,6 +1640,29 @@ class AutoTestCopter(AutoTest):
self.set_parameter("SIM_PARA_ENABLE", 1) self.set_parameter("SIM_PARA_ENABLE", 1)
self.set_parameter("SIM_PARA_PIN", 9) self.set_parameter("SIM_PARA_PIN", 9)
self.progress("Test triggering parachute in mission")
self.load_mission("copter_parachute_mission.txt")
self.change_mode('LOITER')
self.wait_ready_to_arm()
self.arm_vehicle()
self.change_mode('AUTO')
self.set_rc(3, 1600)
self.mavproxy.expect('BANG')
self.reboot_sitl()
self.progress("Test triggering with mavlink message")
self.takeoff(20)
self.run_cmd(mavutil.mavlink.MAV_CMD_DO_PARACHUTE,
2, # release
0,
0,
0,
0,
0,
0)
self.mavproxy.expect('BANG')
self.reboot_sitl()
self.progress("Testing three-position switch") self.progress("Testing three-position switch")
self.set_parameter("RC9_OPTION", 23) # parachute 3pos self.set_parameter("RC9_OPTION", 23) # parachute 3pos

View File

@ -700,6 +700,22 @@ class AutoTestPlane(AutoTest):
if ex is not None: if ex is not None:
raise ex raise ex
def test_parachute(self):
self.set_rc(9, 1000)
self.set_parameter("CHUTE_ENABLED", 1)
self.set_parameter("CHUTE_TYPE", 10)
self.set_parameter("SERVO9_FUNCTION", 27)
self.set_parameter("SIM_PARA_ENABLE", 1)
self.set_parameter("SIM_PARA_PIN", 9)
self.load_mission("plane-parachute-mission.txt")
self.mavproxy.send("wp set 1\n")
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.arm_vehicle()
self.mavproxy.expect("BANG")
self.reboot_sitl()
def run_subtest(self, desc, func): def run_subtest(self, desc, func):
self.start_subtest(desc) self.start_subtest(desc)
func() func()
@ -772,6 +788,8 @@ class AutoTestPlane(AutoTest):
"Test Gripper mission items", "Test Gripper mission items",
self.test_gripper_mission), self.test_gripper_mission),
("Parachute", "Test Parachute", self.test_parachute),
("LogDownLoad", ("LogDownLoad",
"Log download", "Log download",
lambda: self.log_download( lambda: self.log_download(

View File

@ -0,0 +1,4 @@
QGC WPL 110
0 1 0 16 0.000000 0.000000 0.000000 0.000000 -35.362881 149.165222 582.000000 1
1 0 3 22 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 20.000000 1
2 0 0 208 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1

View File

@ -0,0 +1,5 @@
QGC WPL 110
0 0 0 16 0.000000 0.000000 0.000000 0.000000 -35.362045 149.165878 584.280029 1
1 0 3 22 0.000000 0.000000 0.000000 0.000000 -35.362125 149.165039 10.000000 1
2 0 3 16 0.000000 0.000000 0.000000 0.000000 -35.364845 149.163452 11.000000 1
3 0 0 208 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1