mavsdk_tests: add two new tests for VTOLs

- add functionality to specify world name for simulation in case name
- add test for triggering an airspeed invalidation in case of pitot blockage
- add test for high wind (ramped up wind over short period) to NOT invalidate airspeed in this case

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2023-11-09 09:42:43 +01:00
parent 29714a0fba
commit 5efcde7412
11 changed files with 246 additions and 7 deletions
+27
View File
@@ -164,6 +164,11 @@ void AutopilotTester::set_rc_loss_exception(AutopilotTester::RcLossException mas
}
}
void AutopilotTester::set_param_vt_fwd_thrust_en(int value)
{
CHECK(_param->set_param_int("VT_FWD_THRUST_EN", value) == Param::Result::Success);
}
void AutopilotTester::arm()
{
const auto result = _action->arm();
@@ -947,3 +952,25 @@ void AutopilotTester::report_speed_factor()
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
void AutopilotTester::enable_fixedwing_mectrics()
{
CHECK(getTelemetry()->set_rate_fixedwing_metrics(10.f) == Telemetry::Result::Success);
}
void AutopilotTester::check_airspeed_is_valid()
{
// If the airspeed was invalidated during the flight, the airspeed is sent in the
// telemetry is NAN and stays so with the default parameter settings.
const Telemetry::FixedwingMetrics &metrics = getTelemetry()->fixedwing_metrics();
REQUIRE(std::isfinite(metrics.airspeed_m_s));
}
void AutopilotTester::check_airspeed_is_invalid()
{
// If the airspeed was invalidated during the flight, the airspeed is sent in the
// telemetry is NAN and stays so with the default parameter settings.
const Telemetry::FixedwingMetrics &metrics = getTelemetry()->fixedwing_metrics();
std::cout << "Reported airspeed after failure: " << metrics.airspeed_m_s ;
REQUIRE(!std::isfinite(metrics.airspeed_m_s));
}