26 {
27 LidarDetectionComponentConfig comp_config;
29 AERROR <<
"Get LidarDetectionComponentConfig file failed";
30 return false;
31 }
32 AINFO <<
"Lidar Detection Component Configs: " << comp_config.DebugString();
33
34 sensor_name_ = comp_config.sensor_name();
35
36 output_channel_name_ = comp_config.output_channel_name();
37 writer_ =
38 node_->CreateWriter<onboard::LidarFrameMessage>(output_channel_name_);
39
40 use_object_builder_ = comp_config.use_object_builder();
41
42
43 auto plugin_param = comp_config.plugin_param();
44 std::string detector_name = plugin_param.name();
45 BaseLidarDetector* detector =
46 BaseLidarDetectorRegisterer::GetInstanceByName(detector_name);
47 CHECK_NOTNULL(detector);
48 detector_.reset(detector);
49
50 LidarDetectorInitOptions detection_init_options;
51 detection_init_options.sensor_name = sensor_name_;
52 detection_init_options.config_path = plugin_param.config_path();
53 detection_init_options.config_file = plugin_param.config_file();
54 ACHECK(detector_->Init(detection_init_options))
55 << "lidar detector init error";
56
57
58 FLAGS_logtostderr = 0;
59
60
61 if (use_object_builder_) {
62 ObjectBuilderInitOptions builder_init_options;
64 }
65
66 AINFO <<
"Successfully init lidar detection component.";
67 return true;
68}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
bool Init(const ObjectBuilderInitOptions &options=ObjectBuilderInitOptions())
Init the Object Builder object with initialization options