Skip to content

Commit

Permalink
Navigator: mission_block: reduce enforce eexit course margin to 105% (P…
Browse files Browse the repository at this point in the history
…X4#22511)

With this margin it is made sure that if the loiter is not perfectly tracked,
(vehicle outside of path setpoint) a wp just at the border of the loiter
is still reachable.
It should though be as small as necessary, as otherwise, with good
loiter tracking,  waypoints that are close but not right on the loiter
radius are not enforcing the exit course neither.

Signed-off-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
sfuhrer authored Dec 21, 2023
1 parent 7e22b47 commit 6be8cbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/navigator/mission_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ MissionBlock::is_mission_item_reached_or_completed()
&& curr_sp_new->type == position_setpoint_s::SETPOINT_TYPE_LOITER
&& (_mission_item.force_heading || _mission_item.nav_cmd == NAV_CMD_WAYPOINT);

// can only enforce exit course if next waypoint is not within loiter radius of current waypoint
const bool exit_course_is_reachable = dist_current_next > 1.2f * curr_sp_new->loiter_radius;
// can only enforce exit course if next waypoint is not within loiter radius of current waypoint (with small margin)
const bool exit_course_is_reachable = dist_current_next > 1.05f * curr_sp_new->loiter_radius;

if (enforce_exit_course && exit_course_is_reachable) {

Expand Down

0 comments on commit 6be8cbe

Please sign in to comment.