Skip to content

Commit

Permalink
I think this should fix it.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthall committed Oct 1, 2024
1 parent 11958e4 commit 8b24fa6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libraries/AC_AttitudeControl/AC_PosControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ void AC_PosControl::init_xy_controller_stopping_point()
{
init_xy_controller();

get_stopping_point_xy_cm(_pos_target.xy());
_pos_desired.xy() = _pos_target.xy() - _pos_offset.xy();
get_stopping_point_xy_cm(_pos_desired.xy());
_pos_target.xy() = _pos_desired.xy() + _pos_offset.xy();
_vel_desired.xy().zero();
_accel_desired.xy().zero();
}
Expand Down Expand Up @@ -796,7 +796,8 @@ void AC_PosControl::init_z_controller_stopping_point()
// Initialise the position controller to the current throttle, position, velocity and acceleration.
init_z_controller();

get_stopping_point_z_cm(_pos_target.z);
get_stopping_point_z_cm(_pos_desired.z);
_pos_target.z = _pos_desired.z + _pos_offset.z;
_vel_desired.z = 0.0f;
_accel_desired.z = 0.0f;
}
Expand Down

0 comments on commit 8b24fa6

Please sign in to comment.