Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
32401259
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,发现更多精彩内容 >>
提交
32401259
编写于
8月 30, 2017
作者:
L
lianglia-apollo
提交者:
Jiaming Tao
8月 30, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: improved the smoothness of reference line smoother. (#1362)
上级
a4acd9dc
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
5161 addition
and
5162 deletion
+5161
-5162
modules/planning/conf/planning_config.pb.txt
modules/planning/conf/planning_config.pb.txt
+3
-3
modules/planning/reference_line/reference_line_smoother.cc
modules/planning/reference_line/reference_line_smoother.cc
+12
-13
modules/planning/reference_line/reference_line_smoother.h
modules/planning/reference_line/reference_line_smoother.h
+5
-5
modules/planning/reference_line/reference_line_smoother_test.cc
...s/planning/reference_line/reference_line_smoother_test.cc
+1
-1
modules/planning/testdata/garage_test/result_follow_0.pb.txt
modules/planning/testdata/garage_test/result_follow_0.pb.txt
+641
-641
modules/planning/testdata/garage_test/result_stop_dest_0.pb.txt
...s/planning/testdata/garage_test/result_stop_dest_0.pb.txt
+1128
-1128
modules/planning/testdata/garage_test/result_stop_obstacle_0.pb.txt
...anning/testdata/garage_test/result_stop_obstacle_0.pb.txt
+1128
-1128
modules/planning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
...nning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
+1123
-1123
modules/planning/testdata/yongfengchanyeyuan_test/result_cruise_0.pb.txt
...g/testdata/yongfengchanyeyuan_test/result_cruise_0.pb.txt
+1120
-1120
未找到文件。
modules/planning/conf/planning_config.pb.txt
浏览文件 @
32401259
...
...
@@ -127,10 +127,10 @@ em_planner_config {
}
reference_line_smoother_config {
num_spline:
5
num_spline:
7
spline_order: 6
num_evaluated_points:
13
boundary_bound:
0.2
num_evaluated_points:
30
boundary_bound:
1.0
derivative_bound: 1.0
second_derivative_bound: 1.0
third_derivative_bound: 1.0
...
...
modules/planning/reference_line/reference_line_smoother.cc
浏览文件 @
32401259
...
...
@@ -57,7 +57,7 @@ bool ReferenceLineSmoother::Smooth(
ReferenceLine
*
const
smoothed_reference_line
)
{
Reset
();
std
::
vector
<
ReferencePoint
>
ref_points
;
if
(
!
s
ampling
(
raw_reference_line
))
{
if
(
!
S
ampling
(
raw_reference_line
))
{
AERROR
<<
"Fail to sample reference line smoother points!"
;
return
false
;
}
...
...
@@ -65,7 +65,7 @@ bool ReferenceLineSmoother::Smooth(
spline_solver_
.
reset
(
new
Spline2dSolver
(
t_knots_
,
smoother_config_
.
spline_order
()));
if
(
!
apply_c
onstraint
(
raw_reference_line
))
{
if
(
!
ApplyC
onstraint
(
raw_reference_line
))
{
AERROR
<<
"Add constraint for spline smoother failed"
;
return
false
;
}
...
...
@@ -130,7 +130,7 @@ bool ReferenceLineSmoother::Smooth(
return
true
;
}
bool
ReferenceLineSmoother
::
s
ampling
(
const
ReferenceLine
&
raw_reference_line
)
{
bool
ReferenceLineSmoother
::
S
ampling
(
const
ReferenceLine
&
raw_reference_line
)
{
const
double
length
=
raw_reference_line
.
Length
();
const
double
resolution
=
length
/
smoother_config_
.
num_spline
();
double
accumulated_s
=
0.0
;
...
...
@@ -150,7 +150,7 @@ bool ReferenceLineSmoother::sampling(const ReferenceLine& raw_reference_line) {
return
true
;
}
bool
ReferenceLineSmoother
::
apply_c
onstraint
(
bool
ReferenceLineSmoother
::
ApplyC
onstraint
(
const
ReferenceLine
&
raw_reference_line
)
{
const
double
t_length
=
t_knots_
.
back
()
-
t_knots_
.
front
();
const
double
dt
=
t_length
/
(
smoother_config_
.
num_evaluated_points
()
-
1
);
...
...
@@ -161,8 +161,7 @@ bool ReferenceLineSmoother::apply_constraint(
evaluated_t
.
push_back
(
accumulated_eval_t
);
}
std
::
vector
<
common
::
PathPoint
>
path_points
;
if
(
!
extract_evaluated_points
(
raw_reference_line
,
evaluated_t
,
&
path_points
))
{
if
(
!
ExtractEvaluatedPoints
(
raw_reference_line
,
evaluated_t
,
&
path_points
))
{
AERROR
<<
"Extract evaluated points failed"
;
return
false
;
}
...
...
@@ -203,7 +202,7 @@ bool ReferenceLineSmoother::apply_constraint(
}
if
(
!
spline_solver_
->
mutable_constraint
()
->
Add
Secon
dDerivativeSmoothConstraint
())
{
->
Add
Thir
dDerivativeSmoothConstraint
())
{
AERROR
<<
"Add jointness constraint failed"
;
return
false
;
}
...
...
@@ -236,12 +235,12 @@ bool ReferenceLineSmoother::ApplyKernel() {
bool
ReferenceLineSmoother
::
Solve
()
{
return
spline_solver_
->
Solve
();
}
bool
ReferenceLineSmoother
::
extract_evaluated_p
oints
(
bool
ReferenceLineSmoother
::
ExtractEvaluatedP
oints
(
const
ReferenceLine
&
raw_reference_line
,
const
std
::
vector
<
double
>&
vec_t
,
std
::
vector
<
common
::
PathPoint
>*
const
path_points
)
const
{
for
(
const
auto
t
:
vec_t
)
{
double
s
=
0.0
;
if
(
!
get_s_from_param_t
(
t
,
&
s
))
{
if
(
!
GetSFromParamT
(
t
,
&
s
))
{
AERROR
<<
"get s from "
<<
t
<<
" failed"
;
return
false
;
}
...
...
@@ -256,12 +255,12 @@ bool ReferenceLineSmoother::extract_evaluated_points(
return
true
;
}
bool
ReferenceLineSmoother
::
get_s_from_param_t
(
const
double
t
,
double
*
const
s
)
const
{
bool
ReferenceLineSmoother
::
GetSFromParamT
(
const
double
t
,
double
*
const
s
)
const
{
if
(
t_knots_
.
size
()
<
2
||
Double
::
Compare
(
t
,
t_knots_
.
back
(),
1e-8
)
>
0
)
{
return
false
;
}
std
::
uint32_t
lower
=
find_i
ndex
(
t
);
std
::
uint32_t
lower
=
FindI
ndex
(
t
);
std
::
uint32_t
upper
=
lower
+
1
;
double
weight
=
0.0
;
if
(
Double
::
Compare
(
t_knots_
[
upper
],
t_knots_
[
lower
],
1e-8
)
>
0
)
{
...
...
@@ -272,7 +271,7 @@ bool ReferenceLineSmoother::get_s_from_param_t(const double t,
return
true
;
}
std
::
uint32_t
ReferenceLineSmoother
::
find_i
ndex
(
const
double
t
)
const
{
std
::
uint32_t
ReferenceLineSmoother
::
FindI
ndex
(
const
double
t
)
const
{
auto
upper_bound
=
std
::
upper_bound
(
t_knots_
.
begin
()
+
1
,
t_knots_
.
end
(),
t
);
return
std
::
min
(
t_knots_
.
size
()
-
1
,
static_cast
<
std
::
size_t
>
(
upper_bound
-
t_knots_
.
begin
()))
-
...
...
modules/planning/reference_line/reference_line_smoother.h
浏览文件 @
32401259
...
...
@@ -45,21 +45,21 @@ class ReferenceLineSmoother {
private:
void
Reset
();
bool
s
ampling
(
const
ReferenceLine
&
raw_reference_line
);
bool
S
ampling
(
const
ReferenceLine
&
raw_reference_line
);
bool
apply_c
onstraint
(
const
ReferenceLine
&
raw_reference_line
);
bool
ApplyC
onstraint
(
const
ReferenceLine
&
raw_reference_line
);
bool
ApplyKernel
();
bool
Solve
();
bool
extract_evaluated_p
oints
(
bool
ExtractEvaluatedP
oints
(
const
ReferenceLine
&
raw_reference_line
,
const
std
::
vector
<
double
>&
vec_t
,
std
::
vector
<
common
::
PathPoint
>*
const
path_points
)
const
;
bool
get_s_from_param_t
(
const
double
t
,
double
*
const
s
)
const
;
bool
GetSFromParamT
(
const
double
t
,
double
*
const
s
)
const
;
std
::
uint32_t
find_i
ndex
(
const
double
t
)
const
;
std
::
uint32_t
FindI
ndex
(
const
double
t
)
const
;
private:
ReferenceLineSmootherConfig
smoother_config_
;
...
...
modules/planning/reference_line/reference_line_smoother_test.cc
浏览文件 @
32401259
...
...
@@ -74,7 +74,7 @@ TEST_F(ReferenceLineSmootherTest, smooth) {
ReferenceLine
smoothed_reference_line
;
EXPECT_FLOAT_EQ
(
153.87421
,
reference_line_
->
Length
());
EXPECT_TRUE
(
smoother_
.
Smooth
(
*
reference_line_
,
&
smoothed_reference_line
));
EXPECT_FLOAT_EQ
(
153.
3642
,
smoothed_reference_line
.
Length
());
EXPECT_FLOAT_EQ
(
153.
52716
,
smoothed_reference_line
.
Length
());
}
}
// namespace planning
...
...
modules/planning/testdata/garage_test/result_follow_0.pb.txt
浏览文件 @
32401259
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_dest_0.pb.txt
浏览文件 @
32401259
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_obstacle_0.pb.txt
浏览文件 @
32401259
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
浏览文件 @
32401259
此差异已折叠。
点击以展开。
modules/planning/testdata/yongfengchanyeyuan_test/result_cruise_0.pb.txt
浏览文件 @
32401259
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录