Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
191664f7
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,发现更多精彩内容 >>
提交
191664f7
编写于
2月 13, 2019
作者:
J
Jiaming Tao
提交者:
Jiangtao Hu
2月 13, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: implementation of scenario dispatch cont'd
上级
a7473ba3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
91 addition
and
21 deletion
+91
-21
modules/planning/scenarios/scenario_manager.cc
modules/planning/scenarios/scenario_manager.cc
+87
-19
modules/planning/scenarios/scenario_manager.h
modules/planning/scenarios/scenario_manager.h
+4
-2
未找到文件。
modules/planning/scenarios/scenario_manager.cc
浏览文件 @
191664f7
...
...
@@ -115,16 +115,31 @@ void ScenarioManager::RegisterScenarios() {
&
config_map_
[
ScenarioConfig
::
TRAFFIC_LIGHT_UNPROTECTED_RIGHT_TURN
]));
}
bool
ScenarioManager
::
SelectChangeLaneScenario
(
const
common
::
TrajectoryPoint
&
ego_point
,
const
Frame
&
frame
)
{
ScenarioConfig
::
ScenarioType
ScenarioManager
::
SelectChangeLaneScenario
(
const
Frame
&
frame
)
{
if
(
frame
.
reference_line_info
().
size
()
>
1
)
{
if
(
current_scenario_
->
scenario_type
()
!=
ScenarioConfig
::
LANE_FOLLOW
)
{
current_scenario_
=
CreateScenario
(
ScenarioConfig
::
LANE_FOLLOW
);
}
return
true
;
}
else
{
return
false
;
// TODO(all): to be implemented
return
ScenarioConfig
::
LANE_FOLLOW
;
}
return
ScenarioConfig
::
LANE_FOLLOW
;
}
ScenarioConfig
::
ScenarioType
ScenarioManager
::
SelectStopSignScenario
(
const
Frame
&
frame
)
{
// TODO(all):
return
ScenarioConfig
::
STOP_SIGN_UNPROTECTED
;
}
ScenarioConfig
::
ScenarioType
ScenarioManager
::
SelectTrafficLightScenario
(
const
Frame
&
frame
)
{
// TODO(all):
return
ScenarioConfig
::
TRAFFIC_LIGHT_PROTECTED
;
}
ScenarioConfig
::
ScenarioType
ScenarioManager
::
SelectSidePassScenario
(
const
Frame
&
frame
)
{
// TODO(all):
return
ScenarioConfig
::
LANE_FOLLOW
;
}
bool
ScenarioManager
::
ReuseCurrentScenario
(
...
...
@@ -250,14 +265,69 @@ void ScenarioManager::ScenarioDispatch(
return
;
}
// change lane case, currently default to LANE_FOLLOW in change lane case.
// TODO(all) implement change lane scenario.
if
(
SelectChangeLaneScenario
(
ego_point
,
frame
))
{
ADEBUG
<<
"Use change lane scenario (temporarily use LANE_FOLLOW)"
;
return
;
const
auto
&
reference_line_info
=
frame
.
reference_line_info
().
front
();
const
auto
&
first_encountered_overlaps
=
reference_line_info
.
FirstEncounteredOverlaps
();
std
::
pair
<
ReferenceLineInfo
::
OverlapType
,
hdmap
::
PathOverlap
>
*
junction_with_sign_overlap
=
nullptr
;
std
::
pair
<
ReferenceLineInfo
::
OverlapType
,
hdmap
::
PathOverlap
>
*
junction_overlap
=
nullptr
;
for
(
const
auto
&
overlap
:
first_encountered_overlaps
)
{
if
(
!
junction_with_sign_overlap
&&
(
overlap
.
first
==
ReferenceLineInfo
::
STOP_SIGN
||
overlap
.
first
==
ReferenceLineInfo
::
SIGNAL
))
{
junction_with_sign_overlap
=
const_cast
<
std
::
pair
<
ReferenceLineInfo
::
OverlapType
,
hdmap
::
PathOverlap
>*>
(
&
overlap
);
}
else
if
(
!
junction_overlap
&&
overlap
.
first
==
ReferenceLineInfo
::
PNC_JUNCTION
)
{
junction_overlap
=
const_cast
<
std
::
pair
<
ReferenceLineInfo
::
OverlapType
,
hdmap
::
PathOverlap
>*>
(
&
overlap
);
}
}
////////////////////////////////////////
// default: LANE_FOLLOW
ScenarioConfig
::
ScenarioType
scenario_type
=
ScenarioConfig
::
LANE_FOLLOW
;
////////////////////////////////////////
// intersection scenarios
if
(
junction_with_sign_overlap
)
{
switch
(
junction_with_sign_overlap
->
first
)
{
case
ReferenceLineInfo
::
STOP_SIGN
:
if
(
!
FLAGS_enable_scenario_stop_sign
)
{
scenario_type
=
SelectStopSignScenario
(
frame
);
}
break
;
case
ReferenceLineInfo
::
SIGNAL
:
if
(
!
FLAGS_enable_scenario_traffic_light
)
{
scenario_type
=
SelectTrafficLightScenario
(
frame
);
}
break
;
default:
break
;
}
}
else
if
(
junction_overlap
)
{
// junction with no signs(stop_sign/traffic_light/etc)
// TODO(all): to be added
}
////////////////////////////////////////
// CHANGE_LANE scenario
if
(
scenario_type
!=
ScenarioConfig
::
LANE_FOLLOW
)
{
SelectChangeLaneScenario
(
frame
);
}
////////////////////////////////////////
// SIDE_PASS scenario
if
(
scenario_type
!=
ScenarioConfig
::
LANE_FOLLOW
)
{
SelectSidePassScenario
(
frame
);
}
// TODO(all): to be added
ADEBUG
<<
"select scenario: "
<<
ScenarioConfig
::
ScenarioType_Name
(
scenario_type
);
current_scenario_
=
CreateScenario
(
scenario_type
);
}
void
ScenarioManager
::
ScenarioSelfVote
(
...
...
@@ -265,12 +335,11 @@ void ScenarioManager::ScenarioSelfVote(
const
Frame
&
frame
)
{
CHECK
(
!
frame
.
reference_line_info
().
empty
());
const
auto
&
reference_line_info
=
frame
.
reference_line_info
().
front
();
// change lane case, currently default to LANE_FOLLOW in change lane case.
// TODO(all) implement change lane scenario.
if
(
SelectChangeLaneScenario
(
ego_point
,
frame
))
{
ADEBUG
<<
"Use change lane scenario (temporarily use LANE_FOLLOW)"
;
return
;
}
// SelectChangeLaneScenario(reference_line_info);
// non change lane case
std
::
set
<
ScenarioConfig
::
ScenarioType
>
rejected_scenarios
;
...
...
@@ -285,7 +354,6 @@ void ScenarioManager::ScenarioSelfVote(
std
::
vector
<
ScenarioConfig
::
ScenarioType
>
preferred_scenarios
;
preferred_scenarios
.
push_back
(
ScenarioConfig
::
LANE_FOLLOW
);
const
auto
&
reference_line_info
=
frame
.
reference_line_info
().
front
();
const
auto
&
first_overlaps
=
reference_line_info
.
FirstEncounteredOverlaps
();
for
(
const
auto
&
overlap
:
first_overlaps
)
{
// side_pass
...
...
modules/planning/scenarios/scenario_manager.h
浏览文件 @
191664f7
...
...
@@ -52,8 +52,10 @@ class ScenarioManager final {
void
RegisterScenarios
();
bool
SelectChangeLaneScenario
(
const
common
::
TrajectoryPoint
&
ego_point
,
const
Frame
&
frame
);
ScenarioConfig
::
ScenarioType
SelectChangeLaneScenario
(
const
Frame
&
frame
);
ScenarioConfig
::
ScenarioType
SelectStopSignScenario
(
const
Frame
&
frame
);
ScenarioConfig
::
ScenarioType
SelectTrafficLightScenario
(
const
Frame
&
frame
);
ScenarioConfig
::
ScenarioType
SelectSidePassScenario
(
const
Frame
&
frame
);
// functions for scenario voter implementation
void
ScenarioSelfVote
(
const
common
::
TrajectoryPoint
&
ego_point
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录