From 75bb25a44c5aca01b749b45b132022133c2989ee Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 12 Dec 2023 18:09:45 +0100 Subject: [PATCH] test_vtol_figure_eight: fix altitude check wait_until_altitude() checks for absolute altitude being close so checking for 1m below the setpoint can fail if the speedup results in no sample inside the altitude window being checked. Ideally the test could check if the takeoff is done directly instead of comparing altitudes in the first place. --- test/mavsdk_tests/test_vtol_figure_eight.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/mavsdk_tests/test_vtol_figure_eight.cpp b/test/mavsdk_tests/test_vtol_figure_eight.cpp index cd4e061ec4..4c9e01e4b3 100644 --- a/test/mavsdk_tests/test_vtol_figure_eight.cpp +++ b/test/mavsdk_tests/test_vtol_figure_eight.cpp @@ -48,7 +48,7 @@ TEST_CASE("Figure eight execution clockwise", "[vtol]") tester.arm(); tester.takeoff(); tester.wait_until_hovering(); - tester.wait_until_altitude(takeoff_altitude - 1.f, std::chrono::seconds(60)); + tester.wait_until_altitude(takeoff_altitude, std::chrono::seconds(30)); tester.transition_to_fixedwing(); tester.wait_until_fixedwing(std::chrono::seconds(5)); std::this_thread::sleep_for(std::chrono::seconds(1)); @@ -71,7 +71,7 @@ TEST_CASE("Figure eight execution counterclockwise", "[vtol]") tester.arm(); tester.takeoff(); tester.wait_until_hovering(); - tester.wait_until_altitude(takeoff_altitude - 1.f, std::chrono::seconds(60)); + tester.wait_until_altitude(takeoff_altitude, std::chrono::seconds(30)); tester.transition_to_fixedwing(); tester.wait_until_fixedwing(std::chrono::seconds(5)); std::this_thread::sleep_for(std::chrono::seconds(1));