Skip to content

Commit

Permalink
fix(avoidance): don't insert stop point when the path is invalid
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed Mar 20, 2024
1 parent f3712af commit 6269912
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions planning/behavior_path_avoidance_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,11 @@ void AvoidanceModule::insertWaitPoint(
{
const auto & data = avoid_data_;

// If avoidance path is NOT valid, don't insert any stop points.
if (!data.valid) {
return;
}

if (!data.stop_target_object) {
return;
}
Expand Down Expand Up @@ -1614,6 +1619,16 @@ void AvoidanceModule::insertPrepareVelocity(ShiftedPath & shifted_path) const
{
const auto & data = avoid_data_;

// If avoidance path is NOT safe, don't insert any slow down sections.
if (!data.safe && !data.stop_target_object) {
return;
}

// If avoidance path is NOT safe, don't insert any slow down sections.
if (!data.valid) {
return;
}

// do nothing if there is no avoidance target.
if (data.target_objects.empty()) {
return;
Expand Down

0 comments on commit 6269912

Please sign in to comment.