Skip to content

Commit

Permalink
feat(behavior_velocity_traffic_light): check if remaining time is ava…
Browse files Browse the repository at this point in the history
…ilable (#1178)

feat(behavior_velocity_traffic_light): don't use the time to red if it is unavailable

Signed-off-by: Tomohito Ando <[email protected]>
  • Loading branch information
TomohitoAndo authored Mar 8, 2024
1 parent eb15a2b commit ae7062f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions planning/behavior_velocity_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ void BehaviorVelocityPlannerNode::onTrafficSignalsRawV2I(
std::lock_guard<std::mutex> lock(mutex_);

for (const auto & car_light : msg->car_lights) {
// If the time to red is not available, skip it
if (!car_light.has_max_rest_time || !car_light.has_min_rest_time) {
continue;
}

for (const auto & state : car_light.states) {
TrafficSignalTimeToRedStamped time_to_red;
time_to_red.stamp = msg->header.stamp;
Expand Down

0 comments on commit ae7062f

Please sign in to comment.