Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
8d7884c5
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,发现更多精彩内容 >>
提交
8d7884c5
编写于
7月 27, 2017
作者:
D
Dong Li
提交者:
Jiangtao Hu
7月 27, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor path, discretized_path and frenet_frame_path
unify function names
上级
27042611
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
70 addition
and
75 deletion
+70
-75
modules/planning/common/path/discretized_path.cc
modules/planning/common/path/discretized_path.cc
+2
-6
modules/planning/common/path/discretized_path.h
modules/planning/common/path/discretized_path.h
+2
-4
modules/planning/common/path/frenet_frame_path.cc
modules/planning/common/path/frenet_frame_path.cc
+8
-5
modules/planning/common/path/frenet_frame_path.h
modules/planning/common/path/frenet_frame_path.h
+2
-2
modules/planning/common/path/path.h
modules/planning/common/path/path.h
+1
-1
modules/planning/common/path/path_data.cc
modules/planning/common/path/path_data.cc
+11
-11
modules/planning/common/path/path_data.h
modules/planning/common/path/path_data.h
+4
-8
modules/planning/common/planning_data.cc
modules/planning/common/planning_data.cc
+7
-5
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
+1
-2
modules/planning/optimizer/dp_poly_path/dp_road_graph_test.cc
...les/planning/optimizer/dp_poly_path/dp_road_graph_test.cc
+1
-1
modules/planning/optimizer/dp_st_speed/dp_st_boundary_mapper.cc
...s/planning/optimizer/dp_st_speed/dp_st_boundary_mapper.cc
+6
-4
modules/planning/optimizer/dp_st_speed/dp_st_speed_optimizer.cc
...s/planning/optimizer/dp_st_speed/dp_st_speed_optimizer.cc
+4
-4
modules/planning/optimizer/optimizer_test_base.cc
modules/planning/optimizer/optimizer_test_base.cc
+1
-1
modules/planning/optimizer/qp_spline_path/qp_spline_path_generator.cc
...ning/optimizer/qp_spline_path/qp_spline_path_generator.cc
+1
-1
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_boundary_mapper.cc
...imizer/qp_spline_st_speed/qp_spline_st_boundary_mapper.cc
+4
-4
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_speed_optimizer.cc
...imizer/qp_spline_st_speed/qp_spline_st_speed_optimizer.cc
+2
-2
modules/planning/optimizer/st_graph/st_boundary_mapper.cc
modules/planning/optimizer/st_graph/st_boundary_mapper.cc
+7
-8
modules/planning/planner/em/em_planner.cc
modules/planning/planner/em/em_planner.cc
+6
-6
未找到文件。
modules/planning/common/path/discretized_path.cc
浏览文件 @
8d7884c5
...
...
@@ -49,7 +49,7 @@ common::PathPoint DiscretizedPath::evaluate(const double param) const {
return
util
::
interpolate
(
*
(
it_lower
-
1
),
*
it_lower
,
param
);
}
double
DiscretizedPath
::
param_
length
()
const
{
double
DiscretizedPath
::
length
()
const
{
if
(
path_points_
.
empty
())
{
return
0.0
;
}
...
...
@@ -93,11 +93,7 @@ int DiscretizedPath::query_closest_point(const double param) const {
}
}
std
::
vector
<
common
::
PathPoint
>
*
DiscretizedPath
::
mutable_path_points
()
{
return
&
path_points_
;
}
const
std
::
vector
<
common
::
PathPoint
>
&
DiscretizedPath
::
path_points
()
const
{
const
std
::
vector
<
common
::
PathPoint
>
&
DiscretizedPath
::
points
()
const
{
return
path_points_
;
}
...
...
modules/planning/common/path/discretized_path.h
浏览文件 @
8d7884c5
...
...
@@ -40,7 +40,7 @@ class DiscretizedPath : public Path {
common
::
PathPoint
evaluate
(
const
double
param
)
const
override
;
double
param_
length
()
const
override
;
double
length
()
const
override
;
common
::
PathPoint
start_point
()
const
override
;
...
...
@@ -50,9 +50,7 @@ class DiscretizedPath : public Path {
int
query_closest_point
(
const
double
param
)
const
;
std
::
vector
<
common
::
PathPoint
>
*
mutable_path_points
();
const
std
::
vector
<
common
::
PathPoint
>
&
path_points
()
const
;
const
std
::
vector
<
common
::
PathPoint
>
&
points
()
const
;
std
::
uint32_t
num_of_points
()
const
;
...
...
modules/planning/common/path/frenet_frame_path.cc
浏览文件 @
8d7884c5
...
...
@@ -32,19 +32,22 @@ FrenetFramePath::FrenetFramePath(
points_
=
std
::
move
(
sl_points
);
}
void
FrenetFramePath
::
set_
frenet_
points
(
void
FrenetFramePath
::
set_points
(
const
std
::
vector
<
common
::
FrenetFramePoint
>
&
points
)
{
points_
=
points
;
}
std
::
vector
<
common
::
FrenetFramePoint
>
*
FrenetFramePath
::
mutable_points
()
{
return
&
points_
;
}
const
std
::
vector
<
common
::
FrenetFramePoint
>
&
FrenetFramePath
::
points
()
const
{
return
points_
;
}
double
FrenetFramePath
::
length
()
const
{
if
(
points_
.
empty
())
{
return
0.0
;
}
return
points_
.
back
().
s
()
-
points_
.
front
().
s
();
}
std
::
uint32_t
FrenetFramePath
::
number_of_points
()
const
{
return
points_
.
size
();
}
...
...
modules/planning/common/path/frenet_frame_path.h
浏览文件 @
8d7884c5
...
...
@@ -34,10 +34,10 @@ class FrenetFramePath {
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
();
void
set_points
(
const
std
::
vector
<
common
::
FrenetFramePoint
>
&
points
);
const
std
::
vector
<
common
::
FrenetFramePoint
>
&
points
()
const
;
std
::
uint32_t
number_of_points
()
const
;
double
length
()
const
;
const
common
::
FrenetFramePoint
&
point_at
(
const
std
::
uint32_t
index
)
const
;
common
::
FrenetFramePoint
&
point_at
(
const
std
::
uint32_t
index
);
...
...
modules/planning/common/path/path.h
浏览文件 @
8d7884c5
...
...
@@ -34,7 +34,7 @@ class Path {
virtual
common
::
PathPoint
evaluate
(
const
double
param
)
const
=
0
;
virtual
double
param_
length
()
const
=
0
;
virtual
double
length
()
const
=
0
;
virtual
common
::
PathPoint
start_point
()
const
=
0
;
...
...
modules/planning/common/path/path_data.cc
浏览文件 @
8d7884c5
...
...
@@ -31,22 +31,22 @@
namespace
apollo
{
namespace
planning
{
void
PathData
::
set_path
(
const
DiscretizedPath
&
path
)
{
path_
=
path
;
}
void
PathData
::
set_discretized_path
(
const
DiscretizedPath
&
path
)
{
discretized_path_
=
path
;
}
void
PathData
::
set_frenet_path
(
const
FrenetFramePath
&
frenet_path
)
{
frenet_path_
=
frenet_path
;
}
DiscretizedPath
*
PathData
::
mutable_path
()
{
return
&
path_
;
}
void
PathData
::
set_path_points
(
void
PathData
::
set_discretized_path
(
const
std
::
vector
<
common
::
PathPoint
>
&
path_points
)
{
path_
.
set_points
(
path_points
);
discretized_
path_
.
set_points
(
path_points
);
}
const
DiscretizedPath
&
PathData
::
path
()
const
{
return
path_
;
}
FrenetFramePath
*
PathData
::
mutable_frenet_frame_path
()
{
return
&
frenet_path_
;
}
const
DiscretizedPath
&
PathData
::
discretized_path
()
const
{
return
discretized_path_
;
}
const
FrenetFramePath
&
PathData
::
frenet_frame_path
()
const
{
return
frenet_path_
;
...
...
@@ -54,7 +54,7 @@ const FrenetFramePath &PathData::frenet_frame_path() const {
bool
PathData
::
get_path_point_with_path_s
(
const
double
s
,
common
::
PathPoint
*
const
path_point
)
const
{
*
path_point
=
path_
.
evaluate_linear_approximation
(
s
);
*
path_point
=
discretized_
path_
.
evaluate_linear_approximation
(
s
);
return
true
;
}
...
...
@@ -72,7 +72,7 @@ bool PathData::get_path_point_with_ref_s(
auto
it_lower
=
std
::
lower_bound
(
frenet_points
.
begin
(),
frenet_points
.
end
(),
ref_s
,
comp
);
if
(
it_lower
==
frenet_points
.
begin
())
{
*
path_point
=
path_
.
path_
points
().
front
();
*
path_point
=
discretized_path_
.
points
().
front
();
}
else
{
// std::uint32_t index_lower = (std::uint32_t)(it_lower -
// frenet_points.begin());
...
...
@@ -93,7 +93,7 @@ bool PathData::get_path_point_with_ref_s(
std
::
string
PathData
::
DebugString
()
const
{
std
::
ostringstream
sout
;
sout
<<
"["
<<
std
::
endl
;
const
auto
&
path_points
=
path_
.
path_
points
();
const
auto
&
path_points
=
discretized_path_
.
points
();
for
(
std
::
size_t
i
=
0
;
i
<
path_points
.
size
()
&&
i
<
static_cast
<
std
::
size_t
>
(
FLAGS_trajectory_point_num_for_debug
);
...
...
modules/planning/common/path/path_data.h
浏览文件 @
8d7884c5
...
...
@@ -33,17 +33,13 @@ class PathData {
public:
PathData
()
=
default
;
void
set_path
(
const
DiscretizedPath
&
path
);
void
set_
discretized_
path
(
const
DiscretizedPath
&
path
);
void
set_
path_points
(
const
std
::
vector
<
common
::
PathPoint
>
&
path_points
);
void
set_
discretized_path
(
const
std
::
vector
<
common
::
PathPoint
>
&
path_points
);
void
set_frenet_path
(
const
FrenetFramePath
&
frenet_path
);
DiscretizedPath
*
mutable_path
();
const
DiscretizedPath
&
path
()
const
;
FrenetFramePath
*
mutable_frenet_frame_path
();
const
DiscretizedPath
&
discretized_path
()
const
;
const
FrenetFramePath
&
frenet_frame_path
()
const
;
...
...
@@ -57,7 +53,7 @@ class PathData {
// TODO(fanhaoyang) add check if the path data is valid
private:
DiscretizedPath
path_
;
DiscretizedPath
discretized_
path_
;
FrenetFramePath
frenet_path_
;
};
...
...
modules/planning/common/planning_data.cc
浏览文件 @
8d7884c5
...
...
@@ -88,13 +88,15 @@ bool PlanningData::aggregate(const double time_resolution,
common
::
PathPoint
path_point
;
// TODO(all): temp fix speed point s out of path point bound, need further
// refine later
if
(
speed_point
.
s
()
>
path_data_
.
path
().
param_
length
())
{
if
(
speed_point
.
s
()
>
path_data_
.
discretized_path
().
length
())
{
break
;
}
QUIT_IF
(
!
path_data_
.
get_path_point_with_path_s
(
speed_point
.
s
(),
&
path_point
),
false
,
ERROR
,
"Fail to get path data with s %f, path total length %f"
,
speed_point
.
s
(),
path_data_
.
path
().
param_length
());
if
(
!
path_data_
.
get_path_point_with_path_s
(
speed_point
.
s
(),
&
path_point
))
{
AERROR
<<
"Fail to get path data with s "
<<
speed_point
.
s
()
<<
"path total length "
<<
path_data_
.
discretized_path
().
length
();
;
return
false
;
}
common
::
TrajectoryPoint
trajectory_point
;
trajectory_point
.
mutable_path_point
()
->
CopyFrom
(
path_point
);
...
...
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
浏览文件 @
8d7884c5
...
...
@@ -125,8 +125,7 @@ bool DpRoadGraph::find_tunnel(const ReferenceLine &reference_line,
}
path_points
.
push_back
(
std
::
move
(
path_point
));
}
DiscretizedPath
discretized_path
(
path_points
);
path_data
->
set_path
(
discretized_path
);
path_data
->
set_discretized_path
(
path_points
);
return
true
;
}
...
...
modules/planning/optimizer/dp_poly_path/dp_road_graph_test.cc
浏览文件 @
8d7884c5
...
...
@@ -86,7 +86,7 @@ TEST_F(DpRoadGraphTest, speed_road_graph) {
bool
result
=
road_graph
.
find_tunnel
(
*
reference_line_
,
&
decision_data_
,
&
path_data_
);
EXPECT_TRUE
(
result
);
EXPECT_EQ
(
706
,
path_data_
.
path
().
num_of_points
());
EXPECT_EQ
(
706
,
path_data_
.
discretized_
path
().
num_of_points
());
EXPECT_EQ
(
706
,
path_data_
.
frenet_frame_path
().
number_of_points
());
EXPECT_FLOAT_EQ
(
69.9
,
path_data_
.
frenet_frame_path
().
points
().
back
().
s
());
EXPECT_FLOAT_EQ
(
0.0
,
path_data_
.
frenet_frame_path
().
points
().
back
().
l
());
...
...
modules/planning/optimizer/dp_st_speed/dp_st_boundary_mapper.cc
浏览文件 @
8d7884c5
...
...
@@ -49,9 +49,9 @@ Status DpStBoundaryMapper::get_graph_boundary(
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
if
(
path_data
.
path
().
num_of_points
()
<
2
)
{
if
(
path_data
.
discretized_
path
().
num_of_points
()
<
2
)
{
AERROR
<<
"Fail to get params since path has "
<<
path_data
.
path
().
num_of_points
()
<<
" points."
;
<<
path_data
.
discretized_
path
().
num_of_points
()
<<
" points."
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
"Fail to get params"
);
}
...
...
@@ -103,7 +103,8 @@ Status DpStBoundaryMapper::map_obstacle_with_trajectory(
// lower and upper bound for st boundary
std
::
vector
<
STPoint
>
lower_points
;
std
::
vector
<
STPoint
>
upper_points
;
const
std
::
vector
<
PathPoint
>&
veh_path
=
path_data
.
path
().
path_points
();
const
std
::
vector
<
PathPoint
>&
veh_path
=
path_data
.
discretized_path
().
points
();
for
(
std
::
uint32_t
i
=
0
;
i
<
obstacle
.
prediction_trajectories
().
size
();
++
i
)
{
PredictionTrajectory
pred_traj
=
obstacle
.
prediction_trajectories
()[
i
];
...
...
@@ -181,7 +182,8 @@ Status DpStBoundaryMapper::map_obstacle_without_trajectory(
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
{
// Static obstacle only have yield option
const
std
::
vector
<
PathPoint
>&
veh_path
=
path_data
.
path
().
path_points
();
const
std
::
vector
<
PathPoint
>&
veh_path
=
path_data
.
discretized_path
().
points
();
::
apollo
::
common
::
math
::
Box2d
obs_box
=
obstacle
.
BoundingBox
();
...
...
modules/planning/optimizer/dp_st_speed/dp_st_speed_optimizer.cc
浏览文件 @
8d7884c5
...
...
@@ -65,9 +65,10 @@ Status DpStSpeedOptimizer::Process(const PathData& path_data,
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
"Not inited."
);
}
const
double
path_length
=
path_data
.
discretized_path
().
length
();
// step 1 get boundaries
double
planning_distance
=
std
::
min
(
dp_st_speed_config_
.
total_path_length
(),
path_data
.
path
().
param_length
()
);
double
planning_distance
=
std
::
min
(
dp_st_speed_config_
.
total_path_length
(),
path_length
);
std
::
vector
<
StGraphBoundary
>
boundaries
;
common
::
TrajectoryPoint
initial_planning_point
=
DataCenter
::
instance
()
->
current_frame
()
...
...
@@ -100,8 +101,7 @@ Status DpStSpeedOptimizer::Process(const PathData& path_data,
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
StGraphData
st_graph_data
(
boundaries
,
init_point
,
speed_limit
,
path_data
.
path
().
param_length
());
StGraphData
st_graph_data
(
boundaries
,
init_point
,
speed_limit
,
path_length
);
DpStGraph
st_graph
(
dp_st_speed_config_
);
if
(
!
st_graph
.
search
(
st_graph_data
,
decision_data
,
speed_data
).
ok
())
{
...
...
modules/planning/optimizer/optimizer_test_base.cc
浏览文件 @
8d7884c5
...
...
@@ -85,7 +85,7 @@ void OptimizerTestBase::export_path_data(const PathData& path_data,
std
::
ofstream
ofs
(
filename
);
ofs
<<
"s, l, dl, ddl, x, y, z"
<<
std
::
endl
;
const
auto
&
frenet_path
=
path_data
.
frenet_frame_path
();
const
auto
&
discrete_path
=
path_data
.
path
();
const
auto
&
discrete_path
=
path_data
.
discretized_
path
();
if
(
frenet_path
.
number_of_points
()
!=
discrete_path
.
num_of_points
())
{
AERROR
<<
"frenet_path and discrete path have different number of points"
;
return
;
...
...
modules/planning/optimizer/qp_spline_path/qp_spline_path_generator.cc
浏览文件 @
8d7884c5
...
...
@@ -134,7 +134,7 @@ bool QpSplinePathGenerator::generate(const ReferenceLine& reference_line,
path_points
.
push_back
(
std
::
move
(
path_point
));
s
+=
s_resolution
;
}
path_data
->
set_
path_points
(
path_points
);
path_data
->
set_
discretized_path
(
path_points
);
return
true
;
}
...
...
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_boundary_mapper.cc
浏览文件 @
8d7884c5
...
...
@@ -67,10 +67,10 @@ Status QpSplineStBoundaryMapper::get_graph_boundary(
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
if
(
path_data
.
path
().
num_of_points
()
<
2
)
{
if
(
path_data
.
discretized_
path
().
num_of_points
()
<
2
)
{
AERROR
<<
"Fail to get params because of too few path points. path points "
"size: "
<<
path_data
.
path
().
num_of_points
()
<<
"."
;
<<
path_data
.
discretized_
path
().
num_of_points
()
<<
"."
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
"Fail to get params because of too few path points"
);
}
...
...
@@ -250,7 +250,7 @@ Status QpSplineStBoundaryMapper::map_obstacle_with_prediction_trajectory(
bool
skip
=
true
;
std
::
vector
<
STPoint
>
boundary_points
;
const
auto
&
adc_path_points
=
path_data
.
path
().
path_
points
();
const
auto
&
adc_path_points
=
path_data
.
discretized_path
().
points
();
if
(
obstacle
.
prediction_trajectories
().
size
()
==
0
)
{
AWARN
<<
"Obstacle (id = "
<<
obstacle
.
Id
()
<<
") has NO prediction trajectory."
;
...
...
@@ -271,7 +271,7 @@ Status QpSplineStBoundaryMapper::map_obstacle_with_prediction_trajectory(
obstacle
.
Length
()
*
st_boundary_config
().
expending_coeff
(),
obstacle
.
Width
()
*
st_boundary_config
().
expending_coeff
());
int64_t
low
=
0
;
int64_t
high
=
static_cast
<
int64_t
>
(
path_data
.
path
().
num_of_points
()
)
-
1
;
int64_t
high
=
adc_path_points
.
size
(
)
-
1
;
bool
find_low
=
false
;
bool
find_high
=
false
;
while
(
low
<
high
)
{
...
...
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_speed_optimizer.cc
浏览文件 @
8d7884c5
...
...
@@ -71,7 +71,7 @@ Status QpSplineStSpeedOptimizer::Process(const PathData& path_data,
}
double
total_length
=
std
::
min
(
qp_spline_st_speed_config_
.
total_path_length
(),
path_data
.
path
().
param_
length
());
path_data
.
discretized_path
().
length
());
// step 1 get boundaries
std
::
vector
<
StGraphBoundary
>
boundaries
;
...
...
@@ -102,7 +102,7 @@ Status QpSplineStSpeedOptimizer::Process(const PathData& path_data,
QpSplineStGraph
st_graph
(
qp_spline_st_speed_config_
,
veh_param
);
StGraphData
st_graph_data
(
boundaries
,
init_point
,
speed_limits
,
path_data
.
path
().
param_
length
());
path_data
.
discretized_path
().
length
());
if
(
st_graph
.
search
(
st_graph_data
,
path_data
,
speed_data
)
!=
Status
::
OK
())
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
"Failed to search graph with dynamic programming!"
);
...
...
modules/planning/optimizer/st_graph/st_boundary_mapper.cc
浏览文件 @
8d7884c5
...
...
@@ -66,10 +66,10 @@ double StBoundaryMapper::get_area(
return
fabs
(
area
);
}
bool
StBoundaryMapper
::
check_overlap
(
const
PathPoint
&
path_point
,
const
apollo
::
common
::
VehicleParam
&
params
,
const
apollo
::
common
::
math
::
Box2d
&
obs_box
,
const
double
buffer
)
const
{
bool
StBoundaryMapper
::
check_overlap
(
const
PathPoint
&
path_point
,
const
apollo
::
common
::
VehicleParam
&
params
,
const
apollo
::
common
::
math
::
Box2d
&
obs_box
,
const
double
buffer
)
const
{
const
double
mid_to_rear_center
=
params
.
length
()
/
2.0
-
params
.
front_edge_to_center
();
const
double
x
=
...
...
@@ -103,7 +103,8 @@ Status StBoundaryMapper::get_speed_limits(
}
std
::
vector
<
double
>
speed_limits
;
for
(
const
auto
&
point
:
path_data
.
path
().
path_points
())
{
const
auto
&
path_points
=
path_data
.
discretized_path
().
points
();
for
(
const
auto
&
point
:
path_points
)
{
speed_limits
.
push_back
(
_st_boundary_config
.
maximal_speed
());
for
(
auto
&
lane
:
lanes
)
{
if
(
lane
->
is_on_lane
({
point
.
x
(),
point
.
y
()}))
{
...
...
@@ -117,7 +118,7 @@ Status StBoundaryMapper::get_speed_limits(
}
}
if
(
planning_distance
>
path_
data
.
path
().
path_points
()
.
back
().
s
())
{
if
(
planning_distance
>
path_
points
.
back
().
s
())
{
const
std
::
string
msg
=
"path length cannot be less than planning_distance"
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
...
...
@@ -127,7 +128,6 @@ Status StBoundaryMapper::get_speed_limits(
const
double
unit_s
=
planning_distance
/
matrix_dimension_s
;
std
::
uint32_t
i
=
0
;
std
::
uint32_t
j
=
1
;
const
auto
&
path_points
=
path_data
.
path
().
path_points
();
while
(
i
<
matrix_dimension_s
&&
j
<
path_points
.
size
())
{
const
auto
&
point
=
path_points
[
j
];
const
auto
&
pre_point
=
path_points
[
j
-
1
];
...
...
@@ -153,7 +153,6 @@ Status StBoundaryMapper::get_speed_limits(
std
::
fmin
(
curr_speed_limit
,
std
::
fmin
(
_st_boundary_config
.
maximal_speed
(),
speed
));
}
curr_speed_limit
*=
_st_boundary_config
.
speed_multiply_buffer
();
curr_speed_limit
=
std
::
fmax
(
curr_speed_limit
,
_st_boundary_config
.
lowest_speed
());
...
...
modules/planning/planner/em/em_planner.cc
浏览文件 @
8d7884c5
...
...
@@ -84,7 +84,7 @@ Status EMPlanner::Init(const PlanningConfig& config) {
}
Status
EMPlanner
::
Plan
(
const
TrajectoryPoint
&
start_point
,
ADCTrajectory
*
trajectory_pb
)
{
ADCTrajectory
*
trajectory_pb
)
{
DataCenter
*
data_center
=
DataCenter
::
instance
();
Frame
*
frame
=
data_center
->
current_frame
();
...
...
@@ -109,12 +109,12 @@ Status EMPlanner::Plan(const TrajectoryPoint& start_point,
CHECK
(
OptimizerType_Parse
(
optimizer
->
name
(),
&
type
));
if
(
type
==
DP_POLY_PATH_OPTIMIZER
||
type
==
QP_SPLINE_PATH_OPTIMIZER
)
{
const
auto
&
path_points
=
planning_data
->
path_data
().
path
().
path_
points
();
planning_data
->
path_data
().
discretized_path
().
points
();
auto
*
optimized_path
=
trajectory_pb
->
mutable_debug
()
->
mutable_planning_data
()
->
add_path
();
optimized_path
->
set_name
(
optimizer
->
name
());
optimized_path
->
mutable_path_point
()
->
CopyFrom
(
{
path_points
.
begin
(),
path_points
.
end
()});
optimized_path
->
mutable_path_point
()
->
CopyFrom
(
{
path_points
.
begin
(),
path_points
.
end
()});
}
}
}
...
...
@@ -135,8 +135,8 @@ Status EMPlanner::Plan(const TrajectoryPoint& start_point,
reference_line
->
set_name
(
"planning_reference_line"
);
const
auto
&
reference_points
=
planning_data
->
reference_line
().
reference_points
();
reference_line
->
mutable_path_point
()
->
CopyFrom
(
{
reference_points
.
begin
(),
reference_points
.
end
()});
reference_line
->
mutable_path_point
()
->
CopyFrom
(
{
reference_points
.
begin
(),
reference_points
.
end
()});
}
return
Status
::
OK
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录