Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
90fe0020
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,发现更多精彩内容 >>
提交
90fe0020
编写于
12月 26, 2017
作者:
K
kechxu
提交者:
Calvin Miao
12月 27, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: trim prediction trajectory by virtual lane
上级
5fc5f42c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
59 addition
and
1 deletion
+59
-1
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+1
-0
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+1
-0
modules/prediction/common/prediction_map.cc
modules/prediction/common/prediction_map.cc
+31
-0
modules/prediction/common/prediction_map.h
modules/prediction/common/prediction_map.h
+15
-0
modules/prediction/predictor/predictor.cc
modules/prediction/predictor/predictor.cc
+11
-1
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
90fe0020
...
...
@@ -108,6 +108,7 @@ DEFINE_double(distance_beyond_junction, 0.5,
"consider it in junction."
);
DEFINE_double
(
adc_trajectory_search_length
,
10.0
,
"How far to search junction along adc planning trajectory"
);
DEFINE_double
(
virtual_lane_radius
,
0.5
,
"Radius to search virtual lanes"
);
// move sequence prediction
DEFINE_double
(
time_upper_bound_to_lane_center
,
5.0
,
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
90fe0020
...
...
@@ -76,6 +76,7 @@ DECLARE_bool(enable_lane_sequence_acc);
DECLARE_bool
(
enable_trim_prediction_trajectory
);
DECLARE_double
(
distance_beyond_junction
);
DECLARE_double
(
adc_trajectory_search_length
);
DECLARE_double
(
virtual_lane_radius
);
// move sequence prediction
DECLARE_double
(
time_upper_bound_to_lane_center
);
...
...
modules/prediction/common/prediction_map.cc
浏览文件 @
90fe0020
...
...
@@ -90,6 +90,37 @@ bool PredictionMap::ProjectionFromLane(
return
true
;
}
bool
PredictionMap
::
IsVirtualLane
(
const
std
::
string
&
lane_id
)
{
std
::
shared_ptr
<
const
LaneInfo
>
lane_info
=
HDMapUtil
::
BaseMap
().
GetLaneById
(
hdmap
::
MakeMapId
(
lane_id
));
if
(
lane_info
==
nullptr
)
{
return
false
;
}
const
apollo
::
hdmap
::
Lane
&
lane
=
lane_info
->
lane
();
bool
left_virtual
=
lane
.
has_left_boundary
()
&&
lane
.
left_boundary
().
has_virtual_
()
&&
lane
.
left_boundary
().
virtual_
();
bool
right_virtual
=
lane
.
has_right_boundary
()
&&
lane
.
right_boundary
().
has_virtual_
()
&&
lane
.
right_boundary
().
virtual_
();
return
left_virtual
&&
right_virtual
;
}
bool
PredictionMap
::
OnVirtualLane
(
const
Eigen
::
Vector2d
&
point
,
const
double
radius
)
{
std
::
vector
<
std
::
shared_ptr
<
const
LaneInfo
>>
lanes
;
common
::
PointENU
hdmap_point
;
hdmap_point
.
set_x
(
point
[
0
]);
hdmap_point
.
set_y
(
point
[
1
]);
HDMapUtil
::
BaseMap
().
GetLanes
(
hdmap_point
,
radius
,
&
lanes
);
for
(
const
auto
&
lane
:
lanes
)
{
if
(
IsVirtualLane
(
lane
->
id
().
id
()))
{
return
true
;
}
}
return
false
;
}
void
PredictionMap
::
OnLane
(
const
std
::
vector
<
std
::
shared_ptr
<
const
LaneInfo
>>&
prev_lanes
,
const
Eigen
::
Vector2d
&
point
,
const
double
heading
,
const
double
radius
,
...
...
modules/prediction/common/prediction_map.h
浏览文件 @
90fe0020
...
...
@@ -89,6 +89,21 @@ class PredictionMap {
std
::
shared_ptr
<
const
hdmap
::
LaneInfo
>
lane_info
,
const
double
s
,
hdmap
::
MapPathPoint
*
path_point
);
/**
* @brief Determine if a lane is a virtual lane.
* @param The lane ID of the lane.
* @return If the lane is a virtual lane.
*/
static
bool
IsVirtualLane
(
const
std
::
string
&
lane_id
);
/**
* @brief Determine if a point is on a virtual lane.
* @param The point coordinate.
* @return If the point is on a virtual lane.
*/
static
bool
OnVirtualLane
(
const
Eigen
::
Vector2d
&
position
,
const
double
radius
);
/**
* @brief Get the connected lanes from some specified lanes.
* @param prev_lanes The lanes from which to search their connected lanes.
...
...
modules/prediction/predictor/predictor.cc
浏览文件 @
90fe0020
...
...
@@ -87,7 +87,9 @@ bool Predictor::TrimTrajectory(
forward_length
*
std
::
cos
(
heading
);
double
start_y
=
trajectory
->
trajectory_point
(
0
).
path_point
().
y
()
+
forward_length
*
std
::
sin
(
heading
);
if
(
adc_trajectory_container
->
IsPointInJunction
({
start_x
,
start_y
}))
{
if
(
adc_trajectory_container
->
IsPointInJunction
({
start_x
,
start_y
})
&&
PredictionMap
::
instance
()
->
OnVirtualLane
({
start_x
,
start_y
},
FLAGS_virtual_lane_radius
))
{
return
false
;
}
int
index
=
0
;
...
...
@@ -97,6 +99,14 @@ bool Predictor::TrimTrajectory(
if
(
adc_trajectory_container
->
IsPointInJunction
({
x
,
y
}))
{
break
;
}
if
(
!
trajectory
->
trajectory_point
(
index
).
path_point
().
has_lane_id
())
{
continue
;
}
const
std
::
string
&
lane_id
=
trajectory
->
trajectory_point
(
index
).
path_point
().
lane_id
();
if
(
PredictionMap
::
instance
()
->
IsVirtualLane
(
lane_id
))
{
break
;
}
++
index
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录