From aaa4e64238b8b63342d8e45e1ca06f00ee2dd944 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Aug 2012 16:24:05 +1000 Subject: [PATCH] SITL: zero wind for first 15s this allows for airspeed calibration on startup --- libraries/Desktop/support/sitl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/Desktop/support/sitl.cpp b/libraries/Desktop/support/sitl.cpp index b28114139c..80900bfe12 100644 --- a/libraries/Desktop/support/sitl.cpp +++ b/libraries/Desktop/support/sitl.cpp @@ -214,6 +214,11 @@ static void sitl_simulator_output(void) control.direction = direction * 100; control.turbulance = sitl.wind_turbulance * 100; + // zero the wind for the first 15s to allow pitot calibration + if (millis() < 15000) { + control.speed = 0; + } + sendto(sitl_fd, (void*)&control, sizeof(control), MSG_DONTWAIT, (const sockaddr *)&rcout_addr, sizeof(rcout_addr)); }