Skip to content
Snippets Groups Projects
Commit 807d45c9 authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Lorenz Meier
Browse files

mc_pos_control slowing down close to target take over previous setpoint if low

parent ac3321dc
No related branches found
No related tags found
No related merge requests found
......@@ -1760,6 +1760,13 @@ void MulticopterPositionControl::control_auto(float dt)
/* make sure that vel_sp_along track is at least min */
vel_sp_along_track = (vel_sp_along_track < vel_close) ? vel_close : vel_sp_along_track;
/* if we are close to target and the previous velocity setpoints was smaller than
* vel_sp_along_track, then take over the previous one
* this ensures smoothness since we anyway want to slow down
*/
vel_sp_along_track = (vel_sp_along_track > vel_sp_along_track_prev) ?
vel_sp_along_track_prev : vel_sp_along_track;
} else {
/* we want to stop at current setpoint */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment