Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
65c02ac7
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,发现更多精彩内容 >>
提交
65c02ac7
编写于
7月 29, 2019
作者:
J
jmtao
提交者:
PAN Jiacheng
7月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: move path_decider status into PlanningStatus
上级
b6200138
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
81 addition
and
128 deletion
+81
-128
modules/planning/common/BUILD
modules/planning/common/BUILD
+1
-6
modules/planning/common/planning_context.h
modules/planning/common/planning_context.h
+4
-4
modules/planning/proto/BUILD
modules/planning/proto/BUILD
+0
-14
modules/planning/proto/path_decider_info.proto
modules/planning/proto/path_decider_info.proto
+0
-11
modules/planning/proto/planning_status.proto
modules/planning/proto/planning_status.proto
+16
-7
modules/planning/tasks/deciders/path_assessment_decider/path_assessment_decider.cc
...ciders/path_assessment_decider/path_assessment_decider.cc
+27
-50
modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.cc
...tasks/deciders/path_bounds_decider/path_bounds_decider.cc
+6
-3
modules/planning/tasks/deciders/path_decider/path_decider.cc
modules/planning/tasks/deciders/path_decider/path_decider.cc
+2
-1
modules/planning/tasks/deciders/path_lane_borrow_decider/path_lane_borrow_decider.cc
...ders/path_lane_borrow_decider/path_lane_borrow_decider.cc
+25
-32
未找到文件。
modules/planning/common/BUILD
浏览文件 @
65c02ac7
...
...
@@ -150,13 +150,8 @@ cc_library(
"-DMODULE_NAME=
\\\"
planning
\\\"
"
,
],
deps
=
[
":planning_gflags"
,
"//cyber/common:log"
,
"//modules/map/pnc_map:path"
,
"//cyber/common"
,
"//modules/planning/common/path:path_data"
,
"//modules/planning/proto:path_decider_info_proto"
,
"//modules/planning/proto:planning_config_proto"
,
"//modules/planning/proto:planning_proto"
,
"//modules/planning/proto:planning_status_proto"
,
"@eigen"
,
],
...
...
modules/planning/common/planning_context.h
浏览文件 @
65c02ac7
...
...
@@ -22,7 +22,6 @@
#include "cyber/common/macros.h"
#include "modules/planning/proto/path_decider_info.pb.h"
#include "modules/planning/proto/planning_status.pb.h"
/**
...
...
@@ -37,14 +36,15 @@ class PlanningContext {
void
Clear
();
void
Init
();
/*
* please put all status info inside PlanningStatus for easy maintenance.
* do NOT create new struct at this level.
* */
const
PlanningStatus
&
planning_status
()
{
return
planning_status_
;
}
PlanningStatus
*
mutable_planning_status
()
{
return
&
planning_status_
;
}
const
PathDeciderInfo
&
path_decider_info
()
{
return
path_decider_info_
;
}
PathDeciderInfo
*
mutable_path_decider_info
()
{
return
&
path_decider_info_
;
}
private:
PlanningStatus
planning_status_
;
PathDeciderInfo
path_decider_info_
;
// this is a singleton class
DECLARE_SINGLETON
(
PlanningContext
)
...
...
modules/planning/proto/BUILD
浏览文件 @
65c02ac7
...
...
@@ -558,20 +558,6 @@ cc_proto_library(
],
)
cc_proto_library
(
name
=
"path_decider_info_proto"
,
deps
=
[
":path_decider_info_proto_lib"
,
],
)
proto_library
(
name
=
"path_decider_info_proto_lib"
,
srcs
=
[
"path_decider_info.proto"
,
],
)
cc_proto_library
(
name
=
"rule_based_stop_decider_config_proto"
,
deps
=
[
...
...
modules/planning/proto/path_decider_info.proto
已删除
100644 → 0
浏览文件 @
b6200138
syntax
=
"proto2"
;
package
apollo
.
planning
;
message
PathDeciderInfo
{
optional
int32
front_static_obstacle_cycle_counter
=
1
[
default
=
0
];
optional
int32
able_to_use_self_lane_counter
=
2
[
default
=
0
];
optional
bool
is_in_path_lane_borrow_scenario
=
3
[
default
=
false
];
optional
string
front_static_obstacle_id
=
4
[
default
=
""
];
optional
int32
decided_side_pass_direction
=
5
[
default
=
0
];
}
modules/planning/proto/planning_status.proto
浏览文件 @
65c02ac7
...
...
@@ -53,6 +53,14 @@ message OpenSpaceStatus {
repeated
string
partitioned_trajectories_index_history
=
1
;
}
message
PathDeciderStatus
{
optional
int32
front_static_obstacle_cycle_counter
=
1
[
default
=
0
];
optional
int32
able_to_use_self_lane_counter
=
2
[
default
=
0
];
optional
bool
is_in_path_lane_borrow_scenario
=
3
[
default
=
false
];
optional
string
front_static_obstacle_id
=
4
[
default
=
""
];
optional
int32
decided_side_pass_direction
=
5
[
default
=
0
];
}
message
PedestrianStatus
{
repeated
StopTime
stop_time
=
1
;
}
...
...
@@ -109,11 +117,12 @@ message PlanningStatus {
optional
apollo.common.EngageAdvice
engage_advice
=
5
;
optional
OpenSpaceStatus
open_space
=
6
;
optional
PedestrianStatus
pedestrian
=
7
;
optional
PullOverStatus
pull_over
=
8
;
optional
ReroutingStatus
rerouting
=
9
;
optional
RightOfWayStatus
right_of_way
=
10
;
optional
ScenarioStatus
scenario
=
11
;
optional
SidePassStatus
side_pass
=
12
;
optional
StopSignStatus
stop_sign
=
13
;
optional
TrafficLightStatus
traffic_light
=
14
;
optional
PathDeciderStatus
path_decider
=
8
;
optional
PullOverStatus
pull_over
=
9
;
optional
ReroutingStatus
rerouting
=
10
;
optional
RightOfWayStatus
right_of_way
=
11
;
optional
ScenarioStatus
scenario
=
12
;
optional
SidePassStatus
side_pass
=
13
;
optional
StopSignStatus
stop_sign
=
14
;
optional
TrafficLightStatus
traffic_light
=
15
;
}
modules/planning/tasks/deciders/path_assessment_decider/path_assessment_decider.cc
浏览文件 @
65c02ac7
...
...
@@ -231,78 +231,55 @@ Status PathAssessmentDecider::Process(
new_candidate_path_data
.
push_back
(
curr_path_data
);
}
}
reference_line_info
->
SetCandidatePathData
(
std
::
move
(
new_candidate_path_data
));
reference_line_info
->
SetCandidatePathData
(
std
::
move
(
new_candidate_path_data
));
// 4. Update necessary info for lane-borrow decider's future uses.
// Update front static obstacle's info.
auto
*
mutable_path_decider_status
=
PlanningContext
::
Instance
()
->
mutable_planning_status
()
->
mutable_path_decider
();
if
(
!
(
reference_line_info
->
GetBlockingObstacleId
()).
empty
())
{
if
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
front_static_obstacle_cycle_counter
()
<
0
)
{
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_front_static_obstacle_cycle_counter
(
0
);
int
front_static_obstacle_cycle_counter
=
mutable_path_decider_status
->
front_static_obstacle_cycle_counter
();
if
(
front_static_obstacle_cycle_counter
<
0
)
{
front_static_obstacle_cycle_counter
=
0
;
}
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_front_static_obstacle_id
(
mutable_path_decider_status
->
set_front_static_obstacle_id
(
reference_line_info
->
GetBlockingObstacleId
());
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_front_static_obstacle_cycle_counter
(
std
::
min
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
front_static_obstacle_cycle_counter
()
+
1
,
10
));
mutable_path_decider_status
->
set_front_static_obstacle_cycle_counter
(
std
::
min
(
front_static_obstacle_cycle_counter
+
1
,
10
));
}
else
{
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_front_static_obstacle_cycle_counter
(
0
);
mutable_path_decider_status
->
set_front_static_obstacle_cycle_counter
(
0
);
}
// Update self-lane usage info.
if
(
reference_line_info
->
path_data
().
path_label
().
find
(
"self"
)
!=
std
::
string
::
npos
)
{
// && std::get<1>(reference_line_info->path_data()
// .path_point_decision_guide()
// .front()) == PathData::PathPointType::IN_LANE) {
if
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
able_to_use_self_lane_counter
()
<
0
)
{
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_able_to_use_self_lane_counter
(
0
);
int
able_to_use_self_lane_counter
=
mutable_path_decider_status
->
able_to_use_self_lane_counter
();
if
(
able_to_use_self_lane_counter
<
0
)
{
able_to_use_self_lane_counter
=
0
;
}
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_able_to_use_self_lane_counter
(
std
::
min
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
able_to_use_self_lane_counter
()
+
1
,
10
));
mutable_path_decider_status
->
set_able_to_use_self_lane_counter
(
std
::
min
(
able_to_use_self_lane_counter
+
1
,
10
));
}
else
{
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_able_to_use_self_lane_counter
(
0
);
mutable_path_decider_status
->
set_able_to_use_self_lane_counter
(
0
);
}
// Update side-pass direction.
if
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
is_in_path_lane_borrow_scenario
()
&&
PlanningContext
::
Instance
()
->
path_decider_info
()
.
decided_side_pass_direction
()
==
0
)
{
if
(
mutable_path_decider_status
->
is_in_path_lane_borrow_scenario
()
&&
mutable_path_decider_status
->
decided_side_pass_direction
()
==
0
)
{
if
(
reference_line_info
->
path_data
().
path_label
().
find
(
"left"
)
!=
std
::
string
::
npos
)
{
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_decided_side_pass_direction
(
1
);
mutable_path_decider_status
->
set_decided_side_pass_direction
(
1
);
}
else
if
(
reference_line_info
->
path_data
().
path_label
().
find
(
"right"
)
!=
std
::
string
::
npos
)
{
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_decided_side_pass_direction
(
-
1
);
mutable_path_decider_status
->
set_decided_side_pass_direction
(
-
1
);
}
}
const
auto
&
end_time4
=
std
::
chrono
::
system_clock
::
now
();
...
...
modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.cc
浏览文件 @
65c02ac7
...
...
@@ -138,9 +138,12 @@ Status PathBoundsDecider::Process(
std
::
vector
<
LaneBorrowInfo
>
lane_borrow_info_list
;
if
(
reference_line_info
->
is_path_lane_borrow
())
{
// Try borrowing from left and from right neighbor lane.
switch
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
decided_side_pass_direction
())
{
const
int
decided_side_pass_direction
=
PlanningContext
::
Instance
()
->
planning_status
()
.
path_decider
()
.
decided_side_pass_direction
();
switch
(
decided_side_pass_direction
)
{
case
0
:
lane_borrow_info_list
=
{
LaneBorrowInfo
::
LEFT_BORROW
,
LaneBorrowInfo
::
RIGHT_BORROW
,
...
...
modules/planning/tasks/deciders/path_decider/path_decider.cc
浏览文件 @
65c02ac7
...
...
@@ -114,7 +114,8 @@ bool PathDecider::MakeStaticObstacleDecision(
// - add STOP decision for blocking obstacles.
if
(
obstacle
->
Id
()
==
blocking_obstacle_id
&&
!
PlanningContext
::
Instance
()
->
path_decider_info
()
->
planning_status
()
.
path_decider
()
.
is_in_path_lane_borrow_scenario
())
{
// Add stop decision
ADEBUG
<<
"Blocking obstacle = "
<<
blocking_obstacle_id
;
...
...
modules/planning/tasks/deciders/path_lane_borrow_decider/path_lane_borrow_decider.cc
浏览文件 @
65c02ac7
...
...
@@ -52,44 +52,33 @@ Status PathLaneBorrowDecider::Process(
bool
PathLaneBorrowDecider
::
IsNecessaryToBorrowLane
(
const
Frame
&
frame
,
const
ReferenceLineInfo
&
reference_line_info
)
{
if
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
is_in_path_lane_borrow_scenario
())
{
auto
*
mutable_path_decider_status
=
PlanningContext
::
Instance
()
->
mutable_planning_status
()
->
mutable_path_decider
();
if
(
mutable_path_decider_status
->
is_in_path_lane_borrow_scenario
())
{
// If originally borrowing neighbor lane:
if
(
PlanningContext
::
Instance
()
->
path_decider_info
()
.
able_to_use_self_lane_counter
()
>=
6
)
{
if
(
mutable_path_decider_status
->
able_to_use_self_lane_counter
()
>=
6
)
{
// If have been able to use self-lane for some time, then switch to
// non-lane-borrowing.
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_is_in_path_lane_borrow_scenario
(
false
);
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_decided_side_pass_direction
(
0
);
mutable_path_decider_status
->
set_is_in_path_lane_borrow_scenario
(
false
);
mutable_path_decider_status
->
set_decided_side_pass_direction
(
0
);
AINFO
<<
"Switch from LANE-BORROW path to SELF-LANE path."
;
}
}
else
{
// If originally not borrowing neighbor lane:
ADEBUG
<<
"Blocking obstacle ID = "
<<
PlanningContext
::
Instance
()
->
path_decider_info
()
.
front_static_obstacle_id
();
ADEBUG
<<
"Blocking obstacle ID["
<<
mutable_path_decider_status
->
front_static_obstacle_id
()
<<
"]"
;
if
(
HasSingleReferenceLine
(
frame
)
&&
IsWithinSidePassingSpeedADC
(
frame
)
&&
IsBlockingObstacleFarFromIntersection
(
reference_line_info
)
&&
IsLongTermBlockingObstacle
()
&&
IsBlockingObstacleWithinDestination
(
reference_line_info
)
&&
IsSidePassableObstacle
(
reference_line_info
))
{
// Satisfying the above condition will it switch to lane-borrowing.
PlanningContext
::
Instance
()
->
mutable_path_decider_info
()
->
set_is_in_path_lane_borrow_scenario
(
true
);
mutable_path_decider_status
->
set_is_in_path_lane_borrow_scenario
(
true
);
AINFO
<<
"Switch from SELF-LANE path to LANE-BORROW path."
;
}
}
return
PlanningContext
::
Instance
()
->
path_decider_info
()
.
is_in_path_lane_borrow_scenario
();
return
mutable_path_decider_status
->
is_in_path_lane_borrow_scenario
();
}
// This function is to prevent lane-borrowing during lane-changing.
...
...
@@ -105,7 +94,8 @@ bool PathLaneBorrowDecider::IsWithinSidePassingSpeedADC(const Frame& frame) {
bool
PathLaneBorrowDecider
::
IsLongTermBlockingObstacle
()
{
if
(
PlanningContext
::
Instance
()
->
path_decider_info
()
->
planning_status
()
.
path_decider
()
.
front_static_obstacle_cycle_counter
()
>=
FLAGS_long_term_blocking_obstacle_cycle_threhold
)
{
ADEBUG
<<
"The blocking obstacle is long-term existing."
;
...
...
@@ -118,9 +108,10 @@ bool PathLaneBorrowDecider::IsLongTermBlockingObstacle() {
bool
PathLaneBorrowDecider
::
IsBlockingObstacleWithinDestination
(
const
ReferenceLineInfo
&
reference_line_info
)
{
std
::
string
blocking_obstacle_id
=
PlanningContext
::
Instance
()
->
path_decider_info
()
.
front_static_obstacle_id
();
const
auto
&
path_decider_status
=
PlanningContext
::
Instance
()
->
planning_status
().
path_decider
();
const
std
::
string
blocking_obstacle_id
=
path_decider_status
.
front_static_obstacle_id
();
if
(
blocking_obstacle_id
.
empty
())
{
ADEBUG
<<
"There is no blocking obstacle."
;
return
true
;
...
...
@@ -149,9 +140,10 @@ bool PathLaneBorrowDecider::IsBlockingObstacleWithinDestination(
bool
PathLaneBorrowDecider
::
IsBlockingObstacleFarFromIntersection
(
const
ReferenceLineInfo
&
reference_line_info
)
{
std
::
string
blocking_obstacle_id
=
PlanningContext
::
Instance
()
->
path_decider_info
()
.
front_static_obstacle_id
();
const
auto
&
path_decider_status
=
PlanningContext
::
Instance
()
->
planning_status
().
path_decider
();
const
std
::
string
blocking_obstacle_id
=
path_decider_status
.
front_static_obstacle_id
();
if
(
blocking_obstacle_id
.
empty
())
{
ADEBUG
<<
"There is no blocking obstacle."
;
return
true
;
...
...
@@ -203,9 +195,10 @@ bool PathLaneBorrowDecider::IsBlockingObstacleFarFromIntersection(
bool
PathLaneBorrowDecider
::
IsSidePassableObstacle
(
const
ReferenceLineInfo
&
reference_line_info
)
{
std
::
string
blocking_obstacle_id
=
PlanningContext
::
Instance
()
->
path_decider_info
()
.
front_static_obstacle_id
();
const
auto
&
path_decider_status
=
PlanningContext
::
Instance
()
->
planning_status
().
path_decider
();
const
std
::
string
blocking_obstacle_id
=
path_decider_status
.
front_static_obstacle_id
();
if
(
blocking_obstacle_id
.
empty
())
{
ADEBUG
<<
"There is no blocking obstacle."
;
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录