Skip to content

Commit

Permalink
AC_AttitudeControl: implement suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bnsgeyer committed May 14, 2024
1 parent d1fb594 commit 27b3cfe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libraries/AC_AttitudeControl/AC_PosControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,7 @@ void AC_PosControl::update_xy_controller()

const Vector3f &curr_pos = _inav.get_position_neu_cm();
Vector3f comb_pos = curr_pos;
comb_pos.x += _disturb_pos.x;
comb_pos.y += _disturb_pos.y;
comb_pos.xy() += _disturb_pos;
Vector2f vel_target = _p_pos_xy.update_all(_pos_target.x, _pos_target.y, comb_pos);

// add velocity feed-forward scaled to compensate for optical flow measurement induced EKF noise
Expand All @@ -657,8 +656,7 @@ void AC_PosControl::update_xy_controller()

const Vector2f &curr_vel = _inav.get_velocity_xy_cms();
Vector2f comb_vel = curr_vel;
comb_vel.x += _disturb_vel.x;
comb_vel.y += _disturb_vel.y;
comb_vel += _disturb_vel;
Vector2f accel_target = _pid_vel_xy.update_all(_vel_target.xy(), comb_vel, _dt, _limit_vector.xy());

// acceleration to correct for velocity error and scale PID output to compensate for optical flow measurement induced EKF noise
Expand Down

0 comments on commit 27b3cfe

Please sign in to comment.