Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
00f8a585
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,发现更多精彩内容 >>
提交
00f8a585
编写于
12月 13, 2018
作者:
P
panjiacheng
提交者:
Kecheng Xu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: Allow the LaneGraph to have denser LanePoints.
上级
02bc1d32
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
9 deletion
+39
-9
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+3
-1
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+1
-0
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+32
-8
modules/prediction/container/obstacles/obstacle.h
modules/prediction/container/obstacles/obstacle.h
+3
-0
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
00f8a585
...
...
@@ -87,7 +87,9 @@ DEFINE_double(still_obstacle_position_std, 1.0,
DEFINE_double
(
still_pedestrian_position_std
,
0.5
,
"Position standard deviation for still obstacles"
);
DEFINE_double
(
max_history_time
,
7.0
,
"Obstacles' maximal historical time."
);
DEFINE_double
(
target_lane_gap
,
2.0
,
"gap between two lane points."
);
DEFINE_double
(
target_lane_gap
,
2.0
,
"Gap between two lane points."
);
DEFINE_double
(
dense_lane_gap
,
0.2
,
"Gap between two adjacent lane points"
" for constructing dense lane graph."
);
DEFINE_int32
(
max_num_current_lane
,
2
,
"Max number to search current lanes"
);
DEFINE_int32
(
max_num_nearby_lane
,
2
,
"Max number to search nearby lanes"
);
DEFINE_double
(
max_lane_angle_diff
,
M_PI
/
3.0
,
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
00f8a585
...
...
@@ -62,6 +62,7 @@ DECLARE_double(still_obstacle_position_std);
DECLARE_double
(
still_pedestrian_position_std
);
DECLARE_double
(
max_history_time
);
DECLARE_double
(
target_lane_gap
);
DECLARE_double
(
dense_lane_gap
);
DECLARE_int32
(
max_num_current_lane
);
DECLARE_int32
(
max_num_nearby_lane
);
DECLARE_double
(
max_lane_angle_diff
);
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
00f8a585
...
...
@@ -1228,25 +1228,36 @@ void Obstacle::BuildLaneGraphFromLeftToRight() {
}
// Build lane_points.
// TODO(jiacheng): make the points denser.
if
(
feature
->
has_lane
()
&&
feature
->
lane
().
has_lane_graph
())
{
// SetLanePoints(feature);
// SetLaneSequencePath(feature->mutable_lane()->mutable_lane_graph());
SetLanePoints
(
feature
,
FLAGS_dense_lane_gap
,
feature
->
mutable_lane
()
->
mutable_lane_graph_ordered
());
SetLaneSequencePath
(
feature
->
mutable_lane
()
->
mutable_lane_graph_ordered
());
}
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] set lane graph features."
;
}
// The default SetLanePoints applies to lane_graph with
// FLAGS_target_lane_gap.
void
Obstacle
::
SetLanePoints
(
Feature
*
feature
)
{
LaneGraph
*
lane_graph
=
feature
->
mutable_lane
()
->
mutable_lane_graph
();
SetLanePoints
(
feature
,
FLAGS_target_lane_gap
,
lane_graph
);
}
// The generic SetLanePoints
void
Obstacle
::
SetLanePoints
(
Feature
*
feature
,
double
lane_point_spacing
,
LaneGraph
*
const
lane_graph
)
{
// Sanity checks.
if
(
feature
==
nullptr
||
!
feature
->
has_velocity_heading
())
{
AERROR
<<
"Null feature or no velocity heading."
;
return
;
}
LaneGraph
*
lane_graph
=
feature
->
mutable_lane
()
->
mutable_lane_graph
();
double
heading
=
feature
->
velocity_heading
();
double
x
=
feature
->
position
().
x
();
double
y
=
feature
->
position
().
y
();
Eigen
::
Vector2d
position
(
x
,
y
);
// Go through every lane_sequence.
for
(
int
i
=
0
;
i
<
lane_graph
->
lane_sequence_size
();
++
i
)
{
LaneSequence
*
lane_sequence
=
lane_graph
->
mutable_lane_sequence
(
i
);
if
(
lane_sequence
->
lane_segment_size
()
<=
0
)
{
...
...
@@ -1258,9 +1269,12 @@ void Obstacle::SetLanePoints(Feature* feature) {
double
total_s
=
0.0
;
double
lane_seg_s
=
start_s
;
std
::
size_t
count_point
=
0
;
// Go through lane_segment one by one sequentially.
while
(
lane_index
<
lane_sequence
->
lane_segment_size
()
&&
count_point
<
FLAGS_max_num_lane_point
)
{
if
(
lane_seg_s
>
lane_segment
->
end_s
())
{
// If already exceeds the current lane_segment, then go to the
// next following one.
start_s
=
lane_seg_s
-
lane_segment
->
end_s
();
lane_seg_s
=
start_s
;
++
lane_index
;
...
...
@@ -1270,13 +1284,15 @@ void Obstacle::SetLanePoints(Feature* feature) {
lane_segment
=
nullptr
;
}
}
else
{
// Otherwise, update lane_graph:
// 1. Sanity checks.
std
::
string
lane_id
=
lane_segment
->
lane_id
();
std
::
shared_ptr
<
const
LaneInfo
>
lane_info
=
PredictionMap
::
LaneById
(
lane_id
);
if
(
lane_info
==
nullptr
)
{
break
;
}
LanePoint
lane_point
;
// 2. Get the closeset lane_point
Eigen
::
Vector2d
lane_point_pos
=
PredictionMap
::
PositionOnLane
(
lane_info
,
lane_seg_s
);
double
lane_point_heading
=
...
...
@@ -1285,6 +1301,9 @@ void Obstacle::SetLanePoints(Feature* feature) {
PredictionMap
::
LaneTotalWidth
(
lane_info
,
lane_seg_s
);
double
lane_point_angle_diff
=
common
::
math
::
AngleDiff
(
lane_point_heading
,
heading
);
// 3. Update it into the lane_graph
LanePoint
lane_point
;
lane_point
.
mutable_position
()
->
set_x
(
lane_point_pos
[
0
]);
lane_point
.
mutable_position
()
->
set_y
(
lane_point_pos
[
1
]);
lane_point
.
set_heading
(
lane_point_heading
);
...
...
@@ -1296,8 +1315,8 @@ void Obstacle::SetLanePoints(Feature* feature) {
lane_segment
->
set_lane_turn_type
(
PredictionMap
::
LaneTurnType
(
lane_id
));
lane_segment
->
add_lane_point
()
->
CopyFrom
(
lane_point
);
++
count_point
;
total_s
+=
FLAGS_target_lane_gap
;
lane_seg_s
+=
FLAGS_target_lane_gap
;
total_s
+=
lane_point_spacing
;
lane_seg_s
+=
lane_point_spacing
;
}
}
}
...
...
@@ -1305,11 +1324,14 @@ void Obstacle::SetLanePoints(Feature* feature) {
}
void
Obstacle
::
SetLaneSequencePath
(
LaneGraph
*
const
lane_graph
)
{
// Go through every lane_sequence.
for
(
int
i
=
0
;
i
<
lane_graph
->
lane_sequence_size
();
++
i
)
{
LaneSequence
*
lane_sequence
=
lane_graph
->
mutable_lane_sequence
(
i
);
double
lane_segment_s
=
0.0
;
// Go through every lane_segment.
for
(
int
j
=
0
;
j
<
lane_sequence
->
lane_segment_size
();
++
j
)
{
LaneSegment
*
lane_segment
=
lane_sequence
->
mutable_lane_segment
(
j
);
// Go through every lane_point and set the corresponding path_point.
for
(
int
k
=
0
;
k
<
lane_segment
->
lane_point_size
();
++
k
)
{
LanePoint
*
lane_point
=
lane_segment
->
mutable_lane_point
(
k
);
PathPoint
path_point
;
...
...
@@ -1319,10 +1341,12 @@ void Obstacle::SetLaneSequencePath(LaneGraph* const lane_graph) {
}
lane_segment_s
+=
lane_segment
->
total_length
();
}
// Sanity checks.
int
num_path_point
=
lane_sequence
->
path_point_size
();
if
(
num_path_point
<=
0
)
{
continue
;
}
// Go through every path_point, calculate kappa, and update it.
int
segment_index
=
0
;
int
point_index
=
0
;
for
(
int
j
=
0
;
j
+
1
<
num_path_point
;
++
j
)
{
...
...
modules/prediction/container/obstacles/obstacle.h
浏览文件 @
00f8a585
...
...
@@ -283,6 +283,9 @@ class Obstacle {
void
SetLanePoints
(
Feature
*
feature
);
void
SetLanePoints
(
Feature
*
feature
,
double
lane_point_spacing
,
LaneGraph
*
const
lane_graph
);
void
SetLaneSequencePath
(
LaneGraph
*
const
lane_graph
);
void
InitKFPedestrianTracker
(
const
Feature
&
feature
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录