mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 11:33:34 +08:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user