From 33998a58acee5d7a6d62c23e877ab3df9c0154d5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 1 Jan 2016 17:01:23 +1100 Subject: [PATCH] SITL: prevent aircraft going below ground level --- libraries/SITL/SIM_Aircraft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index c56c5b1b8b..e07f38062b 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -361,8 +361,8 @@ void Aircraft::update_dynamics(const Vector3f &rot_accel) if (on_ground(position)) { if (!on_ground(old_position)) { printf("Hit ground at %f m/s\n", velocity_ef.z); - position.z = -(ground_level + frame_height - home.alt*0.01f); } + position.z = -(ground_level + frame_height - home.alt*0.01f); } }