Skip to content

Commit

Permalink
FWPositionControl: navigateWaypoints: remove check for switchDistance…
Browse files Browse the repository at this point in the history
… acceptance if behind/in front of waypoints

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed May 24, 2023
1 parent 2ad4308 commit 12be8ce
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/modules/fw_pos_control/FixedwingPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2865,16 +2865,12 @@ void FixedwingPositionControl::navigateWaypoints(const Vector2f &waypoint_A, con
}

} else if ((vector_A_to_B.dot(vector_A_to_vehicle) < -FLT_EPSILON)) {
// we are in front of waypoint A, fly directly to it until we are within switch distance.
if (vector_A_to_vehicle.norm() > _npfg.switchDistance(500.0f)) {
path_tangent = -vector_A_to_vehicle;
}
// we are in front of waypoint A, fly directly to it
path_tangent = -vector_A_to_vehicle;

} else if (vector_B_to_A.dot(vector_B_to_vehicle) < -FLT_EPSILON) {
// we are behind waypoint B, fly directly to it until we are within switch distance.
if (vector_B_to_vehicle.norm() > _npfg.switchDistance(500.0f)) {
path_tangent = -vector_B_to_vehicle;
}
// we are behind waypoint B, fly directly to it
path_tangent = -vector_B_to_vehicle;
}

// track the line segment
Expand Down

0 comments on commit 12be8ce

Please sign in to comment.