Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
5d800762
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,发现更多精彩内容 >>
提交
5d800762
编写于
11月 19, 2018
作者:
J
jmtao
提交者:
Jiangtao Hu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: stop_sign scenario fix end condition and transferrable condition
上级
e540ecf2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
15 deletion
+63
-15
modules/planning/scenarios/stop_sign/stop_sign_unprotected/stop_sign_unprotected_intersection_cruise.cc
..._unprotected/stop_sign_unprotected_intersection_cruise.cc
+29
-2
modules/planning/scenarios/stop_sign/stop_sign_unprotected/stop_sign_unprotected_intersection_cruise.h
...n_unprotected/stop_sign_unprotected_intersection_cruise.h
+18
-2
modules/planning/scenarios/stop_sign/stop_sign_unprotected/stop_sign_unprotected_scenario.cc
...n/stop_sign_unprotected/stop_sign_unprotected_scenario.cc
+16
-11
未找到文件。
modules/planning/scenarios/stop_sign/stop_sign_unprotected/stop_sign_unprotected_intersection_cruise.cc
浏览文件 @
5d800762
...
...
@@ -38,6 +38,7 @@ namespace planning {
namespace
scenario
{
namespace
stop_sign
{
using
apollo
::
hdmap
::
PathOverlap
;
using
common
::
TrajectoryPoint
;
Stage
::
StageStatus
StopSignUnprotectedIntersectionCruise
::
Process
(
...
...
@@ -45,8 +46,7 @@ Stage::StageStatus StopSignUnprotectedIntersectionCruise::Process(
ADEBUG
<<
"stage: IntersectionCruise"
;
CHECK_NOTNULL
(
frame
);
if
(
GetContext
()
->
stop_sign_id
!=
PlanningContext
::
GetScenarioInfo
()
->
next_stop_sign_overlap
.
object_id
)
{
if
(
CheckPassIntersection
(
frame
))
{
next_stage_
=
ScenarioConfig
::
NO_STAGE
;
return
Stage
::
FINISHED
;
}
...
...
@@ -58,6 +58,33 @@ Stage::StageStatus StopSignUnprotectedIntersectionCruise::Process(
return
Stage
::
RUNNING
;
}
bool
StopSignUnprotectedIntersectionCruise
::
CheckPassIntersection
(
Frame
*
frame
)
{
// TODO(all): update when pnc-junction is ready
constexpr
double
kIntersectionLength
=
10.0
;
// unit: m
auto
&
reference_line_info
=
frame
->
mutable_reference_line_info
()
->
front
();
double
stop_sign_oberlap_end_s
=
0
;
const
std
::
vector
<
PathOverlap
>&
stop_sign_overlaps
=
reference_line_info
.
reference_line
().
map_path
().
stop_sign_overlaps
();
for
(
const
PathOverlap
&
stop_sign_overlap
:
stop_sign_overlaps
)
{
if
(
GetContext
()
->
stop_sign_id
==
stop_sign_overlap
.
object_id
)
{
stop_sign_oberlap_end_s
=
stop_sign_overlap
.
end_s
;
break
;
}
}
const
double
adc_back_edge_s
=
reference_line_info
.
AdcSlBoundary
().
start_s
();
ADEBUG
<<
"adc_back_edge_s["
<<
adc_back_edge_s
<<
"] stop_sign_overlap_end_s["
<<
stop_sign_oberlap_end_s
<<
"]"
;
if
(
adc_back_edge_s
-
stop_sign_oberlap_end_s
>
kIntersectionLength
)
{
return
true
;
}
return
false
;
}
}
// namespace stop_sign
}
// namespace scenario
}
// namespace planning
...
...
modules/planning/scenarios/stop_sign/stop_sign_unprotected/stop_sign_unprotected_intersection_cruise.h
浏览文件 @
5d800762
...
...
@@ -36,8 +36,24 @@ namespace stop_sign {
struct
StopSignUnprotectedContext
;
DECLARE_STAGE
(
StopSignUnprotectedIntersectionCruise
,
StopSignUnprotectedContext
);
class
StopSignUnprotectedIntersectionCruise
:
public
Stage
{
public:
explicit
StopSignUnprotectedIntersectionCruise
(
const
ScenarioConfig
::
StageConfig
&
config
)
:
Stage
(
config
)
{}
private:
Stage
::
StageStatus
Process
(
const
common
::
TrajectoryPoint
&
planning_init_point
,
Frame
*
frame
)
override
;
StopSignUnprotectedContext
*
GetContext
()
{
return
GetContextAs
<
StopSignUnprotectedContext
>
();
}
bool
CheckPassIntersection
(
Frame
*
frame
);
private:
ScenarioStopSignUnprotectedConfig
scenario_config_
;
};
}
// namespace stop_sign
}
// namespace scenario
...
...
modules/planning/scenarios/stop_sign/stop_sign_unprotected/stop_sign_unprotected_scenario.cc
浏览文件 @
5d800762
...
...
@@ -131,11 +131,11 @@ bool StopSignUnprotectedScenario::IsTransferable(
const
Scenario
&
current_scenario
,
const
common
::
TrajectoryPoint
&
ego_point
,
const
Frame
&
frame
)
{
const
std
::
string
stop_sign_overlap_id
=
PlanningContext
::
GetScenarioInfo
()
->
next_stop_sign_overlap
.
object_id
;
if
(
stop_sign_overlap_id
.
empty
())
{
return
false
;
}
//
const std::string stop_sign_overlap_id =
//
PlanningContext::GetScenarioInfo()->next_stop_sign_overlap.object_id;
//
if (stop_sign_overlap_id.empty()) {
//
return false;
//
}
const
auto
&
reference_line_info
=
frame
.
reference_line_info
().
front
();
const
double
adc_front_edge_s
=
reference_line_info
.
AdcSlBoundary
().
end_s
();
...
...
@@ -149,23 +149,28 @@ bool StopSignUnprotectedScenario::IsTransferable(
static_cast
<
uint32_t
>
(
ceil
(
adc_distance_to_stop_sign
/
adc_speed
))
:
0
;
ADEBUG
<<
"adc_distance_to_stop_sign["
<<
adc_distance_to_stop_sign
<<
"] stop_sign_overlap_start_s["
<<
stop_sign_overlap_start_s
<<
"] adc_speed["
<<
adc_speed
<<
"] time_distance["
<<
time_distance
<<
"]"
;
ADEBUG
<<
"IsTransferable: current: "
<<
current_scenario
.
Name
()
<<
"; status: "
<<
current_scenario
.
GetStatus
();
switch
(
current_scenario
.
scenario_type
())
{
case
ScenarioConfig
::
LANE_FOLLOW
:
case
ScenarioConfig
::
CHANGE_LANE
:
case
ScenarioConfig
::
SIDE_PASS
:
case
ScenarioConfig
::
APPROACH
:
return
(
adc_distance_to_stop_sign
<=
config_
.
stop_sign_unprotected_config
().
start_stop_sign_scenario_distance
()
||
time_distance
<=
config_
.
stop_sign_unprotected_config
().
start_stop_sign_scenario_timer
());
return
(
adc_distance_to_stop_sign
>
0
&&
(
adc_distance_to_stop_sign
<=
config_
.
stop_sign_unprotected_config
().
start_stop_sign_scenario_distance
()
||
time_distance
<=
config_
.
stop_sign_unprotected_config
().
start_stop_sign_scenario_timer
()));
case
ScenarioConfig
::
STOP_SIGN_PROTECTED
:
return
false
;
case
ScenarioConfig
::
STOP_SIGN_UNPROTECTED
:
return
true
;
return
(
current_scenario
.
GetStatus
()
!=
Scenario
::
ScenarioStatus
::
STATUS_DONE
);
case
ScenarioConfig
::
TRAFFIC_LIGHT_LEFT_TURN_PROTECTED
:
case
ScenarioConfig
::
TRAFFIC_LIGHT_LEFT_TURN_UNPROTECTED
:
case
ScenarioConfig
::
TRAFFIC_LIGHT_RIGHT_TURN_PROTECTED
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录