autotest: factor out a setup_ICEngine_vehicle method for quadplane

This commit is contained in:
Peter Barker 2023-08-25 12:02:43 +10:00 committed by Peter Barker
parent dffeaf0897
commit 395f829f76

View File

@ -932,19 +932,24 @@ class AutoTestQuadPlane(AutoTest):
raise NotAchievedException("Changed throttle output on mode change to QHOVER") raise NotAchievedException("Changed throttle output on mode change to QHOVER")
self.disarm_vehicle() self.disarm_vehicle()
def ICEngine(self): def setup_ICEngine_vehicle(self, start_chan):
'''Test ICE Engine support''' '''restarts SITL with an IC Engine setup'''
rc_engine_start_chan = 11
self.set_parameters({ self.set_parameters({
'ICE_START_CHAN': rc_engine_start_chan, 'ICE_START_CHAN': start_chan,
}) })
model = "quadplane-ice"
model = "quadplane-ice"
self.customise_SITL_commandline( self.customise_SITL_commandline(
[], [],
model=model, model=model,
defaults_filepath=self.model_defaults_filepath(model), defaults_filepath=self.model_defaults_filepath(model),
wipe=False) wipe=False,
)
def ICEngine(self):
'''Test ICE Engine support'''
rc_engine_start_chan = 11
self.setup_ICEngine_vehicle(start_chan=rc_engine_start_chan)
self.wait_ready_to_arm() self.wait_ready_to_arm()
self.wait_rpm(1, 0, 0, minimum_duration=1) self.wait_rpm(1, 0, 0, minimum_duration=1)
@ -983,18 +988,8 @@ class AutoTestQuadPlane(AutoTest):
def ICEngineMission(self): def ICEngineMission(self):
'''Test ICE Engine Mission support''' '''Test ICE Engine Mission support'''
rc_engine_start_chan = 11 rc_engine_start_chan = 11
self.set_parameters({ self.setup_ICEngine_vehicle(start_chan=rc_engine_start_chan)
'ICE_START_CHAN': rc_engine_start_chan,
})
model = "quadplane-ice"
self.customise_SITL_commandline(
[],
model=model,
defaults_filepath=self.model_defaults_filepath(model),
wipe=False)
self.reboot_sitl()
self.load_mission("mission.txt") self.load_mission("mission.txt")
self.wait_ready_to_arm() self.wait_ready_to_arm()
self.set_rc(rc_engine_start_chan, 2000) self.set_rc(rc_engine_start_chan, 2000)