AC_WPNav: recalc leash lengths if set_horizontal_velocity is called
Resolves bug in which do-set-speed allowed reducing the speed during the
mission but not increasing it.
Slow down distance is also recalculated.
Unnecessary call to calc_wp_leash_length removed from
set_spline_origin_and_destination.
/// update_wpnav - run the wp controller - should be called at 100hz or higher
/// update_wpnav - run the wp controller - should be called at 100hz or higher
voidupdate_wpnav();
voidupdate_wpnav();
// check_wp_leash_length - check recalc_wp_leash flag and calls calculate_wp_leash_length() if necessary
// should be called after _pos_control.update_xy_controller which may have changed the position controller leash lengths
voidcheck_wp_leash_length();
/// calculate_wp_leash_length - calculates track speed, acceleration and leash lengths for waypoint controller
/// calculate_wp_leash_length - calculates track speed, acceleration and leash lengths for waypoint controller
voidcalculate_wp_leash_length();
voidcalculate_wp_leash_length();
@ -202,6 +206,7 @@ protected:
uint8_treached_destination:1;// true if we have reached the destination
uint8_treached_destination:1;// true if we have reached the destination
uint8_tfast_waypoint:1;// true if we should ignore the waypoint radius and consider the waypoint complete once the intermediate target has reached the waypoint
uint8_tfast_waypoint:1;// true if we should ignore the waypoint radius and consider the waypoint complete once the intermediate target has reached the waypoint
uint8_tslowing_down:1;// true when target point is slowing down before reaching the destination
uint8_tslowing_down:1;// true when target point is slowing down before reaching the destination
uint8_trecalc_wp_leash:1;// true if we need to recalculate the leash lengths because of changes in speed or acceleration
SegmentTypesegment_type:1;// active segment is either straight or spline
SegmentTypesegment_type:1;// active segment is either straight or spline