From 0cc165308de6544e3b1f5f383bad2a998099f371 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Sep 2015 09:13:12 +1000 Subject: [PATCH] Plane: use 4 degrees if zero takeoff pitch --- ArduPlane/commands_logic.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArduPlane/commands_logic.cpp b/ArduPlane/commands_logic.cpp index cad18cffe8..7762e9cb7a 100644 --- a/ArduPlane/commands_logic.cpp +++ b/ArduPlane/commands_logic.cpp @@ -320,6 +320,10 @@ void Plane::do_takeoff(const AP_Mission::Mission_Command& cmd) set_next_WP(cmd.content.location); // pitch in deg, airspeed m/s, throttle %, track WP 1 or 0 auto_state.takeoff_pitch_cd = (int16_t)cmd.p1 * 100; + if (auto_state.takeoff_pitch_cd <= 0) { + // if the mission doesn't specify a pitch use 4 degrees + auto_state.takeoff_pitch_cd = 400; + } auto_state.takeoff_altitude_rel_cm = next_WP_loc.alt - home.alt; next_WP_loc.lat = home.lat + 10; next_WP_loc.lng = home.lng + 10;