Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
a793afad
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,发现更多精彩内容 >>
提交
a793afad
编写于
6月 27, 2019
作者:
J
JasonZhou404
提交者:
Calvin Miao
6月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: fix generate fallback path profile
上级
d3ef5309
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
13 deletion
+39
-13
modules/planning/scenarios/lane_follow/lane_follow_stage.cc
modules/planning/scenarios/lane_follow/lane_follow_stage.cc
+39
-13
未找到文件。
modules/planning/scenarios/lane_follow/lane_follow_stage.cc
浏览文件 @
a793afad
...
...
@@ -304,28 +304,54 @@ void LaneFollowStage::PlanFallbackTrajectory(
void
LaneFollowStage
::
GenerateFallbackPathProfile
(
const
ReferenceLineInfo
*
reference_line_info
,
PathData
*
path_data
)
{
auto
adc_point
=
EgoInfo
::
Instance
()
->
start_point
();
double
adc_s
=
reference_line_info
->
AdcSlBoundary
().
end_s
();
const
double
max_s
=
150.0
;
const
double
unit_s
=
1.0
;
const
auto
&
reference_line
=
reference_line_info
->
reference_line
();
// projection of adc point onto reference line
const
auto
&
adc_ref_point
=
reference_line_info
->
reference_line
().
GetReferencePoint
(
adc_s
);
auto
adc_point
=
EgoInfo
::
Instance
()
->
start_point
();
DCHECK
(
adc_point
.
has_path_point
());
const
double
dx
=
adc_point
.
path_point
().
x
()
-
adc_ref_point
.
x
();
const
double
dy
=
adc_point
.
path_point
().
y
()
-
adc_ref_point
.
y
();
const
auto
adc_point_x
=
adc_point
.
path_point
().
x
();
const
auto
adc_point_y
=
adc_point
.
path_point
().
y
();
common
::
SLPoint
adc_point_s_l
;
if
(
!
reference_line
.
XYToSL
({
adc_point_x
,
adc_point_y
},
&
adc_point_s_l
))
{
AERROR
<<
"Fail to project ADC to reference line when calculating path "
"fallback. Straight forward path is generated"
;
const
auto
adc_point_heading
=
adc_point
.
path_point
().
theta
();
const
auto
adc_point_kappa
=
adc_point
.
path_point
().
kappa
();
const
auto
adc_point_dkappa
=
adc_point
.
path_point
().
dkappa
();
std
::
vector
<
common
::
PathPoint
>
path_points
;
double
adc_traversed_x
=
adc_point_x
;
double
adc_traversed_y
=
adc_point_y
;
const
double
max_s
=
100.0
;
for
(
double
s
=
0
;
s
<
max_s
;
s
+=
unit_s
)
{
common
::
PathPoint
path_point
=
common
::
util
::
MakePathPoint
(
adc_traversed_x
,
adc_traversed_y
,
0.0
,
adc_point_heading
,
adc_point_kappa
,
adc_point_dkappa
,
0.0
);
path_point
.
set_s
(
s
);
path_points
.
push_back
(
std
::
move
(
path_point
));
adc_traversed_x
+=
unit_s
*
std
::
cos
(
adc_point_heading
);
adc_traversed_y
+=
unit_s
*
std
::
sin
(
adc_point_heading
);
}
path_data
->
SetDiscretizedPath
(
DiscretizedPath
(
std
::
move
(
path_points
)));
return
;
}
// Generate a fallback path along the reference line direction
const
auto
adc_s
=
adc_point_s_l
.
s
();
const
auto
&
adc_ref_point
=
reference_line
.
GetReferencePoint
(
adc_point_x
,
adc_point_y
);
const
double
dx
=
adc_point_x
-
adc_ref_point
.
x
();
const
double
dy
=
adc_point_y
-
adc_ref_point
.
y
();
std
::
vector
<
common
::
PathPoint
>
path_points
;
const
double
max_s
=
reference_line
.
Length
();
for
(
double
s
=
adc_s
;
s
<
max_s
;
s
+=
unit_s
)
{
const
auto
&
ref_point
=
reference_line_info
->
reference_line
().
GetReferencePoint
(
adc_s
);
const
auto
&
ref_point
=
reference_line
.
GetReferencePoint
(
s
);
common
::
PathPoint
path_point
=
common
::
util
::
MakePathPoint
(
ref_point
.
x
()
+
dx
,
ref_point
.
y
()
+
dy
,
0.0
,
ref_point
.
heading
(),
ref_point
.
kappa
(),
ref_point
.
dkappa
(),
0.0
);
path_point
.
set_s
(
s
);
path_point
.
set_s
(
s
-
adc_s
);
path_points
.
push_back
(
std
::
move
(
path_point
));
}
path_data
->
SetDiscretizedPath
(
DiscretizedPath
(
std
::
move
(
path_points
)));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录