Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
3263e162
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3263e162
编写于
1月 14, 2019
作者:
Y
Yajia Zhang
提交者:
PAN Jiacheng
1月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
prediction: obstacle.cc refactor
上级
a54f449a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
16 deletion
+12
-16
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+8
-12
modules/prediction/container/obstacles/obstacle.h
modules/prediction/container/obstacles/obstacle.h
+2
-2
modules/prediction/container/obstacles/obstacles_container.cc
...les/prediction/container/obstacles/obstacles_container.cc
+2
-2
未找到文件。
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
3263e162
...
...
@@ -196,7 +196,7 @@ bool Obstacle::Insert(const PerceptionObstacle& perception_obstacle,
}
// Trim historical features
Trim
();
DiscardOutdatedHistory
();
return
true
;
}
...
...
@@ -392,7 +392,7 @@ void Obstacle::UpdateStatus(Feature* feature) {
}
bool
Obstacle
::
SetId
(
const
PerceptionObstacle
&
perception_obstacle
,
Feature
*
feature
,
int
prediction_obstacle_id
)
{
Feature
*
feature
,
const
int
prediction_obstacle_id
)
{
int
id
=
prediction_obstacle_id
>
0
?
prediction_obstacle_id
:
perception_obstacle
.
id
();
if
(
id_
<
0
)
{
...
...
@@ -1486,20 +1486,16 @@ bool Obstacle::ReceivedNewerMessage(const double timestamp) const {
return
timestamp
<=
last_timestamp_received
;
}
void
Obstacle
::
Trim
()
{
if
(
feature_history_
.
size
()
<
2
)
{
return
;
}
int
count
=
0
;
void
Obstacle
::
DiscardOutdatedHistory
()
{
auto
num_of_frames
=
feature_history_
.
size
();
const
double
latest_ts
=
feature_history_
.
front
().
timestamp
();
while
(
!
feature_history_
.
empty
()
&&
latest_ts
-
feature_history_
.
back
().
timestamp
()
>=
while
(
latest_ts
-
feature_history_
.
back
().
timestamp
()
>=
FLAGS_max_history_time
)
{
feature_history_
.
pop_back
();
++
count
;
}
if
(
count
>
0
)
{
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] trimmed "
<<
count
auto
num_of_discarded_frames
=
num_of_frames
-
feature_history_
.
size
();
if
(
num_of_discarded_frames
>
0
)
{
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] discards "
<<
num_of_discarded_frames
<<
" historical features"
;
}
}
...
...
modules/prediction/container/obstacles/obstacle.h
浏览文件 @
3263e162
...
...
@@ -234,7 +234,7 @@ class Obstacle {
void
UpdateStatus
(
Feature
*
feature
);
bool
SetId
(
const
perception
::
PerceptionObstacle
&
perception_obstacle
,
Feature
*
feature
,
int
prediction_id
=
-
1
);
Feature
*
feature
,
const
int
prediction_id
=
-
1
);
bool
SetType
(
const
perception
::
PerceptionObstacle
&
perception_obstacle
,
Feature
*
feature
);
...
...
@@ -305,7 +305,7 @@ class Obstacle {
void
SetJunctionFeatureWithoutEnterLane
(
Feature
*
const
feature_ptr
);
void
Trim
();
void
DiscardOutdatedHistory
();
private:
int
id_
=
-
1
;
...
...
modules/prediction/container/obstacles/obstacles_container.cc
浏览文件 @
3263e162
...
...
@@ -108,8 +108,8 @@ void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
}
Obstacle
*
ObstaclesContainer
::
GetObstacle
(
const
int
id
)
{
auto
ptr_obstacle
=
ptr_obstacles_
.
GetSilently
(
id
);
Obstacle
*
ObstaclesContainer
::
GetObstacle
(
const
int
perception_
id
)
{
auto
ptr_obstacle
=
ptr_obstacles_
.
GetSilently
(
perception_
id
);
if
(
ptr_obstacle
!=
nullptr
)
{
return
ptr_obstacle
->
get
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录