29 AERROR <<
"Get PointCloudMapROIComponentConfig file failed";
32 AINFO <<
"PointCloud map based roi Component Configs: "
33 << comp_config.DebugString();
44 if (use_map_manager_) {
50 if (!map_manager_.
Init(map_manager_init_options)) {
51 AINFO <<
"Failed to init map manager.";
52 use_map_manager_ =
false;
62 CHECK_NOTNULL(roi_filter_);
64 roi_filter_init_options.
config_path = plugin.config_path();
65 roi_filter_init_options.
config_file = plugin.config_file();
66 ACHECK(roi_filter_->Init(roi_filter_init_options))
67 <<
"Failed to init roi filter.";
73 const std::shared_ptr<LidarFrameMessage>& message) {
76 bool status = InternalProc(message);
78 writer_->Write(message);
79 AINFO <<
"Send pointcloud map based roi output message.";
84bool PointCloudMapROIComponent::InternalProc(
85 const std::shared_ptr<LidarFrameMessage>& message) {
88 if (use_map_manager_) {
90 if (!map_manager_.
Update(map_manager_options,
91 message->lidar_frame_.get())) {
92 AINFO <<
"Failed to update map structure.";
98 ROIFilterOptions roi_filter_options;
99 auto lidar_frame_ref = message->lidar_frame_.get();
100 auto original_cloud = lidar_frame_ref->cloud;
102 if (lidar_frame_ref->hdmap_struct !=
nullptr &&
103 roi_filter_->Filter(roi_filter_options, lidar_frame_ref)) {
106 AINFO <<
"Fail to call roi filter, use origin cloud.";
107 lidar_frame_ref->roi_indices.indices.resize(original_cloud->size());
109 std::iota(lidar_frame_ref->roi_indices.indices.begin(),
110 lidar_frame_ref->roi_indices.indices.end(), 0);
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
static PluginManager * Instance()
get singleton instance of PluginManager
std::shared_ptr< Base > CreateInstance(const std::string &derived_class)
create plugin instance of derived class based on Base
static std::string GetFullClassName(const std::string &class_name)
Given the class name of perception module, combine the namespace "apollo::perception::lidar::" with i...
bool Init(const MapManagerInitOptions &options=MapManagerInitOptions())
Init of Map Manager
bool Update(const MapManagerOptions &options, LidarFrame *frame)
update map structure and lidar2world pose
bool Proc(const std::shared_ptr< LidarFrameMessage > &message) override
Process of Point Cloud Map ROI Component object
bool Init() override
Init of Point Cloud Map ROI Component object
static SceneManager & Instance()
#define PERF_FUNCTION(...)
optional string map_manager_config_path
optional string map_manager_config_file
optional PluginParam plugin_param
optional string output_channel_name
optional bool use_map_manager
optional bool enable_hdmap