Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
f7aa4966
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,发现更多精彩内容 >>
提交
f7aa4966
编写于
9月 02, 2017
作者:
D
Dong Li
提交者:
lianglia-apollo
9月 12, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: refine qp_spline_path_generator code
上级
ceb2603e
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
5302 addition
and
5324 deletion
+5302
-5324
modules/planning/tasks/qp_spline_path/qp_spline_path_generator.cc
...planning/tasks/qp_spline_path/qp_spline_path_generator.cc
+18
-37
modules/planning/tasks/qp_spline_path/qp_spline_path_generator.h
.../planning/tasks/qp_spline_path/qp_spline_path_generator.h
+1
-4
modules/planning/testdata/garage_test/result_follow_0.pb.txt
modules/planning/testdata/garage_test/result_follow_0.pb.txt
+640
-640
modules/planning/testdata/garage_test/result_stop_dest_0.pb.txt
...s/planning/testdata/garage_test/result_stop_dest_0.pb.txt
+1122
-1122
modules/planning/testdata/garage_test/result_stop_obstacle_0.pb.txt
...anning/testdata/garage_test/result_stop_obstacle_0.pb.txt
+1120
-1120
modules/planning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
...nning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
+640
-640
modules/planning/testdata/sunnyvale_loop_test/result_follow_01_0.pb.txt
...ng/testdata/sunnyvale_loop_test/result_follow_01_0.pb.txt
+1121
-1121
modules/planning/testdata/sunnyvale_loop_test/result_nudge_0.pb.txt
...anning/testdata/sunnyvale_loop_test/result_nudge_0.pb.txt
+640
-640
未找到文件。
modules/planning/tasks/qp_spline_path/qp_spline_path_generator.cc
浏览文件 @
f7aa4966
...
...
@@ -64,12 +64,8 @@ bool QpSplinePathGenerator::Generate(
AERROR
<<
"Fail to map init point: "
<<
init_point
.
ShortDebugString
();
return
false
;
}
double
start_s
=
0.0
;
double
end_s
=
0.0
;
if
(
!
InitCoordRange
(
&
start_s
,
&
end_s
))
{
AERROR
<<
"Measure natural coord system with s range failed!"
;
return
false
;
}
double
start_s
=
init_frenet_point_
.
s
();
double
end_s
=
reference_line_
.
Length
();
QpFrenetFrame
qp_frenet_frame
(
reference_line_
,
path_obstacles
,
speed_data
,
init_frenet_point_
,
start_s
,
end_s
,
...
...
@@ -82,8 +78,7 @@ bool QpSplinePathGenerator::Generate(
ADEBUG
<<
"pss path start with "
<<
start_s
<<
", end with "
<<
end_s
;
constexpr
double
kSplineEndBuffer
=
0.1
;
if
(
!
InitSpline
(
init_frenet_point_
,
start_s
,
end_s
-
kSplineEndBuffer
))
{
if
(
!
InitSpline
(
start_s
,
end_s
))
{
AERROR
<<
"Init smoothing spline failed with ("
<<
start_s
<<
", end_s "
<<
end_s
;
return
false
;
...
...
@@ -196,36 +191,21 @@ bool QpSplinePathGenerator::CalculateInitFrenetPoint(
return
true
;
}
bool
QpSplinePathGenerator
::
InitCoordRange
(
double
*
const
start_s
,
double
*
const
end_s
)
{
DCHECK_NOTNULL
(
start_s
);
DCHECK_NOTNULL
(
end_s
);
*
start_s
=
init_frenet_point_
.
s
();
*
end_s
=
std
::
fmin
(
reference_line_
.
Length
(),
*
start_s
+
FLAGS_look_forward_distance
);
return
true
;
}
bool
QpSplinePathGenerator
::
InitSpline
(
const
common
::
FrenetFramePoint
&
init_frenet_point
,
const
double
start_s
,
const
double
end_s
)
{
bool
QpSplinePathGenerator
::
InitSpline
(
const
double
start_s
,
const
double
end_s
)
{
// set knots
if
(
qp_spline_path_config_
.
number_of_knots
()
<=
1
)
{
AERROR
<<
"Too few number of knots: "
<<
qp_spline_path_config_
.
number_of_knots
();
return
false
;
}
// reference_line_.map_path() always starts from zero?
double
distance
=
std
::
fmin
(
reference_line_
.
map_path
().
length
(),
end_s
)
-
init_frenet_point
.
s
();
distance
=
std
::
fmin
(
distance
,
FLAGS_look_forward_distance
);
const
double
delta_s
=
distance
/
qp_spline_path_config_
.
number_of_knots
();
double
curr_knot_s
=
init_frenet_point
.
s
();
for
(
uint32_t
i
=
0
;
i
<=
qp_spline_path_config_
.
number_of_knots
();
++
i
)
{
const
double
delta_s
=
(
end_s
-
start_s
)
/
qp_spline_path_config_
.
number_of_knots
();
double
curr_knot_s
=
start_s
;
for
(
uint32_t
i
=
0
;
i
<=
qp_spline_path_config_
.
number_of_knots
();
++
i
,
curr_knot_s
=
std
::
min
(
curr_knot_s
+
delta_s
,
end_s
))
{
knots_
.
push_back
(
curr_knot_s
);
curr_knot_s
+=
delta_s
;
}
// spawn a new spline generator
...
...
@@ -240,12 +220,13 @@ bool QpSplinePathGenerator::InitSpline(
<<
num_evaluated_s
;
return
false
;
}
const
double
ds
=
(
spline_generator_
->
spline
().
x_knots
().
back
()
-
spline_generator_
->
spline
().
x_knots
().
front
())
/
num_evaluated_s
;
double
curr_evaluated_s
=
spline_generator_
->
spline
().
x_knots
().
front
();
for
(
uint32_t
i
=
0
;
i
<
num_evaluated_s
;
++
i
)
{
const
auto
&
x_knots
=
spline_generator_
->
spline
().
x_knots
();
const
double
back_s
=
x_knots
.
back
();
const
double
front_s
=
x_knots
.
front
();
const
double
ds
=
(
back_s
-
front_s
)
/
num_evaluated_s
;
double
curr_evaluated_s
=
front_s
;
for
(
uint32_t
i
=
0
;
i
<
num_evaluated_s
;
++
i
,
curr_evaluated_s
=
std
::
min
(
curr_evaluated_s
+
ds
,
back_s
))
{
evaluated_s_
.
push_back
(
curr_evaluated_s
);
curr_evaluated_s
+=
ds
;
}
...
...
modules/planning/tasks/qp_spline_path/qp_spline_path_generator.h
浏览文件 @
f7aa4966
...
...
@@ -55,10 +55,7 @@ class QpSplinePathGenerator {
bool
CalculateInitFrenetPoint
(
const
common
::
TrajectoryPoint
&
traj_point
,
common
::
FrenetFramePoint
*
const
sl_point
);
bool
InitCoordRange
(
double
*
const
start_s
,
double
*
const
end_s
);
bool
InitSpline
(
const
common
::
FrenetFramePoint
&
init_frenet_point
,
const
double
start_s
,
const
double
end_s
);
bool
InitSpline
(
const
double
start_s
,
const
double
end_s
);
bool
AddConstraint
(
const
QpFrenetFrame
&
qp_frenet_frame
,
apollo
::
planning_internal
::
Debug
*
planning_debug
);
...
...
modules/planning/testdata/garage_test/result_follow_0.pb.txt
浏览文件 @
f7aa4966
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_dest_0.pb.txt
浏览文件 @
f7aa4966
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_obstacle_0.pb.txt
浏览文件 @
f7aa4966
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
浏览文件 @
f7aa4966
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_follow_01_0.pb.txt
浏览文件 @
f7aa4966
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_nudge_0.pb.txt
浏览文件 @
f7aa4966
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录