Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4f81a249
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,发现更多精彩内容 >>
提交
4f81a249
编写于
2月 20, 2019
作者:
K
kechxu
提交者:
Kecheng Xu
2月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: set caution level for keep lane scenario
上级
095c999d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
63 addition
and
0 deletion
+63
-0
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+1
-0
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+1
-0
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+6
-0
modules/prediction/container/obstacles/obstacle.h
modules/prediction/container/obstacles/obstacle.h
+5
-0
modules/prediction/container/obstacles/obstacles_container.cc
...les/prediction/container/obstacles/obstacles_container.cc
+7
-0
modules/prediction/scenario/prioritization/BUILD
modules/prediction/scenario/prioritization/BUILD
+1
-0
modules/prediction/scenario/prioritization/obstacles_prioritizer.cc
...ediction/scenario/prioritization/obstacles_prioritizer.cc
+40
-0
modules/prediction/scenario/prioritization/obstacles_prioritizer.h
...rediction/scenario/prioritization/obstacles_prioritizer.h
+2
-0
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
4f81a249
...
...
@@ -64,6 +64,7 @@ DEFINE_bool(enable_all_junction, false,
"If consider all junction with junction_mlp_model."
);
// Obstacle features
DEFINE_int32
(
ego_vehicle_id
,
-
1
,
"The obstacle ID of the ego vehicle."
);
DEFINE_double
(
scan_length
,
80.0
,
"The length of the obstacles scan area"
);
DEFINE_double
(
scan_width
,
12.0
,
"The width of the obstacles scan area"
);
DEFINE_double
(
back_dist_ignore_ped
,
-
2.0
,
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
4f81a249
...
...
@@ -48,6 +48,7 @@ DECLARE_bool(enable_junction_feature);
DECLARE_bool
(
enable_all_junction
);
// Obstacle features
DECLARE_int32
(
ego_vehicle_id
);
DECLARE_double
(
scan_length
);
DECLARE_double
(
scan_width
);
DECLARE_double
(
back_dist_ignore_ped
);
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
4f81a249
...
...
@@ -1528,5 +1528,11 @@ void Obstacle::InitRNNStates() {
bool
Obstacle
::
RNNEnabled
()
const
{
return
rnn_enabled_
;
}
void
Obstacle
::
SetCaution
()
{
CHECK_GT
(
feature_history_
.
size
(),
0
);
Feature
*
feature
=
mutable_latest_feature
();
feature
->
mutable_priority
()
->
set_priority
(
ObstaclePriority
::
CAUTION
);
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/container/obstacles/obstacle.h
浏览文件 @
4f81a249
...
...
@@ -225,6 +225,11 @@ class Obstacle {
*/
bool
RNNEnabled
()
const
;
/**
* @brief Set the obstacle as caution level
*/
void
SetCaution
();
private:
Obstacle
()
=
default
;
...
...
modules/prediction/container/obstacles/obstacles_container.cc
浏览文件 @
4f81a249
...
...
@@ -334,6 +334,13 @@ void ObstaclesContainer::BuildLaneGraph() {
ADEBUG
<<
"Building ordered Lane Graph."
;
obstacle_ptr
->
BuildLaneGraphFromLeftToRight
();
}
Obstacle
*
ego_vehicle
=
GetObstacle
(
FLAGS_ego_vehicle_id
);
if
(
ego_vehicle
==
nullptr
)
{
AERROR
<<
"Ego vehicle not inserted"
;
return
;
}
ego_vehicle
->
BuildLaneGraph
();
}
void
ObstaclesContainer
::
BuildJunctionFeature
()
{
...
...
modules/prediction/scenario/prioritization/BUILD
浏览文件 @
4f81a249
...
...
@@ -10,6 +10,7 @@ cc_library(
"//modules/prediction/common:environment_features"
,
"//modules/prediction/container:container_manager"
,
"//modules/prediction/container/obstacles:obstacles_container"
,
"//modules/prediction/container/obstacles:obstacle_clusters"
,
"//modules/prediction/container/pose:pose_container"
,
"//modules/prediction/scenario/scenario_features:scenario_features"
,
"//modules/prediction/scenario/scenario_features:cruise_scenario_features"
,
...
...
modules/prediction/scenario/prioritization/obstacles_prioritizer.cc
浏览文件 @
4f81a249
...
...
@@ -17,10 +17,12 @@
#include "modules/prediction/scenario/prioritization/obstacles_prioritizer.h"
#include <algorithm>
#include <limits>
#include "modules/prediction/common/prediction_gflags.h"
#include "modules/prediction/common/prediction_map.h"
#include "modules/prediction/container/container_manager.h"
#include "modules/prediction/container/obstacles/obstacle_clusters.h"
#include "modules/prediction/container/pose/pose_container.h"
namespace
apollo
{
...
...
@@ -180,5 +182,43 @@ void ObstaclesPrioritizer::AssignIgnoreLevelForCruiseScenario(
}
}
void
ObstaclesPrioritizer
::
AssignCautionLevelCruiseKeepLane
()
{
ObstaclesContainer
*
obstacles_container
=
ContainerManager
::
Instance
()
->
GetContainer
<
ObstaclesContainer
>
(
AdapterConfig
::
PERCEPTION_OBSTACLES
);
Obstacle
*
ego_vehicle
=
obstacles_container
->
GetObstacle
(
FLAGS_ego_vehicle_id
);
if
(
ego_vehicle
==
nullptr
)
{
AERROR
<<
"Ego vehicle not found"
;
return
;
}
if
(
ego_vehicle
->
history_size
()
==
0
)
{
AERROR
<<
"Ego vehicle has no history"
;
return
;
}
const
Feature
&
ego_latest_feature
=
ego_vehicle
->
latest_feature
();
for
(
const
LaneSequence
&
lane_sequence
:
ego_latest_feature
.
lane
().
lane_graph
().
lane_sequence
())
{
int
nearest_front_obstacle_id
=
-
10
;
double
smallest_relative_s
=
std
::
numeric_limits
<
double
>::
infinity
();
for
(
const
auto
&
nearby_obs
:
lane_sequence
.
nearby_obstacle
())
{
if
(
nearby_obs
.
s
()
<
0.0
)
{
continue
;
}
if
(
nearby_obs
.
s
()
<
smallest_relative_s
)
{
smallest_relative_s
=
nearby_obs
.
s
();
nearest_front_obstacle_id
=
nearby_obs
.
id
();
}
}
Obstacle
*
obstacle_ptr
=
obstacles_container
->
GetObstacle
(
nearest_front_obstacle_id
);
if
(
obstacle_ptr
==
nullptr
)
{
AERROR
<<
"Obstacle ["
<<
nearest_front_obstacle_id
<<
"] Not found"
;
continue
;
}
obstacle_ptr
->
SetCaution
();
}
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/scenario/prioritization/obstacles_prioritizer.h
浏览文件 @
4f81a249
...
...
@@ -40,6 +40,8 @@ class ObstaclesPrioritizer {
const
EnvironmentFeatures
&
environment_features
,
const
std
::
shared_ptr
<
CruiseScenarioFeatures
>
scenario_features
,
ObstaclesContainer
*
ptr_obstacle_contrainer
);
static
void
AssignCautionLevelCruiseKeepLane
();
};
}
// namespace prediction
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录