mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 12:23:33 +08:00
mavsdk_tests: update to MAVSDK 3.0.0
This commit is contained in:
@@ -103,7 +103,8 @@ void AutopilotTesterFigureEight::check_tracks_figure_eight(std::chrono::seconds
|
||||
order_to_fly = std::vector<int32_t> {0, 3, 2, 1, 0, 6, 5, 4, 0};
|
||||
}
|
||||
|
||||
getTelemetry()->subscribe_position_velocity_ned([&figure_eight_point_of_interest, &prom, corridor_radius_m,
|
||||
Telemetry::PositionVelocityNedHandle handle = getTelemetry()->subscribe_position_velocity_ned(
|
||||
[&figure_eight_point_of_interest, &prom, &handle, corridor_radius_m,
|
||||
&order_to_fly, this](Telemetry::PositionVelocityNed position_velocity_ned) {
|
||||
static size_t index{0};
|
||||
int32_t close_index{-1};
|
||||
@@ -129,14 +130,14 @@ void AutopilotTesterFigureEight::check_tracks_figure_eight(std::chrono::seconds
|
||||
} else { // reached an out of order point
|
||||
|
||||
if (index > 0U) { // only set to false if we already hve passed the first center point
|
||||
getTelemetry()->subscribe_position_velocity_ned(nullptr);
|
||||
getTelemetry()->unsubscribe_position_velocity_ned(handle);
|
||||
prom.set_value(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (index + 1 == order_to_fly.size()) {
|
||||
getTelemetry()->subscribe_position_velocity_ned(nullptr);
|
||||
getTelemetry()->unsubscribe_position_velocity_ned(handle);
|
||||
prom.set_value(true);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user