Skip to content

Commit

Permalink
incoperated review
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Chies committed Jul 10, 2024
1 parent f860aa1 commit 9d1844c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,19 +640,19 @@ State FlightTaskAuto::_getCurrentState()

State return_state = State::none;

if (u_prev_to_target.length() < FLT_EPSILON) {
if (!u_prev_to_target.longerThan(FLT_EPSILON)) {
// Previous and target are the same point, so we better don't try to do any special line following
return_state = State::none;

} else if (pos_to_target * pos_to_target < 0.0f) {
} else if (u_prev_to_target * pos_to_target < 0.0f) {
// Target is behind
return_state = State::target_behind;

} else if (u_prev_to_target * prev_to_pos < 0.0f && prev_to_pos.longerThan(_target_acceptance_radius)) {
// Previous is in front
return_state = State::previous_infront;

} else if (Vector3f(_position - _closest_pt).longerThan(_target_acceptance_radius)) {
} else if ((_position - _closest_pt).longerThan(_target_acceptance_radius)) {
// Vehicle too far from the track
return_state = State::offtrack;

Expand Down

0 comments on commit 9d1844c

Please sign in to comment.