Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
516fb93d
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,发现更多精彩内容 >>
提交
516fb93d
编写于
8月 02, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
8月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optmized code in st_boundary_mapper.
上级
b16edced
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
33 deletion
+32
-33
modules/planning/optimizer/dp_st_speed/dp_st_graph.cc
modules/planning/optimizer/dp_st_speed/dp_st_graph.cc
+1
-2
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
...anning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
+2
-2
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
...es/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
+9
-8
modules/planning/optimizer/st_graph/st_graph_boundary.cc
modules/planning/optimizer/st_graph/st_graph_boundary.cc
+13
-13
modules/planning/optimizer/st_graph/st_graph_boundary.h
modules/planning/optimizer/st_graph/st_graph_boundary.h
+7
-8
未找到文件。
modules/planning/optimizer/dp_st_speed/dp_st_graph.cc
浏览文件 @
516fb93d
...
...
@@ -335,8 +335,7 @@ Status DpStGraph::get_object_decision(const StGraphData& st_graph_data,
double
s_upper
=
dp_st_speed_config_
.
total_path_length
();
double
s_lower
=
0.0
;
if
(
boundary_it
->
get_boundary_s_range_by_time
(
st_it
->
t
(),
&
s_upper
,
&
s_lower
))
{
if
(
boundary_it
->
GetBoundarySRange
(
st_it
->
t
(),
&
s_upper
,
&
s_lower
))
{
if
(
s_lower
>
st_it
->
s
())
{
go_down
=
true
;
}
else
if
(
s_upper
<
st_it
->
s
())
{
...
...
modules/planning/optimizer/qp_spline_st_speed/qp_spline_st_graph.cc
浏览文件 @
516fb93d
...
...
@@ -271,7 +271,7 @@ Status QpSplineStGraph::AddFollowReferenceLineKernel(
for
(
const
double
curr_t
:
t_knots_
)
{
double
s_upper
=
0.0
;
double
s_lower
=
0.0
;
if
(
follow_boundary
.
get_s_boundary_position
(
curr_t
,
&
s_upper
,
&
s_lower
))
{
if
(
follow_boundary
.
GetUnblockSRange
(
curr_t
,
&
s_upper
,
&
s_lower
))
{
ref_s
.
push_back
(
s_upper
-
follow_boundary
.
characteristic_length
());
}
ref_s
.
push_back
(
s_upper
);
...
...
@@ -292,7 +292,7 @@ Status QpSplineStGraph::GetSConstraintByTime(
double
s_upper
=
0.0
;
double
s_lower
=
0.0
;
if
(
!
boundary
.
get_s_boundary_position
(
time
,
&
s_upper
,
&
s_lower
))
{
if
(
!
boundary
.
GetUnblockSRange
(
time
,
&
s_upper
,
&
s_lower
))
{
continue
;
}
...
...
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
浏览文件 @
516fb93d
...
...
@@ -80,9 +80,9 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
const
auto
&
main_decision
=
decision_data
.
Decision
().
main_decision
();
if
(
main_decision
.
has_stop
())
{
ret
=
map_main_decision_stop
(
main_decision
.
stop
(),
reference_lin
e
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
ret
=
map_main_decision_stop
(
main_decision
.
stop
(),
reference_line
,
planning_distance
,
planning_tim
e
,
st_graph_boundaries
);
if
(
!
ret
.
ok
()
&&
ret
.
code
()
!=
ErrorCode
::
PLANNING_SKIP
)
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
);
}
...
...
@@ -120,7 +120,8 @@ 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
,
st_graph_boundaries
);
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
())
{
AERROR
<<
"Fail to map follow dynamic obstacle with id "
<<
obs
->
Id
()
<<
"."
;
...
...
@@ -253,8 +254,8 @@ Status StBoundaryMapperImpl::map_obstacle_with_prediction_trajectory(
for
(
uint32_t
i
=
0
;
i
<
obstacle
.
prediction_trajectories
().
size
();
++
i
)
{
const
auto
&
trajectory
=
obstacle
.
prediction_trajectories
()[
i
];
for
(
int
j
=
0
;
j
<
trajectory
.
trajectory_point_size
();
++
i
)
{
const
auto
&
trajectory_point
=
trajectory
.
trajectory_point
(
i
);
for
(
int
j
=
0
;
j
<
trajectory
.
trajectory_point_size
();
++
j
)
{
const
auto
&
trajectory_point
=
trajectory
.
trajectory_point
(
j
);
// TODO(all): fix trajectory point relative time issue.
double
trajectory_point_time
=
trajectory_point
.
relative_time
();
const
Box2d
obs_box
(
...
...
@@ -273,7 +274,7 @@ Status StBoundaryMapperImpl::map_obstacle_with_prediction_trajectory(
}
if
(
!
find_low
)
{
if
(
!
CheckOverlap
(
adc_path_points
[
low
],
vehicle_param
(),
obs_box
,
st_boundary_config
().
boundary_buffer
()))
{
st_boundary_config
().
boundary_buffer
()))
{
++
low
;
}
else
{
find_low
=
true
;
...
...
@@ -281,7 +282,7 @@ Status StBoundaryMapperImpl::map_obstacle_with_prediction_trajectory(
}
if
(
!
find_high
)
{
if
(
!
CheckOverlap
(
adc_path_points
[
high
],
vehicle_param
(),
obs_box
,
st_boundary_config
().
boundary_buffer
()))
{
st_boundary_config
().
boundary_buffer
()))
{
--
high
;
}
else
{
find_high
=
true
;
...
...
modules/planning/optimizer/st_graph/st_graph_boundary.cc
浏览文件 @
516fb93d
...
...
@@ -15,8 +15,8 @@
*****************************************************************************/
/**
*
@file: obstacle_st_boundary.cc
**/
*
@file: obstacle_st_boundary.cc
**/
#include "modules/planning/optimizer/st_graph/st_graph_boundary.h"
...
...
@@ -60,8 +60,6 @@ Vec2d StGraphBoundary::point(const uint32_t index) const {
const
std
::
vector
<
Vec2d
>&
StGraphBoundary
::
points
()
const
{
return
points_
;
}
bool
StGraphBoundary
::
is_empty
()
const
{
return
points_
.
empty
();
}
StGraphBoundary
::
BoundaryType
StGraphBoundary
::
boundary_type
()
const
{
return
_boundary_type
;
}
...
...
@@ -83,16 +81,15 @@ void StGraphBoundary::set_characteristic_length(
_characteristic_length
=
characteristic_length
;
}
bool
StGraphBoundary
::
get_s_boundary_position
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
{
bool
StGraphBoundary
::
GetUnblockSRange
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
{
const
common
::
math
::
LineSegment2d
segment
=
{
Vec2d
(
curr_time
,
0.0
),
Vec2d
(
curr_time
,
_s_high_limit
)};
*
s_upper
=
_s_high_limit
;
*
s_lower
=
0.0
;
Vec2d
p_s_first
;
Vec2d
p_s_second
;
if
(
!
GetOverlap
(
segment
,
&
p_s_first
,
&
p_s_second
))
{
AERROR
<<
"curr_time["
<<
curr_time
<<
"] is out of the coverage scope of the boundary."
;
...
...
@@ -103,16 +100,19 @@ bool StGraphBoundary::get_s_boundary_position(const double curr_time,
_boundary_type
==
BoundaryType
::
FOLLOW
||
_boundary_type
==
BoundaryType
::
UNKNOWN
)
{
*
s_upper
=
std
::
fmin
(
*
s_upper
,
std
::
fmin
(
p_s_first
.
y
(),
p_s_second
.
y
()));
}
else
{
}
else
if
(
_boundary_type
==
BoundaryType
::
OVERTAKE
)
{
// overtake
*
s_lower
=
std
::
fmax
(
*
s_lower
,
std
::
fmax
(
p_s_first
.
y
(),
p_s_second
.
y
()));
}
else
{
AERROR
<<
"boundary_type is not supported. boundary_type: "
<<
static_cast
<
int
>
(
_boundary_type
);
return
false
;
}
return
true
;
}
bool
StGraphBoundary
::
get_boundary_s_range_by_time
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
{
bool
StGraphBoundary
::
GetBoundarySRange
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
{
const
common
::
math
::
LineSegment2d
segment
=
{
Vec2d
(
curr_time
,
0.0
),
Vec2d
(
curr_time
,
_s_high_limit
)};
*
s_upper
=
_s_high_limit
;
...
...
@@ -121,7 +121,7 @@ bool StGraphBoundary::get_boundary_s_range_by_time(const double curr_time,
Vec2d
p_s_first
;
Vec2d
p_s_second
;
if
(
!
GetOverlap
(
segment
,
&
p_s_first
,
&
p_s_second
))
{
AERROR
<<
"curr_time[
"
<<
curr_time
AERROR
<<
"curr_time["
<<
curr_time
<<
"] is out of the coverage scope of the boundary."
;
return
false
;
}
...
...
modules/planning/optimizer/st_graph/st_graph_boundary.h
浏览文件 @
516fb93d
...
...
@@ -15,8 +15,8 @@
*****************************************************************************/
/**
* @file: st_graph_boundary.h
**/
* @file: st_graph_boundary.h
**/
#ifndef MODULES_PLANNING_OPTIMIZER_ST_GRAPH_ST_GRAPH_BOUNDARY_H_
#define MODULES_PLANNING_OPTIMIZER_ST_GRAPH_ST_GRAPH_BOUNDARY_H_
...
...
@@ -47,7 +47,6 @@ class StGraphBoundary : public common::math::Polygon2d {
~
StGraphBoundary
()
=
default
;
bool
is_empty
()
const
;
bool
IsPointInBoundary
(
const
StGraphPoint
&
st_graph_point
)
const
;
bool
IsPointInBoundary
(
const
STPoint
&
st_point
)
const
;
...
...
@@ -62,11 +61,11 @@ class StGraphBoundary : public common::math::Polygon2d {
void
set_boundary_type
(
const
BoundaryType
&
boundary_type
);
void
set_characteristic_length
(
const
double
characteristic_length
);
bool
get_s_boundary_position
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
;
bool
GetUnblockSRange
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
;
bool
get_boundary_s_range_by_tim
e
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
;
bool
GetBoundarySRang
e
(
const
double
curr_time
,
double
*
s_upper
,
double
*
s_lower
)
const
;
void
get_boundary_time_scope
(
double
*
start_t
,
double
*
end_t
)
const
;
...
...
@@ -80,4 +79,4 @@ class StGraphBoundary : public common::math::Polygon2d {
}
// end namespace planning
}
// end namespace apollo
#endif //
BAIDU_ADU_PLANNING_OPTIMIZER_COMMON
_ST_GRAPH_BOUNDARY_H_
#endif //
MODULES_PLANNING_OPTIMIZER_ST_GRAPH
_ST_GRAPH_BOUNDARY_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录