Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
040707a8
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,发现更多精彩内容 >>
提交
040707a8
编写于
8月 08, 2017
作者:
Z
Zhang Liangliang
提交者:
Dong Li
8月 08, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: increase the precision when get_path_point_with_ref_s.
上级
fc3717a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
10 deletion
+26
-10
modules/planning/common/path/path_data.cc
modules/planning/common/path/path_data.cc
+26
-10
未找到文件。
modules/planning/common/path/path_data.cc
浏览文件 @
040707a8
...
...
@@ -90,24 +90,40 @@ bool PathData::get_path_point_with_ref_s(
const
double
ref_s
,
common
::
PathPoint
*
const
path_point
)
const
{
DCHECK_NOTNULL
(
reference_line_
);
DCHECK_NOTNULL
(
path_point
);
DCHECK_EQ
(
discretized_path_
.
path_points
().
size
(),
frenet_path_
.
points
().
size
());
DCHECK_EQ
(
discretized_path_
.
points
().
size
(),
frenet_path_
.
points
().
size
());
if
(
ref_s
<
0
)
{
AERROR
<<
"ref_s["
<<
ref_s
<<
"] should be > 0"
;
return
false
;
}
if
(
ref_s
>
frenet_path_
.
points
().
back
().
s
())
{
AERROR
<<
"ref_s is larger than the length of frenet_path_ length ["
<<
frenet_path_
.
points
().
back
().
s
()
<<
"]."
;
return
false
;
}
uint32_t
index
=
0
;
const
double
kDistanceEpsilon
=
1e-3
;
double
shortest_distance
=
std
::
numeric_limits
<
double
>::
max
();
for
(
uint32_t
i
=
0
;
i
<
frenet_path_
.
points
().
size
();
++
i
)
{
const
double
curr_distance
=
std
::
fabs
(
ref_s
-
frenet_path_
.
points
().
at
(
i
).
s
());
if
(
curr_distance
<
kDistanceEpsilon
)
{
path_point
->
CopyFrom
(
discretized_path_
.
PathPointAt
(
i
));
for
(
uint32_t
i
=
0
;
i
+
1
<
frenet_path_
.
points
().
size
();
++
i
)
{
if
(
fabs
(
ref_s
-
frenet_path_
.
points
().
at
(
i
).
s
())
<
kDistanceEpsilon
)
{
path_point
->
CopyFrom
(
discretized_path_
.
points
().
at
(
i
));
return
true
;
}
if
(
curr_distance
<
shortest_distance
)
{
if
(
frenet_path_
.
points
().
at
(
i
).
s
()
<
ref_s
&&
ref_s
<=
frenet_path_
.
points
().
at
(
i
+
1
).
s
())
{
index
=
i
;
shortest_distance
=
curr_distance
;
break
;
}
}
path_point
->
CopyFrom
(
discretized_path_
.
PathPointAt
(
index
));
double
r
=
(
ref_s
-
frenet_path_
.
points
().
at
(
index
).
s
())
/
(
frenet_path_
.
points
().
at
(
index
+
1
).
s
()
-
frenet_path_
.
points
().
at
(
index
).
s
());
const
double
discretized_path_s
=
discretized_path_
.
path_point_at
(
index
).
s
()
+
r
*
(
discretized_path_
.
path_point_at
(
index
+
1
).
s
()
-
discretized_path_
.
path_point_at
(
index
).
s
());
path_point
->
CopyFrom
(
discretized_path_
.
evaluate_linear_approximation
(
discretized_path_s
));
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录