Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
734622b4
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 搜索 >>
提交
734622b4
编写于
4月 04, 2018
作者:
Y
YajiaZhang
提交者:
Kecheng Xu
4月 04, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: trajectory evaluator fixed reference trajectory genration
上级
a8af95bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
59 addition
and
27 deletion
+59
-27
modules/planning/lattice/trajectory_generation/trajectory_evaluator.cc
...ing/lattice/trajectory_generation/trajectory_evaluator.cc
+59
-27
未找到文件。
modules/planning/lattice/trajectory_generation/trajectory_evaluator.cc
浏览文件 @
734622b4
...
...
@@ -514,42 +514,74 @@ double TrajectoryEvaluator::CentripetalAccelerationCost(
std
::
vector
<
double
>
TrajectoryEvaluator
::
ComputeLongitudinalGuideVelocity
(
const
PlanningTarget
&
planning_target
)
const
{
double
comfort_a
=
FLAGS_longitudinal_acceleration_lower_bound
*
FLAGS_comfort_acceleration_factor
;
std
::
vector
<
double
>
reference_s_dot
;
double
cruise_s_dot
=
planning_target
.
cruise_speed
();
double
brake_a
=
FLAGS_longitudinal_acceleration_lower_bound
*
FLAGS_comfort_acceleration_factor
;
ConstantAccelerationTrajectory1d
lon_traj
(
init_s_
[
0
],
cruise_s_dot
);
double
cruise_v
=
planning_target
.
cruise_speed
(
);
if
(
!
planning_target
.
has_stop_point
())
{
ConstantAccelerationTrajectory1d
lon_traj
(
init_s_
[
0
],
cruise_v
);
lon_traj
.
AppendSegment
(
0.0
,
FLAGS_trajectory_time_length
);
}
else
{
double
stop_a
=
FLAGS_longitudinal_acceleration_lower_bound
;
double
stop_s
=
planning_target
.
stop_point
().
s
();
double
dist
=
stop_s
-
init_s_
[
0
];
if
(
dist
>
FLAGS_lattice_epsilon
)
{
stop_a
=
-
cruise_s_dot
*
cruise_s_dot
*
0.5
/
dist
;
}
if
(
stop_a
>
comfort_a
)
{
double
stop_t
=
cruise_s_dot
/
(
-
comfort_a
);
double
stop_dist
=
cruise_s_dot
*
stop_t
*
0.5
;
double
cruise_t
=
(
dist
-
stop_dist
)
/
cruise_s_dot
;
lon_traj
.
AppendSegment
(
0.0
,
cruise_t
);
lon_traj
.
AppendSegment
(
comfort_a
,
stop_t
);
}
else
{
double
stop_t
=
cruise_s_dot
/
(
-
stop_a
);
lon_traj
.
AppendSegment
(
stop_a
,
stop_t
);
for
(
double
t
=
0.0
;
t
<
FLAGS_trajectory_time_length
;
t
+=
FLAGS_trajectory_time_resolution
)
{
reference_s_dot
.
push_back
(
lon_traj
.
Evaluate
(
1
,
t
));
}
if
(
lon_traj
.
ParamLength
()
<
FLAGS_trajectory_time_length
)
{
}
else
{
double
dist_s
=
planning_target
.
stop_point
().
s
()
-
init_s_
[
0
];
if
(
dist_s
<
FLAGS_lattice_epsilon
)
{
ConstantAccelerationTrajectory1d
lon_traj
(
init_s_
[
0
],
init_s_
[
1
]);
CHECK
(
init_s_
[
1
]
>
-
FLAGS_lattice_epsilon
);
double
brake_t
=
-
std
::
abs
(
init_s_
[
1
])
/
FLAGS_longitudinal_acceleration_lower_bound
;
lon_traj
.
AppendSegment
(
0.0
,
FLAGS_trajectory_time_length
-
lon_traj
.
ParamLength
());
FLAGS_longitudinal_acceleration_lower_bound
,
brake_t
);
if
(
lon_traj
.
ParamLength
()
<
FLAGS_trajectory_time_length
)
{
lon_traj
.
AppendSegment
(
0.0
,
FLAGS_trajectory_time_length
-
lon_traj
.
ParamLength
());
}
for
(
double
t
=
0.0
;
t
<
FLAGS_trajectory_time_length
;
t
+=
FLAGS_trajectory_time_resolution
)
{
reference_s_dot
.
push_back
(
lon_traj
.
Evaluate
(
1
,
t
));
}
return
reference_s_dot
;
}
}
std
::
vector
<
double
>
reference_s_dot
;
for
(
double
t
=
0.0
;
t
<
FLAGS_trajectory_time_length
;
t
+=
FLAGS_trajectory_time_resolution
)
{
reference_s_dot
.
push_back
(
lon_traj
.
Evaluate
(
1
,
t
));
double
max_v
=
std
::
sqrt
(
2.0
*
(
-
brake_a
)
*
dist_s
);
if
(
max_v
<
cruise_v
)
{
ConstantAccelerationTrajectory1d
lon_traj
(
init_s_
[
0
],
max_v
);
double
brake_t
=
max_v
/
(
-
brake_a
);
lon_traj
.
AppendSegment
(
brake_a
,
brake_t
);
if
(
lon_traj
.
ParamLength
()
<
FLAGS_trajectory_time_length
)
{
lon_traj
.
AppendSegment
(
0.0
,
FLAGS_trajectory_time_length
-
lon_traj
.
ParamLength
());
}
for
(
double
t
=
0.0
;
t
<
FLAGS_trajectory_time_length
;
t
+=
FLAGS_trajectory_time_resolution
)
{
reference_s_dot
.
push_back
(
lon_traj
.
Evaluate
(
1
,
t
));
}
}
else
{
double
brake_s
=
-
cruise_v
*
cruise_v
*
0.5
/
brake_a
;
double
brake_t
=
-
cruise_v
/
brake_a
;
double
cruise_s
=
dist_s
-
brake_s
;
double
cruise_t
=
cruise_s
/
cruise_v
;
ConstantAccelerationTrajectory1d
lon_traj
(
init_s_
[
0
],
cruise_v
);
lon_traj
.
AppendSegment
(
0.0
,
cruise_t
);
lon_traj
.
AppendSegment
(
brake_a
,
brake_t
);
if
(
lon_traj
.
ParamLength
()
<
FLAGS_trajectory_time_length
)
{
lon_traj
.
AppendSegment
(
0.0
,
FLAGS_trajectory_time_length
-
lon_traj
.
ParamLength
());
}
for
(
double
t
=
0.0
;
t
<
FLAGS_trajectory_time_length
;
t
+=
FLAGS_trajectory_time_resolution
)
{
reference_s_dot
.
push_back
(
lon_traj
.
Evaluate
(
1
,
t
));
}
}
}
return
reference_s_dot
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录