mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 15:33:34 +08:00
mavsdk_tests: consolidate level of abstraction
This moves the CHECK/REQUIRE inside of AutopilotTester.
This commit is contained in:
@@ -17,13 +17,12 @@ TEST_CASE("Takeoff and Land (Multicopter offboard)", "[multicopter_offboard]")
|
||||
Offboard::PositionNEDYaw takeoff_position {0.0f, 0.0f, -2.0f, 0.0f};
|
||||
tester.connect(connection_url);
|
||||
tester.wait_until_ready_local_position_only();
|
||||
tester.request_ground_truth();
|
||||
Telemetry::GroundTruth home = tester.get_ground_truth_position();
|
||||
tester.store_home();
|
||||
tester.arm();
|
||||
tester.offboard_goto(takeoff_position, 0.5f);
|
||||
tester.offboard_land();
|
||||
tester.wait_until_disarmed();
|
||||
REQUIRE(tester.ground_truth_horizontal_position_close_to(home, 0.5f));
|
||||
tester.check_home_within(0.5f);
|
||||
}
|
||||
|
||||
TEST_CASE("Mission (Multicopter offboard )", "[multicopter_offboard]")
|
||||
@@ -35,8 +34,7 @@ TEST_CASE("Mission (Multicopter offboard )", "[multicopter_offboard]")
|
||||
Offboard::PositionNEDYaw setpoint_3 {5.0f, 0.0f, -4.0f, 90.0f};
|
||||
tester.connect(connection_url);
|
||||
tester.wait_until_ready_local_position_only();
|
||||
tester.request_ground_truth();
|
||||
Telemetry::GroundTruth home = tester.get_ground_truth_position();
|
||||
tester.store_home();
|
||||
tester.arm();
|
||||
tester.offboard_goto(takeoff_position, 0.5f);
|
||||
tester.offboard_goto(setpoint_1, 1.0f);
|
||||
@@ -45,5 +43,5 @@ TEST_CASE("Mission (Multicopter offboard )", "[multicopter_offboard]")
|
||||
tester.offboard_goto(takeoff_position, 0.2f);
|
||||
tester.offboard_land();
|
||||
tester.wait_until_disarmed();
|
||||
REQUIRE(tester.ground_truth_horizontal_position_close_to(home, 1.0f));
|
||||
tester.check_home_within(1.0f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user