20#include "modules/perception/barrier_recognition/detector/proto/barrier_bank_config.pb.h"
32 barrier_bank_map_.clear();
33 for (
int i = 0; i < config.plugins_size(); ++i) {
34 const auto& plugin = config.
plugins(i);
35 const auto& name = plugin.
name();
36 std::shared_ptr<BaseBarrierRecognizer> recognizer =
41 AINFO <<
"Failed to find barrier recognizer: " << name <<
", skipped";
47 if (!recognizer->Init(option)) {
48 AINFO <<
"Failed to init barrier recognizer: " << name <<
", skipped";
51 barrier_bank_map_[name] = recognizer;
52 AINFO <<
"Recognizer bank add: " << name;
58 std::string barrier_type = options.
name;
59 if (barrier_bank_map_.find(barrier_type) == barrier_bank_map_.end()) {
60 AERROR <<
"Failed to find barrier recognizer: " << barrier_type;
63 if (!barrier_bank_map_[barrier_type]->
Recognize(options, frame, open_percent)) {
64 AINFO <<
"Failed to call barrier recognizer: " << barrier_type;
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
bool Init(const BarrierRecognizerInitOptions &options=BarrierRecognizerInitOptions())
Init of BarrierRecognizerBank object
bool Recognize(const BarrierRecognizerOptions &options, LidarFrame *frame, float &open_percent)
calculate the relative position of the vehicle based on the reflector
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 GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
std::string GetConfigFile(const std::string &config_path, const std::string &config_file)
repeated PluginParam plugins