Skip to content

Commit

Permalink
Add stopping condition for terrain-based nav
Browse files Browse the repository at this point in the history
  • Loading branch information
elvout committed Apr 2, 2023
1 parent 0636856 commit 7366b6f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/navigation/navigation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,16 @@ bool Navigation::Run(const double& time,
if (kDebug) printf("TurnInPlace\n");
TurnInPlace(cmd_vel, cmd_angle_vel);
} else {
if (kDebug) printf("ObstAv\n");
RunObstacleAvoidance(cmd_vel, cmd_angle_vel);
if (local_target.norm() < params_.target_dist_tolerance) {
// Patch added for terrain-based navigation to stop the robot when it
// reaches the goal because the constant curvature arcs are not
// truncated to prevent progress away from the goal.
if (kDebug) printf("Halt (Terrain, Reached Goal)\n");
Halt(cmd_vel, cmd_angle_vel);
} else {
if (kDebug) printf("ObstAv\n");
RunObstacleAvoidance(cmd_vel, cmd_angle_vel);
}
}
}
} else if (nav_state_ == NavigationState::kTurnInPlace) {
Expand Down

0 comments on commit 7366b6f

Please sign in to comment.