Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
e92d2922
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,发现更多精彩内容 >>
提交
e92d2922
编写于
4月 01, 2019
作者:
H
Hongyi
提交者:
Kecheng Xu
4月 01, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: refactor ObstaclesPrioritizer
上级
ccd575f0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
47 deletion
+6
-47
modules/prediction/scenario/prioritization/obstacles_prioritizer.cc
...ediction/scenario/prioritization/obstacles_prioritizer.cc
+5
-41
modules/prediction/scenario/prioritization/obstacles_prioritizer.h
...rediction/scenario/prioritization/obstacles_prioritizer.h
+1
-6
未找到文件。
modules/prediction/scenario/prioritization/obstacles_prioritizer.cc
浏览文件 @
e92d2922
...
...
@@ -94,15 +94,10 @@ void ObstaclesPrioritizer::PrioritizeObstacles() {
AssignCautionLevel
();
}
void
ObstaclesPrioritizer
::
AssignCautionLevel
()
{
AssignCautionLevelInCruise
();
}
void
ObstaclesPrioritizer
::
AssignIgnoreLevel
()
{
auto
obstacles_container
=
ContainerManager
::
Instance
()
->
GetContainer
<
ObstaclesContainer
>
(
AdapterConfig
::
PERCEPTION_OBSTACLES
);
if
(
obstacles_container
==
nullptr
)
{
AERROR
<<
"Obstacles container pointer is a null pointer."
;
return
;
...
...
@@ -126,7 +121,6 @@ void ObstaclesPrioritizer::AssignIgnoreLevel() {
double
pose_theta
=
pose_obstacle_ptr
->
theta
();
double
pose_x
=
pose_obstacle_ptr
->
position
().
x
();
double
pose_y
=
pose_obstacle_ptr
->
position
().
y
();
ADEBUG
<<
"Get pose ("
<<
pose_x
<<
", "
<<
pose_y
<<
", "
<<
pose_theta
<<
")"
;
...
...
@@ -137,7 +131,6 @@ void ObstaclesPrioritizer::AssignIgnoreLevel() {
const
auto
&
obstacle_ids
=
obstacles_container
->
curr_frame_predictable_obstacle_ids
();
for
(
const
int
&
obstacle_id
:
obstacle_ids
)
{
Obstacle
*
obstacle_ptr
=
obstacles_container
->
GetObstacle
(
obstacle_id
);
if
(
obstacle_ptr
->
history_size
()
==
0
)
{
...
...
@@ -181,8 +174,8 @@ void ObstaclesPrioritizer::AssignIgnoreLevel() {
}
}
void
ObstaclesPrioritizer
::
AssignCautionLevel
InCruise
()
{
// TODO(kechxu) integrate change lane when ready to check change lane
void
ObstaclesPrioritizer
::
AssignCautionLevel
()
{
// TODO(kechxu)
:
integrate change lane when ready to check change lane
AssignCautionLevelCruiseKeepLane
();
AssignCautionLevelByEgoReferenceLine
();
}
...
...
@@ -205,6 +198,7 @@ void ObstaclesPrioritizer::AssignCautionLevelCruiseKeepLane() {
AERROR
<<
"Ego vehicle has no history"
;
return
;
}
// TODO(Hongyi): using current frame when NearbyObstacles are ready
const
Feature
&
ego_latest_feature
=
ego_vehicle
->
feature
(
1
);
for
(
const
LaneSequence
&
lane_sequence
:
ego_latest_feature
.
lane
().
lane_graph
().
lane_sequence
())
{
...
...
@@ -284,37 +278,6 @@ void ObstaclesPrioritizer::AssignCautionLevelCruiseChangeLane() {
}
}
void
ObstaclesPrioritizer
::
AssignCautionLevelInJunction
(
const
std
::
shared_ptr
<
ScenarioFeatures
>
scenario_features
)
{
if
(
scenario_features
->
scenario
().
type
()
!=
Scenario
::
JUNCTION
)
{
ADEBUG
<<
"Not in Junction Scenario"
;
return
;
}
std
::
string
junction_id
=
scenario_features
->
scenario
().
junction_id
();
ObstaclesContainer
*
obstacles_container
=
ContainerManager
::
Instance
()
->
GetContainer
<
ObstaclesContainer
>
(
AdapterConfig
::
PERCEPTION_OBSTACLES
);
if
(
obstacles_container
==
nullptr
)
{
AERROR
<<
"Null obstacles container found"
;
return
;
}
Obstacle
*
ego_vehicle
=
obstacles_container
->
GetObstacle
(
FLAGS_ego_vehicle_id
);
if
(
ego_vehicle
==
nullptr
)
{
AERROR
<<
"Ego vehicle not found"
;
return
;
}
for
(
const
int
id
:
obstacles_container
->
curr_frame_predictable_obstacle_ids
())
{
Obstacle
*
obstacle_ptr
=
obstacles_container
->
GetObstacle
(
id
);
if
(
obstacle_ptr
!=
nullptr
&&
obstacle_ptr
->
IsInJunction
(
junction_id
))
{
obstacle_ptr
->
SetCaution
();
ADEBUG
<<
"SetCaution for obstacle ["
<<
obstacle_ptr
->
id
()
<<
"]"
;
}
}
AssignCautionLevelByEgoReferenceLine
();
}
void
ObstaclesPrioritizer
::
AssignCautionLevelByEgoReferenceLine
()
{
ObstaclesContainer
*
obstacles_container
=
ContainerManager
::
Instance
()
->
GetContainer
<
ObstaclesContainer
>
(
...
...
@@ -356,7 +319,7 @@ void ObstaclesPrioritizer::AssignCautionLevelByEgoReferenceLine() {
double
ego_vehicle_l
=
std
::
numeric_limits
<
double
>::
max
();
double
accumulated_s
=
0.0
;
std
::
string
ego_lane_id
=
""
;
// first loop
of
lane_ids to findout ego_vehicle_s
// first loop
for
lane_ids to findout ego_vehicle_s
for
(
const
std
::
string
&
lane_id
:
lane_ids
)
{
std
::
shared_ptr
<
const
LaneInfo
>
lane_info_ptr
=
PredictionMap
::
LaneById
(
lane_id
);
...
...
@@ -376,6 +339,7 @@ void ObstaclesPrioritizer::AssignCautionLevelByEgoReferenceLine() {
accumulated_s
+=
lane_info_ptr
->
total_length
();
}
// insert ego_back_lane_id
accumulated_s
=
0.0
;
for
(
const
std
::
string
&
lane_id
:
lane_ids
)
{
ego_back_lane_id_set_
.
insert
(
lane_id
);
...
...
modules/prediction/scenario/prioritization/obstacles_prioritizer.h
浏览文件 @
e92d2922
...
...
@@ -32,20 +32,15 @@ class ObstaclesPrioritizer {
static
void
PrioritizeObstacles
();
private:
static
void
AssignIgnoreLevel
();
static
void
AssignCautionLevel
();
static
void
AssignCautionLevelInCruise
();
private:
static
void
AssignCautionLevelCruiseKeepLane
();
static
void
AssignCautionLevelCruiseChangeLane
();
static
void
AssignCautionLevelInJunction
(
const
std
::
shared_ptr
<
ScenarioFeatures
>
scenario_features
);
static
void
AssignCautionLevelByEgoReferenceLine
();
static
void
AssignCautionByMerge
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录