23 #include <condition_variable> 28 #include <grpc++/grpc++.h> 30 #include "modules/perception/proto/perception_obstacle.pb.h" 31 #include "modules/perception/proto/traffic_light_detection.pb.h" 32 #include "modules/v2x/proto/v2x_obu_rsi.pb.h" 33 #include "modules/v2x/proto/v2x_service_obu_to_car.grpc.pb.h" 34 #include "modules/v2x/proto/v2x_traffic_light.pb.h" 48 traffic_light_condition_.notify_all();
49 rsi_condition_.notify_all();
59 grpc::ServerContext *context,
60 const ::apollo::v2x::obu::ObuTrafficLight *request,
61 ::apollo::v2x::StatusResponse *response)
override;
68 const ::apollo::v2x::ObuAlarm *request,
69 ::apollo::v2x::StatusResponse *response)
override;
76 const apollo::v2x::V2XObstacles *request,
77 StatusResponse *response)
override;
79 grpc::Status
SendV2xRSI(grpc::ServerContext *context,
81 ::apollo::v2x::StatusResponse *response);
84 std::shared_ptr<::apollo::v2x::obu::ObuTrafficLight> *ptr);
86 void GetMsgFromGrpc(std::shared_ptr<::apollo::v2x::obu::ObuRsi> *ptr);
87 void GetMsgFromGrpc(std::shared_ptr<::apollo::v2x::V2XObstacles> *ptr);
90 std::mutex traffic_light_mutex_;
91 std::mutex rsi_mutex_;
92 std::mutex obstacles_mutex_;
93 std::condition_variable traffic_light_condition_;
94 std::condition_variable rsi_condition_;
95 std::condition_variable obs_condition_;
96 ::apollo::v2x::obu::ObuTrafficLight latest_traffic_light_;
98 ::apollo::v2x::V2XObstacles latest_obstacles_;
100 bool init_flag_ =
false;
101 bool refresh_ =
false;
102 bool rsi_refresh_ =
false;
103 bool obs_refresh_ =
false;
104 std::unique_ptr<::apollo::cyber::Node> node_ =
nullptr;
~GrpcServerImpl()
Definition: grpc_server.h:47
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool InitFlag()
Definition: grpc_server.h:52
::apollo::v2x::obu::ObuRsi ObuRsi
Definition: proto_adapter.h:60
void GetMsgFromGrpc(std::shared_ptr<::apollo::v2x::obu::ObuTrafficLight > *ptr)
grpc::Status SendV2xTrafficLight(grpc::ServerContext *context, const ::apollo::v2x::obu::ObuTrafficLight *request, ::apollo::v2x::StatusResponse *response) override
grpc::Status SendPerceptionObstacles(grpc::ServerContext *context, const apollo::v2x::V2XObstacles *request, StatusResponse *response) override
grpc::Status SendV2xRSI(grpc::ServerContext *context, const ::apollo::v2x::obu::ObuRsi *request, ::apollo::v2x::StatusResponse *response)
grpc::Status SendObuAlarm(grpc::ServerContext *context, const ::apollo::v2x::ObuAlarm *request, ::apollo::v2x::StatusResponse *response) override
Definition: grpc_server.h:41