Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4e52503a
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,发现更多精彩内容 >>
提交
4e52503a
编写于
8月 02, 2017
作者:
Z
Zhang Liangliang
提交者:
Dong Li
8月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
re-structured st_graph_data
上级
84e0e0f3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
64 deletion
+37
-64
modules/planning/optimizer/dp_st_speed/dp_st_cost.cc
modules/planning/optimizer/dp_st_speed/dp_st_cost.cc
+2
-2
modules/planning/optimizer/dp_st_speed/dp_st_cost.h
modules/planning/optimizer/dp_st_speed/dp_st_cost.h
+1
-1
modules/planning/optimizer/dp_st_speed/dp_st_graph.cc
modules/planning/optimizer/dp_st_speed/dp_st_graph.cc
+3
-3
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
...anning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
+2
-4
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
...es/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
+9
-9
modules/planning/optimizer/st_graph/st_graph_data.cc
modules/planning/optimizer/st_graph/st_graph_data.cc
+14
-31
modules/planning/optimizer/st_graph/st_graph_data.h
modules/planning/optimizer/st_graph/st_graph_data.h
+6
-14
未找到文件。
modules/planning/optimizer/dp_st_speed/dp_st_cost.cc
浏览文件 @
4e52503a
...
...
@@ -39,9 +39,9 @@ DpStCost::DpStCost(const DpStSpeedConfig& dp_st_speed_config)
// TODO(all): normalize cost with time
double
DpStCost
::
GetObstacleCost
(
const
STPoint
&
point
,
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
)
const
{
const
std
::
vector
<
StGraphBoundary
>&
st_graph_boundaries
)
const
{
double
total_cost
=
0.0
;
for
(
const
StGraphBoundary
&
boundary
:
obs_boundary
)
{
for
(
const
StGraphBoundary
&
boundary
:
st_graph_boundaries
)
{
if
(
point
.
s
()
<
0
||
boundary
.
IsPointInBoundary
(
point
))
{
total_cost
+=
_dp_st_speed_config
.
st_graph_default_point_cost
();
}
else
{
...
...
modules/planning/optimizer/dp_st_speed/dp_st_cost.h
浏览文件 @
4e52503a
...
...
@@ -38,7 +38,7 @@ class DpStCost {
double
GetObstacleCost
(
const
STPoint
&
point
,
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
)
const
;
const
std
::
vector
<
StGraphBoundary
>&
st_graph_boundaries
)
const
;
double
GetReferenceCost
(
const
STPoint
&
point
,
const
STPoint
&
reference_point
)
const
;
...
...
modules/planning/optimizer/dp_st_speed/dp_st_graph.cc
浏览文件 @
4e52503a
...
...
@@ -54,7 +54,7 @@ Status DpStGraph::Search(const StGraphData& st_graph_data,
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
CalculatePointwiseCost
(
st_graph_data
.
obs_boundary
());
CalculatePointwiseCost
(
st_graph_data
.
st_graph_boundaries
());
if
(
!
CalculateTotalCost
(
st_graph_data
).
ok
())
{
const
std
::
string
msg
=
"Calculate total cost failed."
;
...
...
@@ -291,7 +291,7 @@ Status DpStGraph::get_object_decision(const StGraphData& st_graph_data,
}
const
std
::
vector
<
StGraphBoundary
>&
obs_boundaries
=
st_graph_data
.
obs_boundary
();
st_graph_data
.
st_graph_boundaries
();
const
std
::
vector
<
SpeedPoint
>&
speed_points
=
speed_profile
.
speed_vector
();
for
(
std
::
vector
<
StGraphBoundary
>::
const_iterator
boundary_it
=
...
...
@@ -328,7 +328,7 @@ Status DpStGraph::get_object_decision(const StGraphData& st_graph_data,
STPoint
st_point
(
st_it
->
s
(),
st_it
->
t
());
if
(
boundary_it
->
IsPointInBoundary
(
st_point
))
{
const
std
::
string
msg
=
"dp_st_graph failed: speed profile cross
obs_boundary
."
;
"dp_st_graph failed: speed profile cross
st_graph_boundaries
."
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
...
...
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
浏览文件 @
4e52503a
...
...
@@ -84,14 +84,14 @@ Status QpSplineStGraph::Search(const StGraphData& st_graph_data,
Init
();
if
(
!
ApplyConstraint
(
st_graph_data
.
init_point
(),
st_graph_data
.
speed_limit
(),
st_graph_data
.
obs_boundary
())
st_graph_data
.
st_graph_boundaries
())
.
ok
())
{
const
std
::
string
msg
=
"Apply constraint failed!"
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
if
(
!
ApplyKernel
(
st_graph_data
.
obs_boundary
(),
st_graph_data
.
speed_limit
())
if
(
!
ApplyKernel
(
st_graph_data
.
st_graph_boundaries
(),
st_graph_data
.
speed_limit
())
.
ok
())
{
const
std
::
string
msg
=
"Apply kernel failed!"
;
AERROR
<<
msg
;
...
...
@@ -191,8 +191,6 @@ Status QpSplineStGraph::ApplyConstraint(
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
// TODO(Liangliang):
// add speed constraint and other limits according to adu/planning
std
::
vector
<
double
>
speed_constraint
;
if
(
!
EstimateSpeedConstraint
(
init_point
,
speed_limit
,
&
speed_constraint
)
.
ok
())
{
...
...
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
浏览文件 @
4e52503a
...
...
@@ -54,9 +54,9 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
const
DecisionData
&
decision_data
,
const
PathData
&
path_data
,
const
ReferenceLine
&
reference_line
,
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
obs_boundary
)
const
{
if
(
obs_boundary
==
nullptr
)
{
const
std
::
string
msg
=
"
obs_boundary
is NULL."
;
std
::
vector
<
StGraphBoundary
>*
const
st_graph_boundaries
)
const
{
if
(
st_graph_boundaries
==
nullptr
)
{
const
std
::
string
msg
=
"
st_graph_boundaries
is NULL."
;
AERROR
<<
msg
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
...
...
@@ -75,20 +75,20 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
"Fail to get params because of too few path points"
);
}
obs_boundary
->
clear
();
st_graph_boundaries
->
clear
();
Status
ret
=
Status
::
OK
();
const
auto
&
main_decision
=
decision_data
.
Decision
().
main_decision
();
if
(
main_decision
.
has_stop
())
{
ret
=
map_main_decision_stop
(
main_decision
.
stop
(),
reference_line
,
planning_distance
,
planning_time
,
obs_boundary
);
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
()
&&
ret
.
code
()
!=
ErrorCode
::
PLANNING_SKIP
)
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
);
}
}
else
if
(
main_decision
.
has_mission_complete
())
{
ret
=
map_mission_complete
(
reference_line
,
planning_distance
,
planning_time
,
obs_boundary
);
st_graph_boundaries
);
if
(
!
ret
.
ok
()
&&
ret
.
code
()
!=
ErrorCode
::
PLANNING_SKIP
)
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
);
}
...
...
@@ -103,7 +103,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
}
ret = map_obstacle_without_prediction_trajectory(
initial_planning_point, *obs, path_data, planning_distance,
planning_time,
obs_boundary
);
planning_time,
st_graph_boundaries
);
if (!ret.ok()) {
AERROR << "Fail to map static obstacle with id[" << obs->Id() << "].";
return Status(ErrorCode::PLANNING_ERROR, "Fail to map static obstacle");
...
...
@@ -120,7 +120,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
if
(
obj_decision
.
has_follow
())
{
ret
=
map_obstacle_without_prediction_trajectory
(
initial_planning_point
,
*
obs
,
obj_decision
,
path_data
,
reference_line
,
planning_distance
,
planning_time
,
obs_boundary
);
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
())
{
AERROR
<<
"Fail to map follow dynamic obstacle with id "
<<
obs
->
Id
()
<<
"."
;
...
...
@@ -130,7 +130,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
}
else
if
(
obj_decision
.
has_overtake
()
||
obj_decision
.
has_yield
())
{
ret
=
map_obstacle_with_prediction_trajectory
(
initial_planning_point
,
*
obs
,
obj_decision
,
path_data
,
planning_distance
,
planning_time
,
obs_boundary
);
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
())
{
AERROR
<<
"Fail to map dynamic obstacle with id "
<<
obs
->
Id
()
<<
"."
;
// Return OK by intention.
...
...
modules/planning/optimizer/st_graph/st_graph_data.cc
浏览文件 @
4e52503a
...
...
@@ -25,41 +25,24 @@ namespace planning {
using
TrajectoryPoint
=
apollo
::
common
::
TrajectoryPoint
;
StGraphData
::
StGraphData
(
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
,
const
TrajectoryPoint
&
init_point
,
const
SpeedLimit
&
speed_limit
,
const
double
path_data_length
)
:
_obs_boundary
(
obs_boundary
),
_init_point
(
init_point
),
_speed_limit
(
speed_limit
),
_path_data_length
(
path_data_length
)
{}
const
std
::
vector
<
StGraphBoundary
>&
StGraphData
::
obs_boundary
()
const
{
return
_obs_boundary
;
StGraphData
::
StGraphData
(
const
std
::
vector
<
StGraphBoundary
>&
st_graph_boundaries
,
const
TrajectoryPoint
&
init_point
,
const
SpeedLimit
&
speed_limit
,
const
double
path_data_length
)
:
st_graph_boundaries_
(
st_graph_boundaries
),
init_point_
(
init_point
),
speed_limit_
(
speed_limit
),
path_data_length_
(
path_data_length
)
{}
const
std
::
vector
<
StGraphBoundary
>&
StGraphData
::
st_graph_boundaries
()
const
{
return
st_graph_boundaries_
;
}
const
TrajectoryPoint
&
StGraphData
::
init_point
()
const
{
return
_init_point
;
}
const
SpeedLimit
StGraphData
::
speed_limit
()
const
{
return
_speed_limit
;
}
const
TrajectoryPoint
&
StGraphData
::
init_point
()
const
{
return
init_point_
;
}
double
StGraphData
::
path_data_length
()
const
{
return
_path_data_length
;
}
const
SpeedLimit
StGraphData
::
speed_limit
()
const
{
return
speed_limit_
;
}
void
StGraphData
::
set_speed_limit
(
const
SpeedLimit
&
speed_limit
)
{
_speed_limit
=
speed_limit
;
}
void
StGraphData
::
set_obs_boundary
(
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
)
{
_obs_boundary
=
obs_boundary
;
}
void
StGraphData
::
set_init_point
(
const
TrajectoryPoint
&
init_point
)
{
_init_point
=
init_point
;
}
void
StGraphData
::
set_path_data_length
(
const
double
path_data_length
)
{
_path_data_length
=
path_data_length
;
}
double
StGraphData
::
path_data_length
()
const
{
return
path_data_length_
;
}
}
// namespace planning
}
// namespace apollo
modules/planning/optimizer/st_graph/st_graph_data.h
浏览文件 @
4e52503a
...
...
@@ -36,12 +36,12 @@ class StGraphData {
public:
StGraphData
()
=
default
;
explicit
StGraphData
(
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
,
explicit
StGraphData
(
const
std
::
vector
<
StGraphBoundary
>&
st_graph_boundaries
,
const
apollo
::
common
::
TrajectoryPoint
&
init_point
,
const
SpeedLimit
&
speed_limit
,
const
double
path_data_length
);
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
()
const
;
const
std
::
vector
<
StGraphBoundary
>&
st_graph_boundaries
()
const
;
const
apollo
::
common
::
TrajectoryPoint
&
init_point
()
const
;
...
...
@@ -49,20 +49,12 @@ class StGraphData {
double
path_data_length
()
const
;
void
set_speed_limit
(
const
SpeedLimit
&
speed_limit
);
void
set_obs_boundary
(
const
std
::
vector
<
StGraphBoundary
>&
obs_boundary
);
void
set_init_point
(
const
apollo
::
common
::
TrajectoryPoint
&
init_point
);
void
set_path_data_length
(
const
double
path_data_length
);
private:
std
::
vector
<
StGraphBoundary
>
_obs_boundary
;
apollo
::
common
::
TrajectoryPoint
_init_point
;
std
::
vector
<
StGraphBoundary
>
st_graph_boundaries_
;
apollo
::
common
::
TrajectoryPoint
init_point_
;
SpeedLimit
_speed_limit
;
double
_path_data_length
=
0.0
;
SpeedLimit
speed_limit_
;
double
path_data_length_
=
0.0
;
};
}
// namespace planning
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录