mc_pos_control: use desired velocity to calculate vel_sp_along_track_prev

if obstacle avoidance is running
This commit is contained in:
Martina
2018-04-06 15:38:16 +02:00
committed by Daniel Agar
parent d39b969e72
commit 8b20c66cfc
@@ -2021,6 +2021,10 @@ void MulticopterPositionControl::control_auto()
/* current velocity along track */
float vel_sp_along_track_prev = matrix::Vector2f(_vel_sp(0), _vel_sp(1)) * unit_prev_to_current;
if (use_obstacle_avoidance()) {
vel_sp_along_track_prev = matrix::Vector2f(&_vel_sp_desired(0)) * unit_prev_to_current;
}
/* distance to target when brake should occur */
float target_threshold_xy = 1.5f * get_cruising_speed_xy();