Skip to content

Commit

Permalink
Yaw mode 3 - Add check for minimum distance to target in MPC_YAW_MODE…
Browse files Browse the repository at this point in the history
… 3 (along trajectory) to be consistent with the other yaw modes
  • Loading branch information
bresch authored and RomanBapst committed Aug 7, 2019
1 parent 119e5e3 commit 50fbb56
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ bool FlightTaskAutoLineSmoothVel::_generateHeadingAlongTraj()
{
bool res = false;
Vector2f vel_sp_xy(_velocity_setpoint);
Vector2f traj_to_target = Vector2f(_target) - Vector2f(_position);

if (vel_sp_xy.length() > .1f) {
if ((vel_sp_xy.length() > .1f) &&
(traj_to_target.length() > _target_acceptance_radius)) {
// Generate heading from velocity vector, only if it is long enough
// and if the drone is far enough from the target
_compute_heading_from_2D_vector(_yaw_setpoint, vel_sp_xy);
res = true;
}
Expand Down

0 comments on commit 50fbb56

Please sign in to comment.