Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
d40d867d
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 搜索 >>
提交
d40d867d
编写于
7月 26, 2017
作者:
L
lianglia-apollo
提交者:
Dong Li
7月 26, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changed path_sampler. (#56)
上级
8e342244
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
46 deletion
+31
-46
modules/planning/common/path/frenet_frame_path.h
modules/planning/common/path/frenet_frame_path.h
+0
-7
modules/planning/conf/dp_poly_path_config.pb.txt
modules/planning/conf/dp_poly_path_config.pb.txt
+1
-1
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
+2
-0
modules/planning/optimizer/dp_poly_path/path_sampler.cc
modules/planning/optimizer/dp_poly_path/path_sampler.cc
+28
-38
未找到文件。
modules/planning/common/path/frenet_frame_path.h
浏览文件 @
d40d867d
...
...
@@ -31,21 +31,14 @@ namespace planning {
class
FrenetFramePath
{
public:
FrenetFramePath
()
=
default
;
explicit
FrenetFramePath
(
std
::
vector
<
common
::
FrenetFramePoint
>
sl_points
);
virtual
~
FrenetFramePath
()
=
default
;
void
set_frenet_points
(
const
std
::
vector
<
common
::
FrenetFramePoint
>
&
points
);
std
::
vector
<
common
::
FrenetFramePoint
>
*
mutable_points
();
const
std
::
vector
<
common
::
FrenetFramePoint
>
&
points
()
const
;
std
::
uint32_t
num_points
()
const
;
const
common
::
FrenetFramePoint
&
point_at
(
const
std
::
uint32_t
index
)
const
;
common
::
FrenetFramePoint
&
point_at
(
const
std
::
uint32_t
index
);
private:
...
...
modules/planning/conf/dp_poly_path_config.pb.txt
浏览文件 @
d40d867d
sample_level: 8
sample_points_num_each_level:
9
sample_points_num_each_level:
1
step_length_max: 10.0
step_length_min: 5.0
lateral_sample_offset: 0.5
...
...
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
浏览文件 @
d40d867d
...
...
@@ -52,6 +52,7 @@ DpRoadGraph::DpRoadGraph(const DpPolyPathConfig &config,
Status
DpRoadGraph
::
find_tunnel
(
const
ReferenceLine
&
reference_line
,
DecisionData
*
const
decision_data
,
PathData
*
const
path_data
)
{
CHECK_NOTNULL
(
decision_data
);
CHECK_NOTNULL
(
path_data
);
if
(
!
init
(
reference_line
))
{
const
std
::
string
msg
=
"Fail to init dp road graph!"
;
...
...
@@ -147,6 +148,7 @@ Status DpRoadGraph::find_tunnel(const ReferenceLine &reference_line,
bool
DpRoadGraph
::
init
(
const
ReferenceLine
&
reference_line
)
{
_vertices
.
clear
();
_edges
.
clear
();
_init_point
.
Clear
();
common
::
math
::
Vec2d
xy_point
(
_init_point
.
path_point
().
x
(),
_init_point
.
path_point
().
y
());
...
...
modules/planning/optimizer/dp_poly_path/path_sampler.cc
浏览文件 @
d40d867d
...
...
@@ -18,18 +18,23 @@
* @file sampler.cpp
**/
#include <algorithm>
#include <vector>
#include <memory>
#include <cmath>
#include <memory>
#include <vector>
#include "modules/planning/optimizer/dp_poly_path/path_sampler.h"
#include "modules/common/proto/path_point.pb.h"
#include "modules/common/util/util.h"
namespace
apollo
{
namespace
planning
{
using
apollo
::
common
::
Status
;
using
Status
=
apollo
::
common
::
Status
;
using
SLPoint
=
apollo
::
common
::
SLPoint
;
PathSampler
::
PathSampler
(
const
DpPolyPathConfig
&
config
)
:
_config
(
config
)
{}
PathSampler
::
PathSampler
(
const
DpPolyPathConfig
&
config
)
:
_config
(
config
)
{}
Status
PathSampler
::
sample
(
const
ReferenceLine
&
reference_line
,
...
...
@@ -39,45 +44,30 @@ Status PathSampler::sample(
CHECK_NOTNULL
(
points
);
const
double
reference_line_length
=
reference_line
.
reference_map_line
().
accumulated_s
().
back
();
const
double
lateral_sample_offset
=
_config
.
lateral_sample_offset
();
double
step_length
=
init_point
.
v
();
step_length
=
std
::
min
(
step_length
,
_config
.
step_length_max
());
step_length
=
std
::
max
(
step_length
,
_config
.
step_length_min
());
double
center_l
=
init_sl_point
.
l
();
double
level_distance
=
std
::
fmax
(
_config
.
step_length_min
(),
std
::
fmin
(
init_point
.
v
(),
_config
.
step_length_max
()));
double
accumulated_s
=
init_sl_point
.
s
();
for
(
size_t
i
=
0
;
i
<
_config
.
sample_level
();
++
i
)
{
std
::
vector
<::
apollo
::
common
::
SLPoint
>
level_points
;
if
(
std
::
abs
(
center_l
)
<
lateral_sample_offset
)
{
center_l
=
0.0
;
}
else
{
center_l
=
center_l
*
_config
.
lateral_adjust_coeff
();
}
accumulated_s
+=
step_length
;
const
double
level_start_l
=
center_l
-
lateral_sample_offset
*
(
_config
.
sample_points_num_each_level
()
-
1
)
/
2
;
for
(
size_t
j
=
0
;
j
<
_config
.
sample_points_num_each_level
();
++
j
)
{
::
apollo
::
common
::
SLPoint
sl_point
;
sl_point
.
set_s
(
accumulated_s
);
sl_point
.
set_l
(
level_start_l
+
j
*
lateral_sample_offset
);
if
(
reference_line
.
is_on_road
(
sl_point
))
{
level_points
.
push_back
(
sl_point
);
for
(
size_t
i
=
0
;
i
<
_config
.
sample_level
()
&&
accumulated_s
<
reference_line_length
;
++
i
)
{
std
::
vector
<
SLPoint
>
level_points
;
accumulated_s
+=
level_distance
;
double
s
=
std
::
fmin
(
accumulated_s
,
reference_line_length
);
int32_t
num
=
static_cast
<
int32_t
>
(
_config
.
sample_points_num_each_level
()
/
2
);
for
(
int32_t
j
=
-
num
;
j
<
num
+
1
;
++
j
)
{
double
l
=
_config
.
lateral_sample_offset
()
*
j
;
SLPoint
sl
=
common
::
util
::
MakeSLPoint
(
s
,
l
);
if
(
reference_line
.
is_on_road
(
sl
))
{
level_points
.
push_back
(
sl
);
}
}
if
(
level_points
.
empty
())
{
const
double
level_s
=
std
::
fmin
(
accumulated_s
,
reference_line_length
);
for
(
const
auto
level_l
:
{
-
lateral_sample_offset
,
0.0
,
lateral_sample_offset
})
{
::
apollo
::
common
::
SLPoint
sl_point
;
sl_point
.
set_s
(
level_s
);
sl_point
.
set_l
(
level_l
);
level_points
.
push_back
(
sl_point
);
}
if
(
accumulated_s
>
reference_line_length
)
{
return
Status
::
OK
();
}
}
points
->
push_back
(
level_points
);
}
return
Status
::
OK
();
}
}
// namespace planning
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录