Skip to content

Commit e81a61c

Browse files
beyzanurkayabeyzapre-commit-ci[bot]
authored andcommitted
fix(behavior_velocity_crosswalk_module): check if p_safety_slow is empty (#6104)
* check if p_safety_slow is empty Signed-off-by: beyza <bnk@leodrive.ai> * style(pre-commit): autofix --------- Signed-off-by: beyza <bnk@leodrive.ai> Co-authored-by: beyza <bnk@leodrive.ai> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c831fcf commit e81a61c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

planning/behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,9 @@ void CrosswalkModule::applySafetySlowDownSpeed(
813813
const auto & p_safety_slow =
814814
calcLongitudinalOffsetPoint(ego_path.points, ego_pos, safety_slow_point_range);
815815

816-
insertDecelPointWithDebugInfo(p_safety_slow.value(), safety_slow_down_speed, output);
816+
if (p_safety_slow.has_value()) {
817+
insertDecelPointWithDebugInfo(p_safety_slow.value(), safety_slow_down_speed, output);
818+
}
817819

818820
if (safety_slow_point_range < 0.0) {
819821
passed_safety_slow_point_ = true;

0 commit comments

Comments
 (0)