Skip to content

Commit

Permalink
fix(intersection_occlusion): fix for PR6273 without traffic light (#6335
Browse files Browse the repository at this point in the history
)

Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin authored Feb 6, 2024
1 parent 7a53913 commit f7d386a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ IntersectionModule::getOcclusionStatus(

// ==========================================================================================
// for the convenience of Psim user, this module ignores occlusion if there has not been any
// information published for the associated traffic light, and only runs collision checking on
// that intersection lane.
// information published for the associated traffic light even if occlusion.enable is true,
// and only runs collision checking on that intersection lane.
//
// this is because Psim-users/scenario-files do not set traffic light information perfectly
// most of the times, and they just set bare minimum traffic information only for traffic lights
Expand All @@ -53,7 +53,7 @@ IntersectionModule::getOcclusionStatus(
// or in the simulation, then it should be kept in last_tl_valid_observation_ and this variable
// becomes false
// ==========================================================================================
const bool no_tl_info_ever = !last_tl_valid_observation_.has_value();
const bool no_tl_info_ever = (has_traffic_light_ && !last_tl_valid_observation_.has_value());
const bool is_amber_or_red_or_no_tl_info_ever =
(traffic_prioritized_level == TrafficPrioritizedLevel::PARTIALLY_PRIORITIZED) ||
(traffic_prioritized_level == TrafficPrioritizedLevel::FULLY_PRIORITIZED) || no_tl_info_ever;
Expand Down

0 comments on commit f7d386a

Please sign in to comment.