Copter: RTL bug fix to initial step is always a climb and not a descent
Also bug fix to hold yaw on take-off
This commit is contained in:
parent
2dab40abeb
commit
ccaa7a52ef
@ -229,7 +229,7 @@ static void do_RTL(void)
|
|||||||
wp_control = LOITER_MODE;
|
wp_control = LOITER_MODE;
|
||||||
|
|
||||||
// initial climb starts at current location
|
// initial climb starts at current location
|
||||||
next_WP = current_loc;
|
set_next_WP(¤t_loc);
|
||||||
|
|
||||||
// override altitude to RTL altitude
|
// override altitude to RTL altitude
|
||||||
set_new_altitude(get_RTL_alt());
|
set_new_altitude(get_RTL_alt());
|
||||||
@ -250,11 +250,14 @@ static void do_takeoff()
|
|||||||
// alt is always relative
|
// alt is always relative
|
||||||
temp.alt = command_nav_queue.alt;
|
temp.alt = command_nav_queue.alt;
|
||||||
|
|
||||||
// prevent flips
|
|
||||||
reset_I_all();
|
|
||||||
|
|
||||||
// Set our waypoint
|
// Set our waypoint
|
||||||
set_next_WP(&temp);
|
set_next_WP(&temp);
|
||||||
|
|
||||||
|
// set our yaw mode
|
||||||
|
set_yaw_mode(YAW_HOLD);
|
||||||
|
|
||||||
|
// prevent flips
|
||||||
|
reset_I_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
// do_nav_wp - initiate move to next waypoint
|
// do_nav_wp - initiate move to next waypoint
|
||||||
@ -476,7 +479,7 @@ static bool verify_RTL()
|
|||||||
|
|
||||||
case RTL_STATE_INITIAL_CLIMB:
|
case RTL_STATE_INITIAL_CLIMB:
|
||||||
// rely on verify_altitude function to update alt_change_flag when we've reached the target
|
// rely on verify_altitude function to update alt_change_flag when we've reached the target
|
||||||
if(alt_change_flag == REACHED_ALT) {
|
if(alt_change_flag == REACHED_ALT || alt_change_flag == DESCENDING) {
|
||||||
// Set navigation target to home
|
// Set navigation target to home
|
||||||
set_next_WP(&home);
|
set_next_WP(&home);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user