diff --git a/example/offboard_velocity/offboard_velocity.cpp b/example/offboard_velocity/offboard_velocity.cpp index e65f9f7c7f..aaf10f3078 100644 --- a/example/offboard_velocity/offboard_velocity.cpp +++ b/example/offboard_velocity/offboard_velocity.cpp @@ -237,9 +237,16 @@ int main(int argc, char **argv) const Action::Result land_result = action->land(); action_error_exit(land_result, "Landing failed"); + // Check if vehicle is still in air + while (telemetry->in_air()) { + std::cout << "Vehicle is landing..." << std::endl; + sleep_for(seconds(1)); + } + std::cout << "Landed!" << std::endl; + // We are relying on auto-disarming but let's keep watching the telemetry for a bit longer. - sleep_for(seconds(10)); - std::cout << "Landed" << std::endl; + sleep_for(seconds(3)); + std::cout << "Finished..." << std::endl; return EXIT_SUCCESS; } diff --git a/example/takeoff_land/takeoff_and_land.cpp b/example/takeoff_land/takeoff_and_land.cpp index ad7ef3b89f..848691f62e 100644 --- a/example/takeoff_land/takeoff_and_land.cpp +++ b/example/takeoff_land/takeoff_and_land.cpp @@ -139,8 +139,16 @@ int main(int argc, char **argv) return 1; } + // Check if vehicle is still in air + while (telemetry->in_air()) { + std::cout << "Vehicle is landing..." << std::endl; + sleep_for(seconds(1)); + } + std::cout << "Landed!" << std::endl; + // We are relying on auto-disarming but let's keep watching the telemetry for a bit longer. - sleep_for(seconds(5)); + sleep_for(seconds(3)); std::cout << "Finished..." << std::endl; + return 0; }