Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
3bfe84ef
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,发现更多精彩内容 >>
提交
3bfe84ef
编写于
2月 07, 2018
作者:
J
Jiaming Tao
提交者:
GitHub
2月 07, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: keep_clear improvements (#2803)
上级
58dda540
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
7960 addition
and
6082 deletion
+7960
-6082
modules/planning/common/frame.cc
modules/planning/common/frame.cc
+1
-1
modules/planning/common/planning_gflags.cc
modules/planning/common/planning_gflags.cc
+3
-0
modules/planning/common/planning_gflags.h
modules/planning/common/planning_gflags.h
+1
-0
modules/planning/tasks/dp_st_speed/dp_st_cost.cc
modules/planning/tasks/dp_st_speed/dp_st_cost.cc
+7
-0
modules/planning/tasks/dp_st_speed/dp_st_graph.cc
modules/planning/tasks/dp_st_speed/dp_st_graph.cc
+3
-0
modules/planning/tasks/dp_st_speed/dp_st_speed_optimizer.cc
modules/planning/tasks/dp_st_speed/dp_st_speed_optimizer.cc
+0
-2
modules/planning/tasks/st_graph/st_boundary_mapper.cc
modules/planning/tasks/st_graph/st_boundary_mapper.cc
+14
-4
modules/planning/tasks/traffic_decider/keep_clear.cc
modules/planning/tasks/traffic_decider/keep_clear.cc
+21
-11
modules/planning/tasks/traffic_decider/keep_clear.h
modules/planning/tasks/traffic_decider/keep_clear.h
+4
-1
modules/planning/testdata/sunnyvale_big_loop_test/result_crosswalk_01_0.pb.txt
...data/sunnyvale_big_loop_test/result_crosswalk_01_0.pb.txt
+875
-982
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_01_0.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_01_0.pb.txt
+966
-965
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_02_0.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_02_0.pb.txt
+1454
-480
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_03_0.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_03_0.pb.txt
+1454
-480
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_04_0.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_04_0.pb.txt
+517
-517
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_06_0.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_06_0.pb.txt
+879
-880
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_06_1.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_06_1.pb.txt
+880
-879
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_06_2.pb.txt
...data/sunnyvale_big_loop_test/result_stop_sign_06_2.pb.txt
+881
-880
未找到文件。
modules/planning/common/frame.cc
浏览文件 @
3bfe84ef
...
...
@@ -210,7 +210,7 @@ const Obstacle *Frame::AddVirtualStopObstacle(
double
lane_left_width
=
0.0
;
double
lane_right_width
=
0.0
;
reference_line
.
GetLaneWidth
(
object_s
,
&
lane_left_width
,
&
lane_right_width
);
Box2d
stop_wall_box
{
box_center
,
heading
,
FLAGS_virtual_stop_wall_
height
,
Box2d
stop_wall_box
{
box_center
,
heading
,
FLAGS_virtual_stop_wall_
length
,
lane_left_width
+
lane_right_width
};
return
AddStaticVirtualObstacle
(
object_id
,
stop_wall_box
);
...
...
modules/planning/common/planning_gflags.cc
浏览文件 @
3bfe84ef
...
...
@@ -257,6 +257,9 @@ DEFINE_double(creep_stop_distance, 0.5,
DEFINE_bool
(
enable_keep_clear
,
false
,
"enable keep clear zone"
);
DEFINE_string
(
keep_clear_virtual_object_id_prefix
,
"KC_"
,
"prefix for converting keep_clear id to virtual object id"
);
DEFINE_string
(
keep_clear_junction_virtual_object_id_prefix
,
"KC_JC_"
,
"prefix for converting keep_clear(junction) id "
"to virtual object id"
);
DEFINE_double
(
keep_clear_min_pass_distance
,
2.0
,
"valid min distance(m) for vehicles to be considered as "
"have passed keep_clear zone (stop_line_end_s)"
);
...
...
modules/planning/common/planning_gflags.h
浏览文件 @
3bfe84ef
...
...
@@ -155,6 +155,7 @@ DECLARE_double(creep_stop_distance);
/// keep_clear
DECLARE_bool
(
enable_keep_clear
);
DECLARE_string
(
keep_clear_virtual_object_id_prefix
);
DECLARE_string
(
keep_clear_junction_virtual_object_id_prefix
);
DECLARE_double
(
keep_clear_min_pass_distance
);
/// traffic light
DECLARE_bool
(
enable_traffic_light
);
...
...
modules/planning/tasks/dp_st_speed/dp_st_cost.cc
浏览文件 @
3bfe84ef
...
...
@@ -64,6 +64,7 @@ void DpStCost::AddToKeepClearRange(
StBoundary
::
BoundaryType
::
KEEP_CLEAR
)
{
continue
;
}
double
start_s
=
obstacle
->
st_boundary
().
min_s
();
double
end_s
=
obstacle
->
st_boundary
().
max_s
();
keep_clear_range_
.
emplace_back
(
start_s
,
end_s
);
...
...
@@ -110,6 +111,10 @@ double DpStCost::GetObstacleCost(const StGraphPoint& st_graph_point) {
double
cost
=
0.0
;
for
(
const
auto
*
obstacle
:
obstacles_
)
{
if
(
!
obstacle
->
IsBlockingObstacle
())
{
continue
;
}
auto
boundary
=
obstacle
->
st_boundary
();
const
double
kIgnoreDistance
=
200.0
;
if
(
boundary
.
min_s
()
>
kIgnoreDistance
)
{
...
...
@@ -169,11 +174,13 @@ double DpStCost::GetSpeedCost(const STPoint& first, const STPoint& second,
if
(
speed
<
0
)
{
return
kInf
;
}
if
(
speed
<
FLAGS_max_stop_speed
&&
InKeepClearRange
(
second
.
s
()))
{
// first.s in range
cost
+=
config_
.
keep_clear_low_speed_penalty
()
*
unit_t_
*
config_
.
default_speed_cost
();
}
double
det_speed
=
(
speed
-
speed_limit
)
/
speed_limit
;
if
(
det_speed
>
0
)
{
cost
+=
config_
.
exceed_speed_penalty
()
*
config_
.
default_speed_cost
()
*
...
...
modules/planning/tasks/dp_st_speed/dp_st_graph.cc
浏览文件 @
3bfe84ef
...
...
@@ -47,6 +47,9 @@ bool CheckOverlapOnDpStGraph(const std::vector<const StBoundary*>& boundaries,
const
StGraphPoint
&
p1
,
const
StGraphPoint
&
p2
)
{
const
common
::
math
::
LineSegment2d
seg
(
p1
.
point
(),
p2
.
point
());
for
(
const
auto
*
boundary
:
boundaries
)
{
if
(
boundary
->
boundary_type
()
==
StBoundary
::
BoundaryType
::
KEEP_CLEAR
)
{
continue
;
}
if
(
boundary
->
HasOverlap
(
seg
))
{
return
true
;
}
...
...
modules/planning/tasks/dp_st_speed/dp_st_speed_optimizer.cc
浏览文件 @
3bfe84ef
...
...
@@ -63,8 +63,6 @@ bool DpStSpeedOptimizer::SearchStGraph(const StBoundaryMapper& boundary_mapper,
auto
id
=
obstacle
->
Id
();
if
(
!
obstacle
->
st_boundary
().
IsEmpty
())
{
if
(
obstacle
->
st_boundary
().
boundary_type
()
==
StBoundary
::
BoundaryType
::
KEEP_CLEAR
||
obstacle
->
reference_line_st_boundary
().
boundary_type
()
==
StBoundary
::
BoundaryType
::
KEEP_CLEAR
)
{
path_decision
->
Find
(
id
)
->
SetBlockingObstacle
(
false
);
}
else
{
...
...
modules/planning/tasks/st_graph/st_boundary_mapper.cc
浏览文件 @
3bfe84ef
...
...
@@ -190,6 +190,7 @@ Status StBoundaryMapper::CreateStBoundaryWithHistory(
}
else
{
decision
=
iter
->
second
;
}
if
(
!
path_obstacle
->
HasLongitudinalDecision
())
{
if
(
!
MapWithoutDecision
(
path_obstacle
).
ok
())
{
std
::
string
msg
=
StrCat
(
"Fail to map obstacle "
,
path_obstacle
->
Id
(),
...
...
@@ -352,10 +353,19 @@ bool StBoundaryMapper::GetOverlapBoundaryPoints(
if
(
CheckOverlap
(
curr_point_on_path
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
lower_points
->
emplace_back
(
curr_point_on_path
.
s
(),
0.0
);
lower_points
->
emplace_back
(
curr_point_on_path
.
s
(),
planning_time_
);
upper_points
->
emplace_back
(
planning_distance_
,
0.0
);
upper_points
->
emplace_back
(
planning_distance_
,
planning_time_
);
const
double
backward_distance
=
-
vehicle_param_
.
front_edge_to_center
();
const
double
forward_distance
=
vehicle_param_
.
length
()
+
vehicle_param_
.
width
()
+
obs_box
.
length
()
+
obs_box
.
width
();
double
low_s
=
std
::
fmax
(
0.0
,
curr_point_on_path
.
s
()
+
backward_distance
);
double
high_s
=
std
::
fmin
(
planning_distance_
,
curr_point_on_path
.
s
()
+
forward_distance
);
lower_points
->
emplace_back
(
low_s
,
0.0
);
lower_points
->
emplace_back
(
low_s
,
planning_time_
);
upper_points
->
emplace_back
(
high_s
,
0.0
);
upper_points
->
emplace_back
(
high_s
,
planning_time_
);
break
;
}
}
...
...
modules/planning/tasks/traffic_decider/keep_clear.cc
浏览文件 @
3bfe84ef
...
...
@@ -46,8 +46,12 @@ bool KeepClear::ApplyRule(Frame* const frame,
const
std
::
vector
<
PathOverlap
>&
keep_clear_overlaps
=
reference_line_info
->
reference_line
().
map_path
().
clear_area_overlaps
();
for
(
const
auto
&
keep_clear_overlap
:
keep_clear_overlaps
)
{
if
(
BuildKeepClearObstacle
(
frame
,
reference_line_info
,
const_cast
<
PathOverlap
*>
(
&
keep_clear_overlap
)))
{
const
auto
obstacle_id
=
FLAGS_keep_clear_virtual_object_id_prefix
+
keep_clear_overlap
.
object_id
;
if
(
BuildKeepClearObstacle
(
frame
,
reference_line_info
,
const_cast
<
PathOverlap
*>
(
&
keep_clear_overlap
),
obstacle_id
))
{
ADEBUG
<<
"KEEP_CLAER for keep_clear_zone["
<<
keep_clear_overlap
.
object_id
<<
"] s["
<<
keep_clear_overlap
.
start_s
<<
", "
<<
keep_clear_overlap
.
end_s
...
...
@@ -59,8 +63,13 @@ bool KeepClear::ApplyRule(Frame* const frame,
const
std
::
vector
<
PathOverlap
>&
junction_overlaps
=
reference_line_info
->
reference_line
().
map_path
().
junction_overlaps
();
for
(
const
auto
&
junction_overlap
:
junction_overlaps
)
{
if
(
BuildKeepClearObstacle
(
frame
,
reference_line_info
,
const_cast
<
PathOverlap
*>
(
&
junction_overlap
)))
{
const
auto
obstacle_id
=
FLAGS_keep_clear_junction_virtual_object_id_prefix
+
junction_overlap
.
object_id
;
if
(
BuildKeepClearObstacle
(
frame
,
reference_line_info
,
const_cast
<
PathOverlap
*>
(
&
junction_overlap
),
obstacle_id
))
{
ADEBUG
<<
"KEEP_CLAER for junction["
<<
junction_overlap
.
object_id
<<
"] s["
<<
junction_overlap
.
start_s
<<
", "
<<
junction_overlap
.
end_s
<<
"] BUILD"
;
...
...
@@ -71,8 +80,10 @@ bool KeepClear::ApplyRule(Frame* const frame,
}
bool
KeepClear
::
BuildKeepClearObstacle
(
Frame
*
const
frame
,
ReferenceLineInfo
*
const
reference_line_info
,
PathOverlap
*
const
keep_clear_overlap
)
{
Frame
*
const
frame
,
ReferenceLineInfo
*
const
reference_line_info
,
PathOverlap
*
const
keep_clear_overlap
,
const
std
::
string
&
virtual_obstacle_id
)
{
CHECK_NOTNULL
(
frame
);
CHECK_NOTNULL
(
reference_line_info
);
CHECK_NOTNULL
(
keep_clear_overlap
);
...
...
@@ -119,16 +130,15 @@ bool KeepClear::BuildKeepClearObstacle(
common
::
math
::
Box2d
keep_clear_box
{
common
::
math
::
LineSegment2d
(
start_xy
,
end_xy
),
left_lane_width
+
right_lane_width
};
const
auto
obstacle_id
=
FLAGS_keep_clear_virtual_object_id_prefix
+
keep_clear_overlap
->
object_id
;
auto
*
obstacle
=
frame
->
AddStaticVirtualObstacle
(
obstacle_id
,
keep_clear_box
);
auto
*
obstacle
=
frame
->
AddStaticVirtualObstacle
(
virtual_obstacle_id
,
keep_clear_box
);
if
(
!
obstacle
)
{
AERROR
<<
"Failed to create obstacle
"
<<
obstacle_id
<<
" in frame"
;
AERROR
<<
"Failed to create obstacle
: "
<<
virtual_obstacle_id
;
return
false
;
}
auto
*
path_obstacle
=
reference_line_info
->
AddObstacle
(
obstacle
);
if
(
!
path_obstacle
)
{
AERROR
<<
"Failed to create path_obstacle
for "
<<
obstacle_id
;
AERROR
<<
"Failed to create path_obstacle
: "
<<
virtual_
obstacle_id
;
return
false
;
}
path_obstacle
->
SetReferenceLineStBoundaryType
(
...
...
modules/planning/tasks/traffic_decider/keep_clear.h
浏览文件 @
3bfe84ef
...
...
@@ -21,6 +21,8 @@
#ifndef MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_KEEP_CLEAR_H_
#define MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_KEEP_CLEAR_H_
#include <string>
#include "modules/planning/tasks/traffic_decider/traffic_rule.h"
namespace
apollo
{
...
...
@@ -41,7 +43,8 @@ class KeepClear : public TrafficRule {
bool
BuildKeepClearObstacle
(
Frame
*
const
frame
,
ReferenceLineInfo
*
const
reference_line_info
,
hdmap
::
PathOverlap
*
const
keep_clear_overlap
);
hdmap
::
PathOverlap
*
const
keep_clear_overlap
,
const
std
::
string
&
virtual_obstacle_id
);
};
}
// namespace planning
...
...
modules/planning/testdata/sunnyvale_big_loop_test/result_crosswalk_01_0.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_01_0.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_02_0.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_03_0.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_04_0.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_06_0.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_06_1.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_big_loop_test/result_stop_sign_06_2.pb.txt
浏览文件 @
3bfe84ef
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录