Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
46d7b598
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,发现更多精彩内容 >>
提交
46d7b598
编写于
12月 20, 2017
作者:
D
Dong Li
提交者:
Jiangtao Hu
12月 20, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: filter out obstacle based on perception information
上级
3c3bfc66
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
60 addition
and
39 deletion
+60
-39
modules/planning/common/path_obstacle.cc
modules/planning/common/path_obstacle.cc
+2
-16
modules/planning/common/path_obstacle.h
modules/planning/common/path_obstacle.h
+5
-5
modules/planning/common/reference_line_info.cc
modules/planning/common/reference_line_info.cc
+35
-14
modules/planning/common/reference_line_info.h
modules/planning/common/reference_line_info.h
+3
-2
modules/planning/reference_line/reference_line.cc
modules/planning/reference_line/reference_line.cc
+12
-0
modules/planning/reference_line/reference_line.h
modules/planning/reference_line/reference_line.h
+1
-0
modules/planning/tasks/traffic_decider/backside_vehicle.cc
modules/planning/tasks/traffic_decider/backside_vehicle.cc
+2
-2
未找到文件。
modules/planning/common/path_obstacle.cc
浏览文件 @
46d7b598
...
...
@@ -64,22 +64,8 @@ PathObstacle::PathObstacle(const Obstacle* obstacle) : obstacle_(obstacle) {
id_
=
obstacle_
->
Id
();
}
bool
PathObstacle
::
Init
(
const
ReferenceLine
&
reference_line
,
double
adc_start_s
)
{
if
(
!
reference_line
.
GetSLBoundary
(
obstacle_
->
PerceptionBoundingBox
(),
&
perception_sl_boundary_
))
{
AERROR
<<
"Failed to get sl boundary for obstacle: "
<<
id_
;
return
false
;
}
if
(
perception_sl_boundary_
.
start_s
()
<
0
||
perception_sl_boundary_
.
end_s
()
>
reference_line
.
Length
())
{
return
true
;
}
// TODO(All): reduce the calculation time of BuildStBoundary
BuildStBoundary
(
reference_line
,
adc_start_s
);
return
true
;
void
PathObstacle
::
SetPerceptionSlBoundary
(
const
SLBoundary
&
sl_boundary
)
{
perception_sl_boundary_
=
sl_boundary
;
}
void
PathObstacle
::
BuildStBoundary
(
const
ReferenceLine
&
reference_line
,
...
...
modules/planning/common/path_obstacle.h
浏览文件 @
46d7b598
...
...
@@ -65,8 +65,6 @@ class PathObstacle {
PathObstacle
()
=
default
;
explicit
PathObstacle
(
const
Obstacle
*
obstacle
);
bool
Init
(
const
ReferenceLine
&
reference_line
,
const
double
adc_start_s
);
const
std
::
string
&
Id
()
const
;
const
Obstacle
*
obstacle
()
const
;
...
...
@@ -120,6 +118,11 @@ class PathObstacle {
bool
IsLongitudinalIgnore
()
const
;
bool
IsLateralIgnore
()
const
;
void
BuildStBoundary
(
const
ReferenceLine
&
reference_line
,
const
double
adc_start_s
);
void
SetPerceptionSlBoundary
(
const
SLBoundary
&
sl_boundary
);
private:
/**
* @brief check if a ObjectDecisionType is a lateral decision.
...
...
@@ -140,9 +143,6 @@ class PathObstacle {
static
ObjectDecisionType
MergeLateralDecision
(
const
ObjectDecisionType
&
lhs
,
const
ObjectDecisionType
&
rhs
);
void
BuildStBoundary
(
const
ReferenceLine
&
reference_line
,
const
double
adc_start_s
);
bool
BuildTrajectoryStBoundary
(
const
ReferenceLine
&
reference_line
,
const
double
adc_start_s
,
StBoundary
*
const
st_boundary
);
...
...
modules/planning/common/reference_line_info.cc
浏览文件 @
46d7b598
...
...
@@ -85,6 +85,7 @@ bool ReferenceLineInfo::Init() {
AERROR
<<
"Ego vehicle is too far away from reference line."
;
return
false
;
}
is_on_reference_line_
=
reference_line_
.
IsOnRoad
(
adc_sl_boundary_
);
return
true
;
}
...
...
@@ -148,12 +149,29 @@ void ReferenceLineInfo::SetTrajectory(const DiscretizedTrajectory& trajectory) {
}
PathObstacle
*
ReferenceLineInfo
::
AddObstacle
(
const
Obstacle
*
obstacle
)
{
auto
path_obstacle
=
CreatePathObstacle
(
obstacle
);
if
(
!
path_obstacle
)
{
AERROR
<<
"Failed to create path obstacle for "
<<
obstacle
->
Id
();
return
nullptr
;
auto
path_obstacle_ptr
=
std
::
unique_ptr
<
PathObstacle
>
(
new
PathObstacle
(
obstacle
));
auto
*
path_obstacle
=
path_decision_
.
AddPathObstacle
(
*
path_obstacle_ptr
);
SLBoundary
perception_sl
;
if
(
!
reference_line_
.
GetSLBoundary
(
obstacle
->
PerceptionBoundingBox
(),
&
perception_sl
))
{
AERROR
<<
"Failed to get sl boundary for obstacle: "
<<
obstacle
->
Id
();
return
path_obstacle
;
}
return
path_decision_
.
AddPathObstacle
(
*
path_obstacle
);
path_obstacle
->
SetPerceptionSlBoundary
(
perception_sl
);
if
(
IsUnrelaventObstacle
(
path_obstacle
))
{
ObjectDecisionType
ignore
;
ignore
.
mutable_ignore
();
path_decision_
.
AddLateralDecision
(
"reference_line_filter"
,
obstacle
->
Id
(),
ignore
);
path_decision_
.
AddLongitudinalDecision
(
"reference_line_filter"
,
obstacle
->
Id
(),
ignore
);
}
else
{
path_obstacle
->
BuildStBoundary
(
reference_line_
,
adc_sl_boundary_
.
start_s
());
}
return
path_obstacle
;
}
bool
ReferenceLineInfo
::
AddObstacles
(
...
...
@@ -167,16 +185,19 @@ bool ReferenceLineInfo::AddObstacles(
return
true
;
}
std
::
unique_ptr
<
PathObstacle
>
ReferenceLineInfo
::
CreatePathObstacle
(
const
Obstacle
*
obstacle
)
{
auto
path_obstacle
=
std
::
unique_ptr
<
PathObstacle
>
(
new
PathObstacle
(
obstacle
));
if
(
!
path_obstacle
->
Init
(
reference_line_
,
adc_sl_boundary_
.
end_s
()))
{
AERROR
<<
"Failed to create perception sl boundary for obstacle "
<<
obstacle
->
Id
();
return
nullptr
;
bool
ReferenceLineInfo
::
IsUnrelaventObstacle
(
PathObstacle
*
path_obstacle
)
{
// if adc is on the road, and obstacle behind adc, ignore
if
(
path_obstacle
->
perception_sl_boundary
().
end_s
()
>
reference_line_
.
Length
())
{
return
true
;
}
return
path_obstacle
;
if
(
is_on_reference_line_
&&
path_obstacle
->
perception_sl_boundary
().
end_s
()
<
adc_sl_boundary_
.
end_s
()
&&
reference_line_
.
IsOnRoad
(
path_obstacle
->
perception_sl_boundary
()))
{
return
true
;
}
return
false
;
}
const
DiscretizedTrajectory
&
ReferenceLineInfo
::
trajectory
()
const
{
...
...
modules/planning/common/reference_line_info.h
浏览文件 @
46d7b598
...
...
@@ -118,8 +118,7 @@ class ReferenceLineInfo {
private:
void
ExportTurnSignal
(
common
::
VehicleSignal
*
signal
)
const
;
std
::
unique_ptr
<
PathObstacle
>
CreatePathObstacle
(
const
Obstacle
*
obstacle
);
bool
InitPerceptionSLBoundary
(
PathObstacle
*
path_obstacle
);
bool
IsUnrelaventObstacle
(
PathObstacle
*
path_obstacle
);
void
MakeDecision
(
DecisionResult
*
decision_result
)
const
;
int
MakeMainStopDecision
(
DecisionResult
*
decision_result
)
const
;
...
...
@@ -152,6 +151,8 @@ class ReferenceLineInfo {
hdmap
::
RouteSegments
lanes_
;
bool
is_on_reference_line_
=
false
;
ADCTrajectory
::
RightOfWayStatus
status_
=
ADCTrajectory
::
UNPROTECTED
;
DISALLOW_COPY_AND_ASSIGN
(
ReferenceLineInfo
);
...
...
modules/planning/reference_line/reference_line.cc
浏览文件 @
46d7b598
...
...
@@ -383,6 +383,18 @@ bool ReferenceLine::IsOnRoad(const common::math::Vec2d& vec2d_point) const {
return
IsOnRoad
(
sl_point
);
}
bool
ReferenceLine
::
IsOnRoad
(
const
SLBoundary
&
sl_boundary
)
const
{
if
(
sl_boundary
.
end_s
()
<
0
||
sl_boundary
.
start_s
()
>
Length
())
{
return
false
;
}
double
middle_s
=
(
sl_boundary
.
start_s
()
+
sl_boundary
.
end_s
())
/
2.0
;
double
left_width
=
0.0
;
double
right_width
=
0.0
;
map_path_
.
GetWidth
(
middle_s
,
&
left_width
,
&
right_width
);
return
sl_boundary
.
start_l
()
>=
-
right_width
&&
sl_boundary
.
end_l
()
<=
left_width
;
}
bool
ReferenceLine
::
IsBlockRoad
(
const
common
::
math
::
Box2d
&
box2d
,
double
gap
)
const
{
return
map_path_
.
OverlapWith
(
box2d
,
gap
);
...
...
modules/planning/reference_line/reference_line.h
浏览文件 @
46d7b598
...
...
@@ -96,6 +96,7 @@ class ReferenceLine {
double
*
const
right_width
)
const
;
bool
IsOnRoad
(
const
common
::
SLPoint
&
sl_point
)
const
;
bool
IsOnRoad
(
const
common
::
math
::
Vec2d
&
vec2d_point
)
const
;
bool
IsOnRoad
(
const
SLBoundary
&
sl_boundary
)
const
;
/**
* @brief Check if a box is blocking the road surface. The crieria is to check
...
...
modules/planning/tasks/traffic_decider/backside_vehicle.cc
浏览文件 @
46d7b598
...
...
@@ -55,8 +55,8 @@ void BacksideVehicle::MakeLaneKeepingObstacleDecision(
continue
;
}
if
(
path_obstacle
->
perception_sl_boundary
().
start_s
()
<
adc_sl_boundary
.
end_s
())
{
if
(
path_obstacle
->
perception_sl_boundary
().
start_s
()
<
adc_sl_boundary
.
end_s
())
{
path_decision
->
AddLongitudinalDecision
(
rule_id
,
path_obstacle
->
Id
(),
ignore
);
path_decision
->
AddLateralDecision
(
rule_id
,
path_obstacle
->
Id
(),
ignore
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录