File tree 3 files changed +16
-2
lines changed
behavior_velocity_planner/src
behavior_velocity_planner_common/include/behavior_velocity_planner_common
behavior_velocity_traffic_light_module/src
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,8 @@ void BehaviorVelocityPlannerNode::onTrafficSignals(
327
327
{
328
328
std::lock_guard<std::mutex> lock (mutex_);
329
329
330
+ planner_data_.has_received_signal_ = true ;
331
+
330
332
for (const auto & signal : msg->signals ) {
331
333
TrafficSignalStamped traffic_signal;
332
334
traffic_signal.stamp = msg->stamp ;
Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ struct PlannerData
82
82
std::map<int , TrafficSignalTimeToRedStamped> traffic_light_time_to_red_id_map;
83
83
tier4_v2x_msgs::msg::VirtualTrafficLightStateArray::ConstSharedPtr virtual_traffic_light_states;
84
84
85
+ // this value becomes true once the signal message is received
86
+ bool has_received_signal_ = false ;
87
+
85
88
// velocity smoother
86
89
std::shared_ptr<motion_velocity_smoother::SmootherBase> velocity_smoother_;
87
90
// route handler
Original file line number Diff line number Diff line change @@ -303,11 +303,20 @@ bool TrafficLightModule::isStopSignal()
303
303
{
304
304
updateTrafficSignal ();
305
305
306
- // If it never receives traffic signal, it will PASS.
307
- if (!traffic_signal_stamp_) {
306
+ // Pass through if no traffic signal information has been received yet
307
+ // This is to prevent stopping on the planning simulator
308
+ if (!planner_data_->has_received_signal_ ) {
308
309
return false ;
309
310
}
310
311
312
+ // Stop if there is no upcoming traffic signal information
313
+ // This is to safely stop in cases such that traffic light recognition is not working properly or
314
+ // the map is incorrect
315
+ if (!traffic_signal_stamp_) {
316
+ return true ;
317
+ }
318
+
319
+ // Stop if the traffic signal information has timed out
311
320
if (isTrafficSignalTimedOut ()) {
312
321
return true ;
313
322
}
You can’t perform that action at this time.
0 commit comments