Plane: fixed altitude for takeoff and takeoff heading

fixes for AP_Mission integration

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
This commit is contained in:
Andrew Tridgell 2014-03-07 14:15:20 +11:00 committed by Randy Mackay
parent eaf34bba9a
commit f036aa1780
2 changed files with 2 additions and 2 deletions

View File

@ -1123,7 +1123,7 @@ static void update_GPS_10Hz(void)
*/
static void handle_auto_mode(void)
{
switch(mission.get_current_do_cmd().id) {
switch(mission.get_current_nav_cmd().id) {
case MAV_CMD_NAV_TAKEOFF:
if (steer_state.hold_course_cd == -1) {
// we don't yet have a heading to hold - just level

View File

@ -273,7 +273,7 @@ static void do_takeoff(const AP_Mission::Mission_Command& cmd)
set_next_WP(cmd);
// pitch in deg, airspeed m/s, throttle %, track WP 1 or 0
takeoff_pitch_cd = (int)cmd.p1 * 100;
takeoff_altitude_cm = cmd.content.location.alt;
takeoff_altitude_cm = next_WP.content.location.alt;
next_WP.content.location.lat = home.lat + 10;
next_WP.content.location.lng = home.lng + 10;
takeoff_complete = false; // set flag to use gps ground course during TO. IMU will be doing yaw drift correction