mavsdk_tests: add tests for GPS as height source

This commit is contained in:
Julian Oes
2020-09-16 12:51:56 -04:00
committed by Daniel Agar
parent c31246e13a
commit 20621e6744
3 changed files with 71 additions and 3 deletions
+12
View File
@@ -159,6 +159,18 @@ void AutopilotTester::set_takeoff_altitude(const float altitude_m)
CHECK(result.second == Approx(altitude_m));
}
void AutopilotTester::set_height_source(AutopilotTester::HeightSource height_source)
{
switch (height_source) {
case HeightSource::Baro:
CHECK(_param->set_param_int("EKF2_HGT_MODE", 0) == Param::Result::Success);
break;
case HeightSource::Gps:
CHECK(_param->set_param_int("EKF2_HGT_MODE", 1) == Param::Result::Success);
}
}
void AutopilotTester::arm()
{
const auto result = _action->arm();