Apollo 10.0
自动驾驶开放平台
apollo::perception::camera::ObjectMaintainer类 参考

#include <object_maintainer.h>

apollo::perception::camera::ObjectMaintainer 的协作图:

Public 成员函数

 ObjectMaintainer ()=default
 
 ~ObjectMaintainer ()=default
 
bool Add (int idx, base::ObjectPtr obj)
 Maintain a collection of objects that can be added based on the index.
 

Protected 属性

std::map< int, base::ObjectPtrassigned_index_
 

详细描述

在文件 object_maintainer.h27 行定义.

构造及析构函数说明

◆ ObjectMaintainer()

apollo::perception::camera::ObjectMaintainer::ObjectMaintainer ( )
default

◆ ~ObjectMaintainer()

apollo::perception::camera::ObjectMaintainer::~ObjectMaintainer ( )
default

成员函数说明

◆ Add()

bool apollo::perception::camera::ObjectMaintainer::Add ( int  idx,
base::ObjectPtr  obj 
)

Maintain a collection of objects that can be added based on the index.

By comparing the Subtyping probability of the new object and the Subtyping probability of the new and old objects, decide whether to update the old object. If the Subtyping probability of the new object is greater than the Subtyping probability of the old object, the old object is updated to the new object

参数
idxThe index to maintain in the collection
objNew object to maintain in the collection
返回
status if the object was updated successfully, false otherwise

在文件 object_maintainer.cc22 行定义.

22 {
23 auto obj_it = assigned_index_.find(idx);
24 if (obj_it == assigned_index_.end()) {
25 assigned_index_[idx] = obj;
26 return true;
27 }
28
29 auto pre_obj = obj_it->second;
30 int cur_type = static_cast<int>(obj->sub_type);
31 int pre_type = static_cast<int>(pre_obj->sub_type);
32
33 if (obj->sub_type_probs[cur_type] > pre_obj->sub_type_probs[pre_type]) {
34 *pre_obj = *obj;
35 }
36 return false;
37}
std::map< int, base::ObjectPtr > assigned_index_

类成员变量说明

◆ assigned_index_

std::map<int, base::ObjectPtr> apollo::perception::camera::ObjectMaintainer::assigned_index_
protected

在文件 object_maintainer.h46 行定义.


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