Skip to content

Commit

Permalink
Merge branch 'beta/v0.19.1' into chore/print-duplicate-node-name-v0.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
saka1-s authored Mar 7, 2024
2 parents aee6c8d + c5a5436 commit dbec73c
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions planning/behavior_velocity_planner/src/node.cpp
Original file line number Diff line number Diff line change
@@ -327,6 +327,8 @@ void BehaviorVelocityPlannerNode::onTrafficSignals(
{
std::lock_guard<std::mutex> lock(mutex_);

planner_data_.has_received_signal_ = true;

for (const auto & signal : msg->signals) {
TrafficSignalStamped traffic_signal;
traffic_signal.stamp = msg->stamp;
Original file line number Diff line number Diff line change
@@ -82,6 +82,9 @@ struct PlannerData
std::map<int, TrafficSignalTimeToRedStamped> traffic_light_time_to_red_id_map;
tier4_v2x_msgs::msg::VirtualTrafficLightStateArray::ConstSharedPtr virtual_traffic_light_states;

// this value becomes true once the signal message is received
bool has_received_signal_ = false;

// velocity smoother
std::shared_ptr<motion_velocity_smoother::SmootherBase> velocity_smoother_;
// route handler
13 changes: 11 additions & 2 deletions planning/behavior_velocity_traffic_light_module/src/scene.cpp
Original file line number Diff line number Diff line change
@@ -303,11 +303,20 @@ bool TrafficLightModule::isStopSignal()
{
updateTrafficSignal();

// If it never receives traffic signal, it will PASS.
if (!traffic_signal_stamp_) {
// Pass through if no traffic signal information has been received yet
// This is to prevent stopping on the planning simulator
if (!planner_data_->has_received_signal_) {
return false;
}

// Stop if there is no upcoming traffic signal information
// This is to safely stop in cases such that traffic light recognition is not working properly or
// the map is incorrect
if (!traffic_signal_stamp_) {
return true;
}

// Stop if the traffic signal information has timed out
if (isTrafficSignalTimedOut()) {
return true;
}

0 comments on commit dbec73c

Please sign in to comment.