Skip to content

Commit

Permalink
mc_pos_control: use normal slewrate when posiiton control enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Stifael committed Mar 27, 2017
1 parent c9a4dcf commit e73eec7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/mc_pos_control/mc_pos_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,11 +1374,11 @@ MulticopterPositionControl::vel_sp_slewrate(float dt)

float acc_limit = _acceleration_hor_max.get();

/* deceleration but no direction change */
bool slow_deceleration = ((acc_xy * vel_xy) < 0.0f) && ((vel_sp_xy * vel_xy) > 0.0f);
/* deceleration but no direction change and not position control*/
bool slow_deceleration = ((acc_xy * vel_xy) < 0.0f) && ((vel_sp_xy * vel_xy) > 0.0f) && !_run_pos_control;

/* deceleration with direction change */
bool fast_deceleration = ((acc_xy * vel_xy) < 0.0f) && ((vel_sp_xy * vel_xy) <= 0.0f);
/* deceleration with direction change and not position control*/
bool fast_deceleration = ((acc_xy * vel_xy) < 0.0f) && ((vel_sp_xy * vel_xy) <= 0.0f) && !_run_pos_control;

if (slow_deceleration) {
acc_limit = _deceleration_hor_slow.get();
Expand Down

0 comments on commit e73eec7

Please sign in to comment.