@ -99,8 +99,10 @@ AC_WPNav::AC_WPNav(const AP_InertialNav* inav, const AP_AHRS* ahrs, AC_PosContro
@@ -99,8 +99,10 @@ AC_WPNav::AC_WPNav(const AP_InertialNav* inav, const AP_AHRS* ahrs, AC_PosContro
/// set_loiter_target in cm from home
void AC_WPNav : : set_loiter_target ( const Vector3f & position , bool reset_I )
{
// flag in case of loiter x_y I_term should not be reset => reset_I=false. default is true
_reset_I = reset_I ;
// if reset_I is false we warn position controller not to reset I terms
if ( ! reset_I ) {
_pos_control . keep_xy_I_terms ( ) ;
}
// set target position
_pos_control . set_pos_target ( position ) ;
@ -121,11 +123,8 @@ void AC_WPNav::set_loiter_target(const Vector3f& position, bool reset_I)
@@ -121,11 +123,8 @@ void AC_WPNav::set_loiter_target(const Vector3f& position, bool reset_I)
}
/// init_loiter_target - initialize's loiter position and feed-forward velocity from current pos and velocity
void AC_WPNav : : init_loiter_target ( bool reset_I )
void AC_WPNav : : init_loiter_target ( )
{
// flag in case of loiter x_y I_term should not be reset => reset_I=false. default is true
_reset_I = reset_I ;
Vector3f curr_vel = _inav - > get_velocity ( ) ;
// set target position
@ -256,7 +255,7 @@ void AC_WPNav::update_loiter()
@@ -256,7 +255,7 @@ void AC_WPNav::update_loiter()
_pos_control . trigger_xy ( ) ;
} else {
// run horizontal position controller
_pos_control . update_xy_controller ( true , _reset_I ) ;
_pos_control . update_xy_controller ( true ) ;
}
}