forked from Archive/PX4-Autopilot
Fix SITL Test failure: Place PX4 instance runner after Gazebo server runner (#21230)
* MAVSDK_Test_Runner: Place PX4 instance runner after Gazebo server runner - This was a nasty bug where starting PX4 instance first, then starting Gazebo server was causing PX4 instance' EKF to freak out, probably because it doesn't like getting data a while after it is started - Detailed breakdown is given here: https://github.com/PX4/PX4-Autopilot/issues/21229#issuecomment-1450761542 - This now guarantees that such edge case won't occur and MAVSDK test will run as it should * MAVSDK Test Runner: Retain comment within 79 character limit - To pass flake8 python style check * Update test/mavsdk_tests/mavsdk_test_runner.py Co-authored-by: Julian Oes <julian@oes.ch> --------- Co-authored-by: Julian Oes <julian@oes.ch>
This commit is contained in:
parent
58a5aa26a0
commit
9c001f2e40
|
@ -401,17 +401,6 @@ class Tester:
|
|||
self.active_runners = []
|
||||
|
||||
if self.config['mode'] == 'sitl':
|
||||
px4_runner = ph.Px4Runner(
|
||||
os.getcwd(),
|
||||
log_dir,
|
||||
test['model'],
|
||||
case,
|
||||
self.get_max_speed_factor(test),
|
||||
self.debugger,
|
||||
self.verbose,
|
||||
self.build_dir)
|
||||
self.active_runners.append(px4_runner)
|
||||
|
||||
if self.config['simulator'] == 'gazebo':
|
||||
gzserver_runner = ph.GzserverRunner(
|
||||
os.getcwd(),
|
||||
|
@ -441,6 +430,22 @@ class Tester:
|
|||
self.verbose)
|
||||
self.active_runners.append(gzclient_runner)
|
||||
|
||||
# We must start the PX4 instance at the end, as starting
|
||||
# it in the beginning, then connecting Gazebo server freaks
|
||||
# out the PX4 (it needs to have data coming in when started),
|
||||
# and can lead to EKF to freak out, or the instance itself
|
||||
# to die unexpectedly.
|
||||
px4_runner = ph.Px4Runner(
|
||||
os.getcwd(),
|
||||
log_dir,
|
||||
test['model'],
|
||||
case,
|
||||
self.get_max_speed_factor(test),
|
||||
self.debugger,
|
||||
self.verbose,
|
||||
self.build_dir)
|
||||
self.active_runners.append(px4_runner)
|
||||
|
||||
mavsdk_tests_runner = ph.TestRunner(
|
||||
os.getcwd(),
|
||||
log_dir,
|
||||
|
|
Loading…
Reference in New Issue