mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 07:43:35 +08:00
mavsdk_tests: add tests for GPS as height source
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user