Browse Source

Plane: use 4 degrees if zero takeoff pitch

mission-4.1.18
Andrew Tridgell 10 years ago
parent
commit
0cc165308d
  1. 4
      ArduPlane/commands_logic.cpp

4
ArduPlane/commands_logic.cpp

@ -320,6 +320,10 @@ void Plane::do_takeoff(const AP_Mission::Mission_Command& cmd) @@ -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;

Loading…
Cancel
Save