Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
1f681f44
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,发现更多精彩内容 >>
提交
1f681f44
编写于
9月 02, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
9月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: moved slowdown profile generation to speed_optimizer.cc
上级
754e683a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
36 addition
and
34 deletion
+36
-34
modules/planning/tasks/qp_spline_st_speed/qp_spline_st_speed_optimizer.cc
.../tasks/qp_spline_st_speed/qp_spline_st_speed_optimizer.cc
+2
-29
modules/planning/tasks/speed_optimizer.cc
modules/planning/tasks/speed_optimizer.cc
+27
-0
modules/planning/tasks/speed_optimizer.h
modules/planning/tasks/speed_optimizer.h
+7
-5
未找到文件。
modules/planning/tasks/qp_spline_st_speed/qp_spline_st_speed_optimizer.cc
浏览文件 @
1f681f44
...
...
@@ -110,40 +110,13 @@ Status QpSplineStSpeedOptimizer::Process(const SLBoundary& adc_sl_boundary,
Status
::
OK
())
{
std
::
string
msg
=
common
::
util
::
StrCat
(
Name
(),
":Failed to search graph with quadratic programming!"
);
if
(
FLAGS_enable_slowdown_profile_generator
&&
init_point
.
v
()
>
FLAGS_slowdown_speed_threshold
)
{
GenerateStopProfile
(
init_point
.
v
(),
speed_data
);
}
else
{
RecordSTGraphDebug
(
boundaries
,
speed_limits
,
*
speed_data
,
st_graph_debug
);
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
}
// record debug info
RecordSTGraphDebug
(
boundaries
,
speed_limits
,
*
speed_data
,
st_graph_debug
);
return
Status
::
OK
();
}
void
QpSplineStSpeedOptimizer
::
GenerateStopProfile
(
const
double
init_speed
,
SpeedData
*
const
speed_data
)
const
{
AERROR
<<
"Slowing down the car."
;
*
speed_data
=
SpeedData
();
const
double
min_acc
=
FLAGS_slowdown_profile_deceleration
;
const
size_t
max_t
=
3.0
;
const
double
unit_t
=
0.02
;
double
pre_s
=
0.0
;
double
t
=
0.0
;
while
(
t
<
max_t
)
{
const
double
s
=
std
::
fmax
(
pre_s
,
init_speed
*
t
+
0.5
*
min_acc
*
t
*
t
);
const
double
v
=
std
::
fmax
(
0.0
,
init_speed
+
min_acc
*
t
);
speed_data
->
AppendSpeedPoint
(
s
,
t
,
v
,
min_acc
,
0.0
);
pre_s
=
s
;
t
+=
unit_t
;
}
}
}
// namespace planning
}
// namespace apollo
modules/planning/tasks/speed_optimizer.cc
浏览文件 @
1f681f44
...
...
@@ -38,10 +38,37 @@ apollo::common::Status SpeedOptimizer::Execute(
frame
->
PlanningStartPoint
(),
reference_line_info
->
reference_line
(),
reference_line_info
->
path_decision
(),
reference_line_info
->
mutable_speed_data
());
if
(
!
ret
.
ok
()
&&
FLAGS_enable_slowdown_profile_generator
&&
frame
->
PlanningStartPoint
().
v
()
>
FLAGS_slowdown_speed_threshold
)
{
*
reference_line_info
->
mutable_speed_data
()
=
GenerateStopProfile
(
frame
->
PlanningStartPoint
().
v
());
}
RecordDebugInfo
(
reference_line_info
->
speed_data
());
return
ret
;
}
SpeedData
SpeedOptimizer
::
GenerateStopProfile
(
const
double
init_speed
)
const
{
AERROR
<<
"Slowing down the car."
;
SpeedData
speed_data
;
const
double
min_acc
=
FLAGS_slowdown_profile_deceleration
;
const
size_t
max_t
=
3.0
;
const
double
unit_t
=
0.02
;
double
pre_s
=
0.0
;
double
t
=
0.0
;
while
(
t
<
max_t
)
{
const
double
s
=
std
::
fmax
(
pre_s
,
init_speed
*
t
+
0.5
*
min_acc
*
t
*
t
);
const
double
v
=
std
::
fmax
(
0.0
,
init_speed
+
min_acc
*
t
);
speed_data
.
AppendSpeedPoint
(
s
,
t
,
v
,
min_acc
,
0.0
);
pre_s
=
s
;
t
+=
unit_t
;
}
return
speed_data
;
}
void
SpeedOptimizer
::
RecordDebugInfo
(
const
SpeedData
&
speed_data
)
{
auto
debug
=
frame_
->
MutableADCTrajectory
()
->
mutable_debug
();
auto
ptr_speed_plan
=
debug
->
mutable_planning_data
()
->
add_speed_plan
();
...
...
modules/planning/tasks/speed_optimizer.h
浏览文件 @
1f681f44
...
...
@@ -26,8 +26,8 @@
#include "modules/common/status/status.h"
#include "modules/planning/common/speed/speed_data.h"
#include "modules/planning/common/speed_limit.h"
#include "modules/planning/common/speed/st_boundary.h"
#include "modules/planning/common/speed_limit.h"
#include "modules/planning/tasks/task.h"
namespace
apollo
{
...
...
@@ -47,8 +47,10 @@ class SpeedOptimizer : public Task {
const
ReferenceLine
&
reference_line
,
PathDecision
*
const
path_decision
,
SpeedData
*
const
speed_data
)
=
0
;
void
RecordSTGraphDebug
(
const
std
::
vector
<
StBoundary
>&
boundaries
,
const
SpeedLimit
&
speed_limits
,
SpeedData
GenerateStopProfile
(
const
double
init_speed
)
const
;
void
RecordSTGraphDebug
(
const
std
::
vector
<
StBoundary
>&
boundaries
,
const
SpeedLimit
&
speed_limits
,
const
SpeedData
&
speed_data
,
::
apollo
::
planning_internal
::
STGraphDebug
*
stGraphDebug
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录