Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
e5ad41b8
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,体验更适合开发者的 AI 搜索 >>
提交
e5ad41b8
编写于
7月 08, 2020
作者:
J
jmtao
提交者:
Xiangquan Xiao
7月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: remove static member variable in BareIntersection stage for multil-ADC RL
上级
e950825d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
58 addition
and
47 deletion
+58
-47
modules/planning/proto/planning_status.proto
modules/planning/proto/planning_status.proto
+1
-0
modules/planning/scenarios/bare_intersection/unprotected/stage_approach.cc
...scenarios/bare_intersection/unprotected/stage_approach.cc
+51
-45
modules/planning/scenarios/bare_intersection/unprotected/stage_approach.h
.../scenarios/bare_intersection/unprotected/stage_approach.h
+4
-2
modules/planning/tasks/deciders/creep_decider/creep_decider.cc
...es/planning/tasks/deciders/creep_decider/creep_decider.cc
+2
-0
未找到文件。
modules/planning/proto/planning_status.proto
浏览文件 @
e5ad41b8
...
...
@@ -15,6 +15,7 @@ import "modules/routing/proto/routing.proto";
message
BareIntersectionStatus
{
optional
string
current_pnc_junction_overlap_id
=
1
;
optional
string
done_pnc_junction_overlap_id
=
2
;
optional
uint32
clear_counter
=
3
;
}
message
ChangeLaneStatus
{
...
...
modules/planning/scenarios/bare_intersection/unprotected/stage_approach.cc
浏览文件 @
e5ad41b8
...
...
@@ -37,8 +37,6 @@ namespace bare_intersection {
using
apollo
::
common
::
TrajectoryPoint
;
using
apollo
::
hdmap
::
PathOverlap
;
uint32_t
BareIntersectionUnprotectedStageApproach
::
clear_counter_
=
0
;
Stage
::
StageStatus
BareIntersectionUnprotectedStageApproach
::
Process
(
const
TrajectoryPoint
&
planning_init_point
,
Frame
*
frame
)
{
ADEBUG
<<
"stage: Approach"
;
...
...
@@ -93,12 +91,60 @@ Stage::StageStatus BareIntersectionUnprotectedStageApproach::Process(
AERROR
<<
"BareIntersectionUnprotectedStageApproach planning error"
;
}
std
::
vector
<
std
::
string
>
wait_for_obstacle_ids
;
bool
clear
=
CheckClear
(
reference_line_info
,
&
wait_for_obstacle_ids
);
if
(
scenario_config_
.
enable_explicit_stop
())
{
bool
stop
=
false
;
static
constexpr
double
kCheckClearDistance
=
5.0
;
// meter
static
constexpr
double
kStartWatchDistance
=
2.0
;
// meter
if
(
distance_adc_to_pnc_junction
<=
kCheckClearDistance
&&
distance_adc_to_pnc_junction
>=
kStartWatchDistance
&&
!
clear
)
{
stop
=
true
;
}
else
if
(
distance_adc_to_pnc_junction
<
kStartWatchDistance
)
{
// creeping area
auto
*
bare_intersection_status
=
injector_
->
planning_context
()
->
mutable_planning_status
()
->
mutable_bare_intersection
();
int
clear_counter
=
bare_intersection_status
->
clear_counter
();
clear_counter
=
clear
?
clear_counter
+
1
:
0
;
if
(
clear_counter
>=
5
)
{
clear_counter
=
0
;
// reset
}
else
{
stop
=
true
;
}
// use PlanningContext instead of static counter for multi-ADC
bare_intersection_status
->
set_clear_counter
(
clear_counter
);
}
if
(
stop
)
{
// build stop decision
ADEBUG
<<
"BuildStopDecision: bare pnc_junction["
<<
pnc_junction_overlap_id
<<
"] start_s["
<<
current_pnc_junction
->
start_s
<<
"]"
;
const
std
::
string
virtual_obstacle_id
=
"PNC_JUNCTION_"
+
current_pnc_junction
->
object_id
;
planning
::
util
::
BuildStopDecision
(
virtual_obstacle_id
,
current_pnc_junction
->
start_s
,
scenario_config_
.
stop_distance
(),
StopReasonCode
::
STOP_REASON_STOP_SIGN
,
wait_for_obstacle_ids
,
"bare intersection"
,
frame
,
&
(
frame
->
mutable_reference_line_info
()
->
front
()));
}
}
return
Stage
::
RUNNING
;
}
bool
BareIntersectionUnprotectedStageApproach
::
CheckClear
(
const
ReferenceLineInfo
&
reference_line_info
,
std
::
vector
<
std
::
string
>*
wait_for_obstacle_ids
)
{
// TODO(all): move to conf
static
constexpr
double
kConf_min_boundary_t
=
6.0
;
// second
static
constexpr
double
kConf_ignore_max_st_min_t
=
0.1
;
// second
static
constexpr
double
kConf_ignore_min_st_min_s
=
15.0
;
// meter
std
::
vector
<
std
::
string
>
wait_for_obstacle_ids
;
bool
all_far_away
=
true
;
for
(
auto
*
obstacle
:
reference_line_info
.
path_decision
().
obstacles
().
Items
())
{
...
...
@@ -126,51 +172,11 @@ Stage::StageStatus BareIntersectionUnprotectedStageApproach::Process(
continue
;
}
wait_for_obstacle_ids
.
push_back
(
obstacle
->
Id
());
wait_for_obstacle_ids
->
push_back
(
obstacle
->
Id
());
all_far_away
=
false
;
}
}
if
(
scenario_config_
.
enable_explicit_stop
())
{
clear_counter_
=
all_far_away
?
clear_counter_
+
1
:
0
;
bool
stop
=
false
;
static
constexpr
double
kCheckClearDistance
=
5.0
;
// meter
static
constexpr
double
kStartWatchDistance
=
2.0
;
// meter
if
(
distance_adc_to_pnc_junction
<=
kCheckClearDistance
&&
distance_adc_to_pnc_junction
>=
kStartWatchDistance
&&
!
all_far_away
)
{
clear_counter_
=
0
;
// reset
stop
=
true
;
}
else
if
(
distance_adc_to_pnc_junction
<
kStartWatchDistance
)
{
// creeping area
if
(
clear_counter_
>=
5
)
{
clear_counter_
=
0
;
// reset
return
FinishStage
(
frame
);
}
else
{
stop
=
true
;
}
}
if
(
stop
)
{
// build stop decision
ADEBUG
<<
"BuildStopDecision: bare pnc_junction["
<<
pnc_junction_overlap_id
<<
"] start_s["
<<
current_pnc_junction
->
start_s
<<
"]"
;
const
std
::
string
virtual_obstacle_id
=
"PNC_JUNCTION_"
+
current_pnc_junction
->
object_id
;
planning
::
util
::
BuildStopDecision
(
virtual_obstacle_id
,
current_pnc_junction
->
start_s
,
scenario_config_
.
stop_distance
(),
StopReasonCode
::
STOP_REASON_STOP_SIGN
,
wait_for_obstacle_ids
,
"bare intersection"
,
frame
,
&
(
frame
->
mutable_reference_line_info
()
->
front
()));
}
}
else
if
(
distance_adc_to_pnc_junction
<=
0
)
{
// rely on st-graph
return
FinishStage
(
frame
);
}
return
Stage
::
RUNNING
;
return
all_far_away
;
}
Stage
::
StageStatus
BareIntersectionUnprotectedStageApproach
::
FinishStage
(
...
...
modules/planning/scenarios/bare_intersection/unprotected/stage_approach.h
浏览文件 @
e5ad41b8
...
...
@@ -22,6 +22,7 @@
#include <memory>
#include <string>
#include <vector>
#include "modules/planning/scenarios/bare_intersection/unprotected/bare_intersection_unprotected_scenario.h"
#include "modules/planning/scenarios/stage.h"
...
...
@@ -47,12 +48,13 @@ class BareIntersectionUnprotectedStageApproach : public Stage {
return
GetContextAs
<
BareIntersectionUnprotectedContext
>
();
}
private:
bool
CheckClear
(
const
ReferenceLineInfo
&
reference_line_info
,
std
::
vector
<
std
::
string
>*
wait_for_obstacle_ids
);
Stage
::
StageStatus
FinishStage
(
Frame
*
frame
);
private:
ScenarioBareIntersectionUnprotectedConfig
scenario_config_
;
static
uint32_t
clear_counter_
;
};
}
// namespace bare_intersection
...
...
modules/planning/tasks/deciders/creep_decider/creep_decider.cc
浏览文件 @
e5ad41b8
...
...
@@ -190,8 +190,10 @@ bool CreepDecider::CheckCreepDone(const Frame& frame,
creep_clear_counter
=
0
;
// reset
creep_done
=
true
;
}
// use PlanningContext instead of static counter for multi-ADC
creep_decider_status
->
set_creep_clear_counter
(
creep_clear_counter
);
}
return
creep_done
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录