92 {
93 ADEBUG <<
"Received SendV2xTrafficLight request from client!";
94 ADEBUG << request->DebugString();
95
96 int num_current_light = request->road_traffic_light_size();
97
98 if (0 == num_current_light) {
99 response->set_status(false);
100 response->set_info("error v2x current lane traffic light size == 0");
101 AERROR <<
"SendV2xTrafficLight request no current lane traffic light.";
102 return Status::CANCELLED;
103 }
104 if (!request->has_header()) {
105 response->set_status(false);
106 response->set_info(
107 "error no header in IntersectionTrafficLightData request");
108 AERROR <<
"SendV2xTrafficLight request has no header";
109 return Status::CANCELLED;
110 }
111 {
112 std::lock_guard<std::mutex> guard(traffic_light_mutex_);
113 latest_traffic_light_.CopyFrom(*request);
114 auto obu_header = latest_traffic_light_.mutable_header();
115 if (obu_header->has_timestamp_sec()) {
117 }
118 refresh_ = true;
119 }
120 traffic_light_condition_.notify_one();
122 ADEBUG <<
"recieved the junction id " << cur_junction_id;
123 response->set_status(true);
124 return Status::OK;
125}
optional int32 intersection_id