mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
MAVSDK tests: Add minimal plane example
This will add coverage for baseline plane controllers.
This commit is contained in:
committed by
Daniel Agar
parent
5dfc8f1362
commit
b0cb29ed82
@@ -13,6 +13,7 @@ if(MAVSDK_FOUND)
|
|||||||
test_main.cpp
|
test_main.cpp
|
||||||
autopilot_tester.cpp
|
autopilot_tester.cpp
|
||||||
test_mission_multicopter.cpp
|
test_mission_multicopter.cpp
|
||||||
|
test_mission_plane.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(mavsdk_tests
|
target_link_libraries(mavsdk_tests
|
||||||
|
|||||||
@@ -14,12 +14,17 @@ test_matrix = [
|
|||||||
{
|
{
|
||||||
"model": "iris",
|
"model": "iris",
|
||||||
"test_filter": "[multicopter]",
|
"test_filter": "[multicopter]",
|
||||||
"timeout_min": 10,
|
"timeout_min": 20,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "standard_vtol",
|
"model": "standard_vtol",
|
||||||
"test_filter": "[vtol]",
|
"test_filter": "[vtol]",
|
||||||
"timeout_min": 10,
|
"timeout_min": 20,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "standard_plane",
|
||||||
|
"test_filter": "[plane]",
|
||||||
|
"timeout_min": 25,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "autopilot_tester.h"
|
#include "autopilot_tester.h"
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Takeoff and land", "[multicopter][vtol]")
|
TEST_CASE("Takeoff and Land (Multicopter)", "[multicopter][vtol]")
|
||||||
{
|
{
|
||||||
AutopilotTester tester;
|
AutopilotTester tester;
|
||||||
tester.connect(connection_url);
|
tester.connect(connection_url);
|
||||||
@@ -23,7 +23,7 @@ TEST_CASE("Takeoff and land", "[multicopter][vtol]")
|
|||||||
tester.wait_until_disarmed();
|
tester.wait_until_disarmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Fly square missions", "[multicopter][vtol]")
|
TEST_CASE("Fly square Multicopter Missions", "[multicopter][vtol]")
|
||||||
{
|
{
|
||||||
AutopilotTester tester;
|
AutopilotTester tester;
|
||||||
tester.connect(connection_url);
|
tester.connect(connection_url);
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// Multicopter mission test.
|
||||||
|
//
|
||||||
|
// Author: Julian Oes <julian@oes.ch>
|
||||||
|
|
||||||
|
#include <mavsdk/mavsdk.h>
|
||||||
|
#include <mavsdk/plugins/action/action.h>
|
||||||
|
#include <mavsdk/plugins/telemetry/telemetry.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include "autopilot_tester.h"
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE("Takeoff and land (Plane)", "[plane]")
|
||||||
|
{
|
||||||
|
AutopilotTester tester;
|
||||||
|
tester.connect(connection_url);
|
||||||
|
tester.wait_until_ready();
|
||||||
|
tester.arm();
|
||||||
|
tester.takeoff();
|
||||||
|
tester.wait_until_hovering();
|
||||||
|
tester.land();
|
||||||
|
tester.wait_until_disarmed();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user