Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
58dda540
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,发现更多精彩内容 >>
提交
58dda540
编写于
2月 07, 2018
作者:
K
kechxu
提交者:
Kecheng Xu
2月 07, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: [lattice] add lat comfort cost
上级
2e78acea
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
1 deletion
+26
-1
modules/planning/common/planning_gflags.cc
modules/planning/common/planning_gflags.cc
+1
-0
modules/planning/common/planning_gflags.h
modules/planning/common/planning_gflags.h
+1
-0
modules/planning/lattice/trajectory_generator/trajectory_evaluator.cc
...ning/lattice/trajectory_generator/trajectory_evaluator.cc
+21
-1
modules/planning/lattice/trajectory_generator/trajectory_evaluator.h
...nning/lattice/trajectory_generator/trajectory_evaluator.h
+3
-0
未找到文件。
modules/planning/common/planning_gflags.cc
浏览文件 @
58dda540
...
...
@@ -405,6 +405,7 @@ DEFINE_double(weight_lon_jerk, 1.0, "Weight of longitudinal jerk cost");
DEFINE_double
(
weight_lon_collision
,
2.0
,
"Weight of logitudinal collision cost"
);
DEFINE_double
(
weight_lat_offset
,
2.0
,
"Weight of lateral offset cost"
);
DEFINE_double
(
weight_lat_comfort
,
10.0
,
"Weight of lateral comfort cost"
);
DEFINE_double
(
weight_same_side_offset
,
1.0
,
"Weight of same side lateral offset cost"
);
DEFINE_double
(
weight_opposite_side_offset
,
10.0
,
...
...
modules/planning/common/planning_gflags.h
浏览文件 @
58dda540
...
...
@@ -213,6 +213,7 @@ DECLARE_double(weight_lon_travel);
DECLARE_double
(
weight_lon_jerk
);
DECLARE_double
(
weight_lon_collision
);
DECLARE_double
(
weight_lat_offset
);
DECLARE_double
(
weight_lat_comfort
);
DECLARE_double
(
weight_same_side_offset
);
DECLARE_double
(
weight_opposite_side_offset
);
DECLARE_double
(
weight_dist_travelled
);
...
...
modules/planning/lattice/trajectory_generator/trajectory_evaluator.cc
浏览文件 @
58dda540
...
...
@@ -126,6 +126,7 @@ double TrajectoryEvaluator::Evaluate(
// 2. Cost of logitudinal jerk
// 3. Cost of logitudinal collision
// 4. Cost of lateral offsets
// 5. Cost of lateral comfort
// Longitudinal costs
double
lon_travel_cost
=
LonObjectiveCost
(
lon_trajectory
,
planning_target
);
...
...
@@ -140,6 +141,7 @@ double TrajectoryEvaluator::Evaluate(
// Lateral costs
double
lat_offset_cost
=
LatOffsetCost
(
lat_trajectory
,
s_values
);
double
lat_comfort_cost
=
LatComfortCost
(
lon_trajectory
,
lat_trajectory
);
if
(
cost_components
)
{
cost_components
->
push_back
(
lon_travel_cost
);
...
...
@@ -151,7 +153,8 @@ double TrajectoryEvaluator::Evaluate(
return
lon_travel_cost
*
FLAGS_weight_lon_travel
+
lon_jerk_cost
*
FLAGS_weight_lon_jerk
+
lon_collision_cost
*
FLAGS_weight_lon_collision
+
lat_offset_cost
*
FLAGS_weight_lat_offset
;
lat_offset_cost
*
FLAGS_weight_lat_offset
+
lat_comfort_cost
*
FLAGS_weight_lat_comfort
;
}
double
TrajectoryEvaluator
::
LatOffsetCost
(
...
...
@@ -174,6 +177,23 @@ double TrajectoryEvaluator::LatOffsetCost(
return
cost_sqr_sum
/
(
cost_abs_sum
+
FLAGS_lattice_epsilon
);
}
double
TrajectoryEvaluator
::
LatComfortCost
(
const
std
::
shared_ptr
<
Trajectory1d
>&
lon_trajectory
,
const
std
::
shared_ptr
<
Trajectory1d
>&
lat_trajectory
)
const
{
double
cost_sqr_sum
=
0.0
;
double
cost_abs_sum
=
0.0
;
for
(
double
t
=
0.0
;
t
<
FLAGS_trajectory_time_length
;
t
+=
FLAGS_trajectory_time_resolution
)
{
double
s
=
lon_trajectory
->
Evaluate
(
0
,
t
);
double
cost
=
lat_trajectory
->
Evaluate
(
1
,
s
)
*
lon_trajectory
->
Evaluate
(
1
,
t
)
/
FLAGS_default_cruise_speed
;
cost_sqr_sum
+=
cost
*
cost
;
cost_abs_sum
+=
std
::
abs
(
cost
);
}
return
cost_sqr_sum
/
(
cost_abs_sum
+
FLAGS_lattice_epsilon
);
}
double
TrajectoryEvaluator
::
LonComfortCost
(
const
std
::
shared_ptr
<
Trajectory1d
>&
lon_trajectory
)
const
{
double
cost_sqr_sum
=
0.0
;
...
...
modules/planning/lattice/trajectory_generator/trajectory_evaluator.h
浏览文件 @
58dda540
...
...
@@ -82,6 +82,9 @@ class TrajectoryEvaluator {
double
LatOffsetCost
(
const
std
::
shared_ptr
<
Curve1d
>&
lat_trajectory
,
const
std
::
vector
<
double
>&
s_values
)
const
;
double
LatComfortCost
(
const
std
::
shared_ptr
<
Curve1d
>&
lon_trajectory
,
const
std
::
shared_ptr
<
Curve1d
>&
lat_trajectory
)
const
;
double
LonComfortCost
(
const
std
::
shared_ptr
<
Curve1d
>&
lon_trajectory
)
const
;
double
LonCollisionCost
(
const
std
::
shared_ptr
<
Curve1d
>&
lon_trajectory
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录