Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
71bf1249
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,体验更适合开发者的 AI 搜索 >>
提交
71bf1249
编写于
12月 11, 2018
作者:
K
kechxu
提交者:
Jiangtao Hu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: Fix trim bug by using PNC junction
上级
c2c0d1ea
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
105 addition
and
4 deletion
+105
-4
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+1
-1
modules/prediction/common/prediction_map.cc
modules/prediction/common/prediction_map.cc
+12
-0
modules/prediction/common/prediction_map.h
modules/prediction/common/prediction_map.h
+9
-0
modules/prediction/conf/prediction.conf
modules/prediction/conf/prediction.conf
+0
-1
modules/prediction/container/adc_trajectory/adc_trajectory_container.cc
...tion/container/adc_trajectory/adc_trajectory_container.cc
+64
-1
modules/prediction/container/adc_trajectory/adc_trajectory_container.h
...ction/container/adc_trajectory/adc_trajectory_container.h
+18
-0
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+1
-1
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
71bf1249
...
...
@@ -183,7 +183,7 @@ DEFINE_double(lane_sequence_threshold_junction, 0.5,
DEFINE_double
(
lane_change_dist
,
10.0
,
"Lane change distance with ADC"
);
DEFINE_bool
(
enable_lane_sequence_acc
,
false
,
"If use acceleration in lane sequence."
);
DEFINE_bool
(
enable_trim_prediction_trajectory
,
fals
e
,
DEFINE_bool
(
enable_trim_prediction_trajectory
,
tru
e
,
"If trim the prediction trajectory to avoid crossing"
"protected adc planning trajectory."
);
DEFINE_bool
(
enable_trajectory_validation_check
,
false
,
...
...
modules/prediction/common/prediction_map.cc
浏览文件 @
71bf1249
...
...
@@ -43,6 +43,7 @@ using apollo::hdmap::HDMapUtil;
using
apollo
::
hdmap
::
Id
;
using
apollo
::
hdmap
::
LaneInfo
;
using
apollo
::
hdmap
::
JunctionInfo
;
using
apollo
::
hdmap
::
PNCJunctionInfo
;
using
apollo
::
hdmap
::
OverlapInfo
;
using
apollo
::
hdmap
::
MapPathPoint
;
...
...
@@ -303,6 +304,17 @@ std::vector<std::shared_ptr<const JunctionInfo>> PredictionMap::GetJunctions(
return
junctions
;
}
std
::
vector
<
std
::
shared_ptr
<
const
PNCJunctionInfo
>>
PredictionMap
::
GetPNCJunctions
(
const
Eigen
::
Vector2d
&
point
,
const
double
radius
)
{
common
::
PointENU
hdmap_point
;
hdmap_point
.
set_x
(
point
.
x
());
hdmap_point
.
set_y
(
point
.
y
());
std
::
vector
<
std
::
shared_ptr
<
const
PNCJunctionInfo
>>
junctions
;
HDMapUtil
::
BaseMap
().
GetPNCJunctions
(
hdmap_point
,
radius
,
&
junctions
);
return
junctions
;
}
bool
PredictionMap
::
InJunction
(
const
Eigen
::
Vector2d
&
point
,
const
double
radius
)
{
auto
junction_infos
=
GetJunctions
(
point
,
radius
);
...
...
modules/prediction/common/prediction_map.h
浏览文件 @
71bf1249
...
...
@@ -233,6 +233,15 @@ class PredictionMap {
static
std
::
vector
<
std
::
shared_ptr
<
const
apollo
::
hdmap
::
JunctionInfo
>>
GetJunctions
(
const
Eigen
::
Vector2d
&
point
,
const
double
radius
);
/**
* @brief Get a list of junctions given a point and a search radius
* @param Point
* @param Search radius
* @return A list of junctions
*/
static
std
::
vector
<
std
::
shared_ptr
<
const
apollo
::
hdmap
::
PNCJunctionInfo
>>
GetPNCJunctions
(
const
Eigen
::
Vector2d
&
point
,
const
double
radius
);
/**
* @brief Get the lane heading on a point.
* @param lane_info The target lane.
...
...
modules/prediction/conf/prediction.conf
浏览文件 @
71bf1249
...
...
@@ -6,7 +6,6 @@
--
noenable_kf_tracking
--
noprediction_offline_mode
--
enable_trim_prediction_trajectory
--
lane_change_dist
=
10
.
0
--
lane_search_radius
=
5
.
0
modules/prediction/container/adc_trajectory/adc_trajectory_container.cc
浏览文件 @
71bf1249
...
...
@@ -32,6 +32,7 @@ using ::apollo::common::math::LineSegment2d;
using
::
apollo
::
common
::
math
::
Polygon2d
;
using
::
apollo
::
common
::
math
::
Vec2d
;
using
::
apollo
::
hdmap
::
JunctionInfo
;
using
::
apollo
::
hdmap
::
PNCJunctionInfo
;
using
::
apollo
::
planning
::
ADCTrajectory
;
ADCTrajectoryContainer
::
ADCTrajectoryContainer
()
...
...
@@ -54,6 +55,9 @@ void ADCTrajectoryContainer::Insert(
SetJunctionPolygon
();
ADEBUG
<<
"Generate a polygon ["
<<
adc_junction_polygon_
.
DebugString
()
<<
"]."
;
SetPNCJunctionPolygon
();
ADEBUG
<<
"Generate a polygon ["
<<
adc_pnc_junction_polygon_
.
DebugString
()
<<
"]."
;
// Find ADC lane sequence
SetLaneSequence
();
...
...
@@ -61,7 +65,16 @@ void ADCTrajectoryContainer::Insert(
<<
"]."
;
}
bool
ADCTrajectoryContainer
::
IsPointInJunction
(
const
PathPoint
&
point
)
const
{
bool
ADCTrajectoryContainer
::
IsPointInJunction
(
const
PathPoint
&
point
)
const
{
if
(
adc_pnc_junction_info_ptr_
!=
nullptr
)
{
return
IsPointInPNCJunction
(
point
);
}
return
IsPointInRegularJunction
(
point
);
}
bool
ADCTrajectoryContainer
::
IsPointInRegularJunction
(
const
PathPoint
&
point
)
const
{
if
(
adc_junction_polygon_
.
points
().
size
()
<
3
)
{
return
false
;
}
...
...
@@ -78,6 +91,14 @@ bool ADCTrajectoryContainer::IsPointInJunction(const PathPoint& point) const {
return
in_polygon
&&
on_virtual_lane
;
}
bool
ADCTrajectoryContainer
::
IsPointInPNCJunction
(
const
PathPoint
&
point
)
const
{
if
(
adc_pnc_junction_polygon_
.
points
().
size
()
<
3
)
{
return
false
;
}
return
adc_pnc_junction_polygon_
.
IsPointIn
({
point
.
x
(),
point
.
y
()});
}
bool
ADCTrajectoryContainer
::
IsProtected
()
const
{
return
adc_trajectory_
.
has_right_of_way_status
()
&&
adc_trajectory_
.
right_of_way_status
()
==
ADCTrajectory
::
PROTECTED
;
...
...
@@ -125,6 +146,48 @@ void ADCTrajectoryContainer::SetJunctionPolygon() {
}
}
void
ADCTrajectoryContainer
::
SetPNCJunctionPolygon
()
{
std
::
shared_ptr
<
const
PNCJunctionInfo
>
junction_info
(
nullptr
);
double
s_start
=
0.0
;
double
s_at_junction
=
0.0
;
if
(
adc_trajectory_
.
trajectory_point_size
()
>
0
)
{
s_start
=
adc_trajectory_
.
trajectory_point
(
0
).
path_point
().
s
();
}
for
(
int
i
=
0
;
i
<
adc_trajectory_
.
trajectory_point_size
();
++
i
)
{
double
s
=
adc_trajectory_
.
trajectory_point
(
i
).
path_point
().
s
();
if
(
s
>
FLAGS_adc_trajectory_search_length
)
{
break
;
}
if
(
junction_info
!=
nullptr
)
{
s_at_junction
=
s
;
break
;
}
double
x
=
adc_trajectory_
.
trajectory_point
(
i
).
path_point
().
x
();
double
y
=
adc_trajectory_
.
trajectory_point
(
i
).
path_point
().
y
();
std
::
vector
<
std
::
shared_ptr
<
const
PNCJunctionInfo
>>
junctions
=
PredictionMap
::
GetPNCJunctions
({
x
,
y
},
FLAGS_junction_search_radius
);
if
(
!
junctions
.
empty
()
&&
junctions
.
front
()
!=
nullptr
)
{
junction_info
=
junctions
.
front
();
}
}
if
(
junction_info
!=
nullptr
&&
junction_info
->
pnc_junction
().
has_polygon
())
{
std
::
vector
<
Vec2d
>
vertices
;
for
(
const
auto
&
point
:
junction_info
->
pnc_junction
().
polygon
().
point
())
{
vertices
.
emplace_back
(
point
.
x
(),
point
.
y
());
}
if
(
vertices
.
size
()
>=
3
)
{
adc_pnc_junction_info_ptr_
=
junction_info
;
s_dist_to_junction_
=
s_at_junction
-
s_start
;
adc_pnc_junction_polygon_
=
Polygon2d
{
vertices
};
}
}
}
std
::
shared_ptr
<
const
apollo
::
hdmap
::
JunctionInfo
>
ADCTrajectoryContainer
::
ADCJunction
()
const
{
return
adc_junction_info_ptr_
;
...
...
modules/prediction/container/adc_trajectory/adc_trajectory_container.h
浏览文件 @
71bf1249
...
...
@@ -103,6 +103,22 @@ class ADCTrajectoryContainer : public Container {
private:
void
SetJunctionPolygon
();
void
SetPNCJunctionPolygon
();
/**
* @brief Check if a point is in the first junction of the adc trajectory
* @param Point
* @return True if the point is in the first junction of the adc trajectory
*/
bool
IsPointInRegularJunction
(
const
common
::
PathPoint
&
point
)
const
;
/**
* @brief Check if a point is in the first PNC junction of the adc trajectory
* @param Point
* @return True if the point is in the first PNC junction of the adc trajectory
*/
bool
IsPointInPNCJunction
(
const
common
::
PathPoint
&
point
)
const
;
void
SetLaneSequence
();
std
::
string
ToString
(
const
std
::
unordered_set
<
std
::
string
>&
lane_ids
);
...
...
@@ -112,7 +128,9 @@ class ADCTrajectoryContainer : public Container {
private:
planning
::
ADCTrajectory
adc_trajectory_
;
common
::
math
::
Polygon2d
adc_junction_polygon_
;
common
::
math
::
Polygon2d
adc_pnc_junction_polygon_
;
std
::
shared_ptr
<
const
hdmap
::
JunctionInfo
>
adc_junction_info_ptr_
;
std
::
shared_ptr
<
const
hdmap
::
PNCJunctionInfo
>
adc_pnc_junction_info_ptr_
;
double
s_dist_to_junction_
;
std
::
unordered_set
<
std
::
string
>
adc_lane_ids_
;
std
::
vector
<
std
::
string
>
adc_lane_seq_
;
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
71bf1249
...
...
@@ -302,7 +302,7 @@ void Obstacle::SetJunctionFeatureWithEnterLane(
void
Obstacle
::
SetJunctionFeatureWithoutEnterLane
(
Feature
*
const
feature_ptr
)
{
if
(
!
feature_ptr
->
has_lane
())
{
A
ERROR
<<
"Obstacle ["
<<
id_
<<
"] has no lane."
;
A
DEBUG
<<
"Obstacle ["
<<
id_
<<
"] has no lane."
;
return
;
}
std
::
vector
<
std
::
string
>
start_lane_ids
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录