Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
503785a3
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,发现更多精彩内容 >>
提交
503785a3
编写于
7月 17, 2019
作者:
P
panjiacheng
提交者:
Kecheng Xu
7月 17, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: add some comments and fix some minor bugs.
上级
aef3b6e4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
2 deletion
+19
-2
modules/prediction/common/junction_analyzer.cc
modules/prediction/common/junction_analyzer.cc
+11
-1
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+8
-0
modules/tools/prediction/data_pipelines/scripts/records_to_data_for_learning.sh
...on/data_pipelines/scripts/records_to_data_for_learning.sh
+0
-1
未找到文件。
modules/prediction/common/junction_analyzer.cc
浏览文件 @
503785a3
...
...
@@ -32,7 +32,9 @@ using apollo::hdmap::LaneInfo;
using
ConstLaneInfoPtr
=
std
::
shared_ptr
<
const
LaneInfo
>
;
std
::
shared_ptr
<
const
JunctionInfo
>
JunctionAnalyzer
::
junction_info_ptr_
;
// Maps exit lane-id to JunctionExit info.
std
::
unordered_map
<
std
::
string
,
JunctionExit
>
JunctionAnalyzer
::
junction_exits_
;
// Maps starting lane-id to JunctionFeature info.
std
::
unordered_map
<
std
::
string
,
JunctionFeature
>
JunctionAnalyzer
::
junction_features_
;
...
...
@@ -55,11 +57,14 @@ void JunctionAnalyzer::Clear() {
void
JunctionAnalyzer
::
SetAllJunctionExits
()
{
CHECK_NOTNULL
(
junction_info_ptr_
);
// Go through everything that the junction overlaps with.
for
(
const
auto
&
overlap_id
:
junction_info_ptr_
->
junction
().
overlap_id
())
{
auto
overlap_info_ptr
=
PredictionMap
::
OverlapById
(
overlap_id
.
id
());
if
(
overlap_info_ptr
==
nullptr
)
{
continue
;
}
// Find the lane-segments that are overlapping, yet also extends out of
// the junction area. Those are the junction-exit-lanes.
for
(
const
auto
&
object
:
overlap_info_ptr
->
overlap
().
object
())
{
if
(
object
.
has_lane_overlap_info
())
{
const
std
::
string
&
lane_id
=
object
.
id
().
id
();
...
...
@@ -90,18 +95,22 @@ std::vector<JunctionExit> JunctionAnalyzer::GetJunctionExits(
std
::
vector
<
JunctionExit
>
junction_exits
;
std
::
queue
<
std
::
pair
<
ConstLaneInfoPtr
,
int
>>
lane_info_queue
;
lane_info_queue
.
emplace
(
PredictionMap
::
LaneById
(
start_lane_id
),
0
);
std
::
unordered_set
<
std
::
string
>
visited_exit_lanes
;
// Perform a BFS to find all exit lanes that can be connected through
// this start_lane_id.
while
(
!
lane_info_queue
.
empty
())
{
ConstLaneInfoPtr
curr_lane
=
lane_info_queue
.
front
().
first
;
int
level
=
lane_info_queue
.
front
().
second
;
lane_info_queue
.
pop
();
const
std
::
string
&
curr_lane_id
=
curr_lane
->
id
().
id
();
std
::
unordered_set
<
std
::
string
>
visited_exit_lanes
;
// Stop if this is already an exit lane.
if
(
IsExitLane
(
curr_lane_id
)
&&
visited_exit_lanes
.
find
(
curr_lane_id
)
==
visited_exit_lanes
.
end
())
{
junction_exits
.
push_back
(
junction_exits_
[
curr_lane_id
]);
visited_exit_lanes
.
insert
(
curr_lane_id
);
continue
;
}
// Stop if reached max-search-level.
if
(
level
>=
max_search_level
)
{
continue
;
}
...
...
@@ -122,6 +131,7 @@ const JunctionFeature& JunctionAnalyzer::GetJunctionFeature(
JunctionFeature
junction_feature
;
junction_feature
.
set_junction_id
(
GetJunctionId
());
junction_feature
.
set_junction_range
(
ComputeJunctionRange
());
// Find all junction-exit-lanes that are successors of the start_lane_id.
std
::
vector
<
JunctionExit
>
junction_exits
=
GetJunctionExits
(
start_lane_id
);
for
(
const
auto
&
junction_exit
:
junction_exits
)
{
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
503785a3
...
...
@@ -237,16 +237,20 @@ bool Obstacle::IsInJunction(const std::string& junction_id) const {
}
void
Obstacle
::
BuildJunctionFeature
()
{
// If obstacle has no history at all, then exit.
if
(
feature_history_
.
empty
())
{
AERROR
<<
"Obstacle ["
<<
id_
<<
"] has no history"
;
return
;
}
// If obstacle is not in the given junction, then exit.
const
std
::
string
&
junction_id
=
JunctionAnalyzer
::
GetJunctionId
();
if
(
!
IsInJunction
(
junction_id
))
{
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] is not in junction ["
<<
junction_id
<<
"]"
;
return
;
}
// Set the junction features by calling SetJunctionFeatureWithoutEnterLane.
Feature
*
latest_feature_ptr
=
mutable_latest_feature
();
if
(
feature_history_
.
size
()
==
1
)
{
SetJunctionFeatureWithoutEnterLane
(
latest_feature_ptr
);
...
...
@@ -295,10 +299,14 @@ void Obstacle::SetJunctionFeatureWithEnterLane(const std::string& enter_lane_id,
}
void
Obstacle
::
SetJunctionFeatureWithoutEnterLane
(
Feature
*
const
feature_ptr
)
{
// Sanity checks.
if
(
!
feature_ptr
->
has_lane
())
{
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] has no lane."
;
return
;
}
// Get the possible lanes that the obstalce is on and their neighbor
// lanes and treat them as the starting-lane-segments.
std
::
vector
<
std
::
string
>
start_lane_ids
;
if
(
feature_ptr
->
lane
().
current_lane_feature_size
()
>
0
)
{
for
(
const
auto
&
lane_feature
:
...
...
modules/tools/prediction/data_pipelines/scripts/records_to_data_for_learning.sh
浏览文件 @
503785a3
...
...
@@ -36,7 +36,6 @@ fi
--flagfile
=
/apollo/modules/prediction/conf/prediction.conf
\
--map_dir
=
/apollo/modules/map/data/
${
MAP_DIR
}
\
--prediction_offline_mode
=
2
\
--noenable_multi_thread
\
--prediction_offline_bags
=
${
SRC_DIR
}
\
--prediction_data_dir
=
${
TARGET_DIR
}
\
--noenable_multi_thread
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录