Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
fab256bc
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,发现更多精彩内容 >>
提交
fab256bc
编写于
8月 01, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
8月 01, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
restructured qp_spline_st_graph.
上级
85121b6c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
44 addition
and
11 deletion
+44
-11
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
...anning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
+33
-10
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.h
...lanning/optimizer/qp_spline_st_speed/qp_spline_st_graph.h
+11
-1
未找到文件。
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
浏览文件 @
fab256bc
...
...
@@ -25,7 +25,7 @@
#include <utility>
#include "modules/common/log.h"
#include "modules/planning/common/planning_util.h"
namespace
apollo
{
namespace
planning
{
...
...
@@ -41,6 +41,17 @@ QpSplineStGraph::QpSplineStGraph(
_qp_spline_st_speed_config
.
total_time
()
/
_qp_spline_st_speed_config
.
number_of_discrete_graph_t
())
{}
void
QpSplineStGraph
::
Init
()
{
double
curr_t
=
0.0
;
for
(
uint32_t
i
=
0
;
i
<=
_qp_spline_st_speed_config
.
number_of_discrete_graph_t
();
++
i
)
{
t_knots_
.
push_back
(
curr_t
);
curr_t
+=
time_resolution_
;
}
_spline_generator
.
reset
(
new
Spline1dGenerator
(
t_knots_
,
_qp_spline_st_speed_config
.
spline_order
()));
}
Status
QpSplineStGraph
::
search
(
const
StGraphData
&
st_graph_data
,
const
PathData
&
path_data
,
SpeedData
*
const
speed_data
)
{
...
...
@@ -53,16 +64,9 @@ Status QpSplineStGraph::search(const StGraphData& st_graph_data,
// TODO(all): update speed limit here
// TODO(all): update config through veh physical limit here generate knots
std
::
vector
<
double
>
t_knots
;
double
curr_knot
=
0.0
;
for
(
uint32_t
i
=
0
;
i
<=
_qp_spline_st_speed_config
.
number_of_discrete_graph_t
();
++
i
)
{
t_knots
.
push_back
(
curr_knot
);
curr_knot
+=
time_resolution_
;
}
_spline_generator
.
reset
(
new
Spline1dGenerator
(
t_knots
,
_qp_spline_st_speed_config
.
spline_order
())
);
// initialize time resolution and
Init
(
);
if
(
!
apply_constraint
(
st_graph_data
.
obs_boundary
()).
ok
())
{
const
std
::
string
msg
=
"Apply constraint failed!"
;
...
...
@@ -222,6 +226,25 @@ Status QpSplineStGraph::solve() {
:
Status
(
ErrorCode
::
PLANNING_ERROR
,
"QpSplineStGraph::solve"
);
}
Status
QpSplineStGraph
::
AddFollowReferenceLineKernel
(
const
StGraphBoundary
&
follow_boundary
)
{
if
(
follow_boundary
.
boundary_type
()
!=
StGraphBoundary
::
BoundaryType
::
FOLLOW
)
{
std
::
string
msg
=
common
::
util
::
StrCat
(
"Fail to add follow reference line kernel because boundary type is "
,
"incorrect. type: "
,
static_cast
<
int
>
(
follow_boundary
.
boundary_type
()),
"."
);
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
// TODO: (Liangliang) implement this dummy function.
auto
*
spline_kernel
=
_spline_generator
->
mutable_spline_kernel
();
const
std
::
vector
<
double
>
t_coord
;
const
std
::
vector
<
double
>
ref_s
;
spline_kernel
->
add_reference_line_kernel_matrix
(
t_coord
,
ref_s
,
1.0
);
return
Status
::
OK
();
}
Status
QpSplineStGraph
::
get_s_constraints_by_time
(
const
std
::
vector
<
StGraphBoundary
>&
boundaries
,
const
double
time
,
const
double
total_path_s
,
double
*
const
s_upper_bound
,
...
...
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.h
浏览文件 @
fab256bc
...
...
@@ -26,10 +26,12 @@
#include "modules/common/configs/proto/vehicle_config.pb.h"
#include "modules/common/proto/pnc_point.pb.h"
#include "modules/common/status/status.h"
#include "modules/planning/proto/qp_spline_st_speed_config.pb.h"
#include "modules/common/status/status.h"
#include "modules/common/util/string_util.h"
#include "modules/planning/common/path/path_data.h"
#include "modules/planning/common/planning_util.h"
#include "modules/planning/common/speed/speed_data.h"
#include "modules/planning/math/smoothing_spline/spline_1d_generator.h"
#include "modules/planning/optimizer/st_graph/st_graph_boundary.h"
...
...
@@ -47,6 +49,8 @@ class QpSplineStGraph {
const
PathData
&
path_data
,
SpeedData
*
const
speed_data
);
private:
void
Init
();
// apply st graph constraint
common
::
Status
apply_constraint
(
const
std
::
vector
<
StGraphBoundary
>&
boundaries
);
...
...
@@ -66,6 +70,9 @@ class QpSplineStGraph {
// generate reference speed profile
common
::
Status
apply_reference_speed_profile
();
common
::
Status
AddFollowReferenceLineKernel
(
const
StGraphBoundary
&
follow_boundary
);
private:
// qp st configuration
QpSplineStSpeedConfig
_qp_spline_st_speed_config
;
...
...
@@ -78,6 +85,9 @@ class QpSplineStGraph {
// time resolution
double
time_resolution_
=
0.0
;
// t_knots
std
::
vector
<
double
>
t_knots_
;
};
}
// namespace planning
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录