Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
0f7fee6e
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 搜索 >>
提交
0f7fee6e
编写于
12月 30, 2017
作者:
C
Calvin Miao
提交者:
Liangliang Zhang
12月 30, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: Added function to obtain ADC reference line lane ids
上级
f0ba88e8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
35 deletion
+43
-35
modules/prediction/container/adc_trajectory/adc_trajectory_container.cc
...tion/container/adc_trajectory/adc_trajectory_container.cc
+36
-33
modules/prediction/container/adc_trajectory/adc_trajectory_container.h
...ction/container/adc_trajectory/adc_trajectory_container.h
+7
-2
未找到文件。
modules/prediction/container/adc_trajectory/adc_trajectory_container.cc
浏览文件 @
0f7fee6e
...
...
@@ -35,6 +35,7 @@ using apollo::planning::ADCTrajectory;
void
ADCTrajectoryContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{
reference_line_lane_ids_
.
clear
();
adc_trajectory_
.
CopyFrom
(
dynamic_cast
<
const
ADCTrajectory
&>
(
message
));
if
(
!
IsProtected
())
{
junction_polygon_
=
Polygon2d
{};
...
...
@@ -55,8 +56,8 @@ bool ADCTrajectoryContainer::IsPointInJunction(const PathPoint& point) const {
on_virtual_lane
=
map
->
IsVirtualLane
(
point
.
lane_id
());
}
if
(
!
on_virtual_lane
)
{
on_virtual_lane
=
map
->
OnVirtualLane
({
point
.
x
(),
point
.
y
()},
FLAGS_virtual_lane_radius
);
on_virtual_lane
=
map
->
OnVirtualLane
({
point
.
x
(),
point
.
y
()},
FLAGS_virtual_lane_radius
);
}
return
in_polygon
&&
on_virtual_lane
;
}
...
...
@@ -67,44 +68,46 @@ bool ADCTrajectoryContainer::IsProtected() const {
}
Polygon2d
ADCTrajectoryContainer
::
GetJunctionPolygon
()
{
int
num_point
=
adc_trajectory_
.
trajectory_point_size
();
if
(
num_point
==
0
)
{
return
Polygon2d
{};
}
std
::
shared_ptr
<
const
JunctionInfo
>
junction_info
(
nullptr
);
double
prev_s
=
0.0
;
for
(
int
i
=
0
;
i
<
num_point
;
++
i
)
{
for
(
int
i
=
0
;
i
<
adc_trajectory_
.
trajectory_point_size
();
++
i
)
{
double
s
=
adc_trajectory_
.
trajectory_point
(
i
).
path_point
().
s
();
if
(
i
>
0
&&
std
::
abs
(
s
-
prev_s
)
<
FLAGS_junction_search_radius
)
{
continue
;
}
if
(
s
>
FLAGS_adc_trajectory_search_length
)
{
break
;
std
::
string
lane_id
=
adc_trajectory_
.
trajectory_point
(
i
).
path_point
().
lane_id
();
// Find junctions
if
(
junction_info
==
nullptr
&&
s
<
FLAGS_adc_trajectory_search_length
)
{
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
JunctionInfo
>>
junctions
=
PredictionMap
::
instance
()
->
GetJunctions
({
x
,
y
},
FLAGS_junction_search_radius
);
if
(
!
junctions
.
empty
()
&&
junctions
.
front
()
!=
nullptr
)
{
junction_info
=
junctions
.
front
();
}
}
prev_s
=
s
;
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
JunctionInfo
>>
junctions
=
PredictionMap
::
instance
()
->
GetJunctions
({
x
,
y
},
FLAGS_junction_search_radius
);
if
(
junctions
.
empty
())
{
continue
;
}
else
{
junction_info
=
junctions
.
front
();
break
;
// Insert reference lane ids
if
(
reference_line_lane_ids_
.
empty
()
||
lane_id
!=
reference_line_lane_ids_
.
back
())
{
reference_line_lane_ids_
.
emplace_back
(
lane_id
);
}
}
if
(
junction_info
==
nullptr
)
{
return
Polygon2d
{};
}
const
apollo
::
hdmap
::
Polygon
&
junction_polygon
=
junction_info
->
junction
().
polygon
();
std
::
vector
<
Vec2d
>
vertices
;
for
(
const
auto
&
point
:
junction_polygon
.
point
())
{
vertices
.
emplace_back
(
point
.
x
(),
point
.
y
());
if
(
junction_info
!=
nullptr
)
{
std
::
vector
<
Vec2d
>
vertices
;
for
(
const
auto
&
point
:
junction_info
->
junction
().
polygon
().
point
())
{
vertices
.
emplace_back
(
point
.
x
(),
point
.
y
());
}
if
(
vertices
.
size
()
>=
3
)
{
return
Polygon2d
{
vertices
};
}
}
return
Polygon2d
{
vertices
};
return
Polygon2d
{};
}
const
std
::
vector
<
std
::
string
>&
ADCTrajectoryContainer
::
get_reference_line_lane_ids
()
{
return
reference_line_lane_ids_
;
}
}
// namespace prediction
...
...
modules/prediction/container/adc_trajectory/adc_trajectory_container.h
浏览文件 @
0f7fee6e
...
...
@@ -24,7 +24,6 @@
#include <memory>
#include <string>
#include <unordered_set>
#include <vector>
#include "modules/perception/proto/perception_obstacle.pb.h"
...
...
@@ -68,13 +67,19 @@ class ADCTrajectoryContainer : public Container {
*/
bool
IsPointInJunction
(
const
apollo
::
common
::
PathPoint
&
point
)
const
;
/**
* @brief Get reference line lane ids
* @return A vector of lane ids
*/
const
std
::
vector
<
std
::
string
>&
get_reference_line_lane_ids
();
private:
apollo
::
common
::
math
::
Polygon2d
GetJunctionPolygon
();
private:
apollo
::
planning
::
ADCTrajectory
adc_trajectory_
;
apollo
::
common
::
math
::
Polygon2d
junction_polygon_
;
std
::
unordered_set
<
std
::
string
>
reference_line_lane_ids_
;
std
::
vector
<
std
::
string
>
reference_line_lane_ids_
;
};
}
// namespace prediction
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录