75 int InitAlgorithmPlugin();
76 int InitCameraListeners();
77 int InitCameraFrame();
79 void OnReceiveImage(
const std::shared_ptr<apollo::drivers::Image> image,
80 const std::string& camera_name);
83 std::vector<apollo::hdmap::Signal>* signals);
85 bool VerifyLightsProjection(
87 const std::string& camera_name,
88 std::shared_ptr<camera::TrafficLightFrame> image_lights,
89 std::shared_ptr<TrafficDetectMessage> msg);
91 bool UpdateCameraSelection(
double timestamp,
93 std::shared_ptr<camera::TrafficLightFrame> frame);
95 bool CheckCameraImageStatus(
double timestamp,
double interval,
96 const std::string& camera_name);
100 bool GetPoseFromTF(
const double timestamp,
const std::string& frame_id,
101 const std::string& child_frame_id,
102 Eigen::Matrix4d* pose_matrix);
104 void GenerateTrafficLights(
105 const std::vector<apollo::hdmap::Signal>& signals,
106 std::vector<base::TrafficLightPtr>* traffic_lights);
111 std::shared_ptr<trafficlight::BaseTLPreprocessor> preprocessor_;
115 std::string tl_preprocessor_name_;
117 std::string tf2_frame_id_;
118 std::string tf2_child_frame_id_;
119 std::string proposal_output_channel_name_;
121 double tf2_timeout_second_ = 0.01;
123 Buffer* tf2_buffer_ = Buffer::Instance();
125 std::vector<std::string> camera_names_;
126 std::vector<std::string> input_camera_channel_names_;
128 std::map<std::string, std::shared_ptr<TransformWrapper>>
129 camera2world_trans_wrapper_map_;
131 std::map<std::string, int> image_border_sizes_;
132 std::map<std::string, double> last_sub_camera_image_ts_;
135 std::map<std::string, std::shared_ptr<camera::DataProvider>>
138 double query_tf_interval_seconds_ = 0.0;
139 double image_timestamp_offset_ = 0.0;
140 int max_process_image_fps_ = 10;
141 double proc_interval_seconds_ = 0.0;
142 double check_image_status_interval_thresh_ = 1.0;
144 double last_query_tf_ts_ = 0.0;
145 double last_proc_image_ts_ = 0.0;
146 double image_sys_ts_diff_threshold_ = 0.5;
149 double last_signals_ts_ = -1.0;
150 double valid_hdmap_interval_ = 1.5;
151 double forward_distance_to_query_signals = 150.0;
152 std::vector<apollo::hdmap::Signal> last_signals_;
155 int image_width_ = 1920;
156 int image_height_ = 1080;
157 int default_image_border_size_ = 100;
160 bool enable_undistortion_ =
false;
164 ::google::protobuf::RepeatedPtrField<apollo::hdmap::Curve> stoplines_;
166 std::shared_ptr<apollo::cyber::Writer<TrafficDetectMessage>>
167 traffic_detect_writer_;