Skip to content

Commit

Permalink
fix(behavior_velocity_crosswalk_module): check if p_safety_slow is em…
Browse files Browse the repository at this point in the history
…pty (autowarefoundation#6104)

* check if p_safety_slow is empty

Signed-off-by: beyza <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: beyza <[email protected]>
Co-authored-by: beyza <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and karishma1911 committed May 28, 2024
1 parent c831fcf commit e81a61c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,9 @@ void CrosswalkModule::applySafetySlowDownSpeed(
const auto & p_safety_slow =
calcLongitudinalOffsetPoint(ego_path.points, ego_pos, safety_slow_point_range);

insertDecelPointWithDebugInfo(p_safety_slow.value(), safety_slow_down_speed, output);
if (p_safety_slow.has_value()) {
insertDecelPointWithDebugInfo(p_safety_slow.value(), safety_slow_down_speed, output);
}

if (safety_slow_point_range < 0.0) {
passed_safety_slow_point_ = true;
Expand Down

0 comments on commit e81a61c

Please sign in to comment.