Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4e880861
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 搜索 >>
提交
4e880861
编写于
8月 07, 2017
作者:
F
fanhaoyang01
提交者:
Dong Li
8月 07, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature: add speed boundary for qp spline st optimizer
上级
8f05dd44
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
14 deletion
+24
-14
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
...anning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
+22
-12
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.h
...lanning/optimizer/qp_spline_st_speed/qp_spline_st_graph.h
+2
-2
未找到文件。
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
浏览文件 @
4e880861
...
...
@@ -187,18 +187,28 @@ Status QpSplineStGraph::ApplyConstraint(
}
if
(
!
constraint
->
add_fx_boundary
(
t_evaluated_
,
s_lower_bound
,
s_upper_bound
))
{
const
std
::
string
msg
=
"Fail to apply
obstacle constraint
"
;
const
std
::
string
msg
=
"Fail to apply
distance constraints.
"
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
std
::
vector
<
double
>
speed_
constraint
;
if
(
!
EstimateSpeed
Constraint
(
init_point
,
speed_limit
,
&
speed_constraint
)
std
::
vector
<
double
>
speed_
upper_bound
;
if
(
!
EstimateSpeed
UpperBound
(
init_point
,
speed_limit
,
&
speed_upper_bound
)
.
ok
())
{
std
::
string
msg
=
"Fail to estimate speed
constraint
."
;
std
::
string
msg
=
"Fail to estimate speed
upper constraints
."
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
std
::
vector
<
double
>
speed_lower_bound
(
t_evaluated_
.
size
(),
0.0
);
if
(
!
constraint
->
add_derivative_boundary
(
t_evaluated_
,
speed_lower_bound
,
speed_upper_bound
))
{
const
std
::
string
msg
=
"Fail to apply speed constraints."
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
return
Status
::
OK
();
}
...
...
@@ -309,11 +319,11 @@ Status QpSplineStGraph::GetSConstraintByTime(
return
Status
::
OK
();
}
Status
QpSplineStGraph
::
EstimateSpeed
Constraint
(
Status
QpSplineStGraph
::
EstimateSpeed
UpperBound
(
const
common
::
TrajectoryPoint
&
init_point
,
const
SpeedLimit
&
speed_limit
,
std
::
vector
<
double
>*
speed_
constraint
)
const
{
DCHECK_NOTNULL
(
speed_
constraint
);
speed_
constraint
->
clear
();
std
::
vector
<
double
>*
speed_
upper_bound
)
const
{
DCHECK_NOTNULL
(
speed_
upper_bound
);
speed_
upper_bound
->
clear
();
// use v to estimate position: not accurate, but feasible in cyclic
// processing. We can do the following process multiple times and use
...
...
@@ -327,19 +337,19 @@ Status QpSplineStGraph::EstimateSpeedConstraint(
while
(
i
<
t_evaluated_
.
size
()
&&
j
+
1
<
speed_limit
.
speed_points
().
size
())
{
distance
=
v
*
t_evaluated_
[
i
];
if
(
fabs
(
distance
-
speed_limit
.
speed_points
()[
j
].
s
())
<
kDistanceEpsilon
)
{
speed_
constraint
->
push_back
(
speed_limit
.
speed_points
()[
j
].
v
());
speed_
upper_bound
->
push_back
(
speed_limit
.
speed_points
()[
j
].
v
());
++
i
;
}
else
if
(
speed_limit
.
speed_points
()[
j
+
1
].
s
()
<
distance
)
{
++
j
;
}
else
{
speed_
constraint
->
push_back
(
speed_limit
.
get_speed_limit_by_s
(
distance
));
speed_
upper_bound
->
push_back
(
speed_limit
.
get_speed_limit_by_s
(
distance
));
++
i
;
}
}
for
(
uint32_t
k
=
speed_
constraint
->
size
()
-
1
;
k
<
t_evaluated_
.
size
();
for
(
uint32_t
k
=
speed_
upper_bound
->
size
()
-
1
;
k
<
t_evaluated_
.
size
();
++
k
)
{
speed_
constraint
->
push_back
(
qp_spline_st_speed_config_
.
max_speed
());
speed_
upper_bound
->
push_back
(
qp_spline_st_speed_config_
.
max_speed
());
}
return
Status
::
OK
();
}
...
...
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.h
浏览文件 @
4e880861
...
...
@@ -75,9 +75,9 @@ class QpSplineStGraph {
common
::
Status
AddFollowReferenceLineKernel
(
const
StGraphBoundary
&
follow_boundary
);
common
::
Status
EstimateSpeed
Constraint
(
common
::
Status
EstimateSpeed
UpperBound
(
const
common
::
TrajectoryPoint
&
init_point
,
const
SpeedLimit
&
speed_limit
,
std
::
vector
<
double
>*
speed_
constraint
)
const
;
std
::
vector
<
double
>*
speed_
upper_bound
)
const
;
private:
// qp st configuration
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录