Apollo 11.0
自动驾驶开放平台
apollo::perception::fusion::DstManager类 参考

#include <dst_evidence.h>

apollo::perception::fusion::DstManager 的协作图:

Public 成员函数

bool AddApp (const std::string &app_name, const std::vector< uint64_t > &fod_subsets, const std::vector< std::string > &fod_subset_names=std::vector< std::string >())
 
bool IsAppAdded (const std::string &app_name)
 Whether app added
 
DstCommonDataPtr GetAppDataPtr (const std::string &app_name)
 Get the app data ptr object
 
size_t FodSubsetToInd (const std::string &app_name, const uint64_t &fod_subset)
 
uint64_t IndToFodSubset (const std::string &app_name, const size_t &ind)
 

静态 Public 成员函数

static DstManager * Instance ()
 

详细描述

在文件 dst_evidence.h 第 50 行定义.

成员函数说明

◆ AddApp()

bool apollo::perception::fusion::DstManager::AddApp ( const std::string &  app_name,
const std::vector< uint64_t > &  fod_subsets,
const std::vector< std::string > &  fod_subset_names = std::vector<std::string>() 
)

在文件 dst_evidence.cc 第 30 行定义.

32 {
33 if (dst_common_data_.find(app_name) != dst_common_data_.end()) {
34 AWARN << boost::format("Dst %s was added!") % app_name;
35 }
36 DstCommonData dst_data;
37 dst_data.fod_subsets_ = fod_subsets;
38 BuildSubsetsIndMap(&dst_data);
39 if (dst_data.subsets_ind_map_.size() != dst_data.fod_subsets_.size()) {
40 AERROR << boost::format(
41 "Dst %s: The input fod subsets"
42 " have repetitive elements.") %
43 app_name;
44 return false;
45 }
46 FodCheck(&dst_data);
47 ComputeCardinalities(&dst_data);
48 if (!ComputeRelations(&dst_data)) {
49 return false;
50 }
51 dst_data.init_ = true;
52 BuildNamesMap(fod_subset_names, &dst_data);
53
54 std::lock_guard<std::mutex> lock(map_mutex_);
55 dst_common_data_[app_name] = dst_data;
56 return true;
57}
#define AERROR
Definition log.h:44
#define AWARN
Definition log.h:43

◆ FodSubsetToInd()

size_t apollo::perception::fusion::DstManager::FodSubsetToInd ( const std::string &  app_name,
const uint64_t &  fod_subset 
)
参数
app_name
fod_subset
返回
size_t

在文件 dst_evidence.cc 第 79 行定义.

80 {
81 auto iter0 = dst_common_data_.find(app_name);
82 ACHECK(iter0 != dst_common_data_.end());
83 auto iter = iter0->second.subsets_ind_map_.find(fod_subset);
84 ACHECK(iter != iter0->second.subsets_ind_map_.end());
85 return iter->second;
86}
#define ACHECK(cond)
Definition log.h:80

◆ GetAppDataPtr()

DstCommonDataPtr apollo::perception::fusion::DstManager::GetAppDataPtr ( const std::string &  app_name)

Get the app data ptr object

参数
app_name
返回
DstCommonDataPtr

在文件 dst_evidence.cc 第 67 行定义.

67 {
68 if (!IsAppAdded(app_name)) {
69 AERROR << "app_name is not available";
70 return nullptr;
71 }
72 auto iter = dst_common_data_.find(app_name);
73 if (iter != dst_common_data_.end()) {
74 return &iter->second;
75 }
76 return nullptr;
77}
bool IsAppAdded(const std::string &app_name)
Whether app added

◆ IndToFodSubset()

uint64_t apollo::perception::fusion::DstManager::IndToFodSubset ( const std::string &  app_name,
const size_t &  ind 
)
参数
app_name
ind
返回
uint64_t

在文件 dst_evidence.cc 第 88 行定义.

89 {
90 auto iter = dst_common_data_.find(app_name);
91 ACHECK(iter != dst_common_data_.end());
92 return iter->second.fod_subsets_[ind];
93}

◆ Instance()

static DstManager * apollo::perception::fusion::DstManager::Instance ( )
inlinestatic

在文件 dst_evidence.h 第 52 行定义.

52 {
53 static DstManager dst_manager;
54 return &dst_manager;
55 }

◆ IsAppAdded()

bool apollo::perception::fusion::DstManager::IsAppAdded ( const std::string &  app_name)

Whether app added

参数
app_name
返回
true
false

在文件 dst_evidence.cc 第 59 行定义.

59 {
60 auto iter = dst_common_data_.find(app_name);
61 if (iter == dst_common_data_.end()) {
62 return false;
63 }
64 return iter->second.init_;
65}

该类的文档由以下文件生成: