Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
cf681114
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,发现更多精彩内容 >>
提交
cf681114
编写于
9月 17, 2018
作者:
K
kechxu
提交者:
Liangliang Zhang
9月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: split off building lane graph from inserting perception message
上级
5174a48d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
41 addition
and
4 deletion
+41
-4
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+6
-2
modules/prediction/container/obstacles/obstacle.h
modules/prediction/container/obstacles/obstacle.h
+5
-2
modules/prediction/container/obstacles/obstacle_test.cc
modules/prediction/container/obstacles/obstacle_test.cc
+1
-0
modules/prediction/container/obstacles/obstacles_container.cc
...les/prediction/container/obstacles/obstacles_container.cc
+14
-0
modules/prediction/container/obstacles/obstacles_container.h
modules/prediction/container/obstacles/obstacles_container.h
+8
-0
modules/prediction/prediction_component.cc
modules/prediction/prediction_component.cc
+2
-0
modules/prediction/predictor/lane_sequence/lane_sequence_predictor_test.cc
...n/predictor/lane_sequence/lane_sequence_predictor_test.cc
+1
-0
modules/prediction/predictor/move_sequence/move_sequence_predictor_test.cc
...n/predictor/move_sequence/move_sequence_predictor_test.cc
+2
-0
modules/prediction/predictor/sequence/sequence_predictor_test.cc
.../prediction/predictor/sequence/sequence_predictor_test.cc
+1
-0
modules/prediction/predictor/single_lane/single_lane_predictor_test.cc
...ction/predictor/single_lane/single_lane_predictor_test.cc
+1
-0
未找到文件。
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
cf681114
...
...
@@ -177,7 +177,6 @@ void Obstacle::Insert(const PerceptionObstacle& perception_obstacle,
// Set obstacle lane features
SetCurrentLanes
(
&
feature
);
SetNearbyLanes
(
&
feature
);
SetLaneGraphFeature
(
&
feature
);
if
(
FLAGS_adjust_vehicle_heading_by_lane
&&
type_
==
PerceptionObstacle
::
VEHICLE
)
{
...
...
@@ -837,7 +836,12 @@ void Obstacle::SetNearbyLanes(Feature* feature) {
}
}
void
Obstacle
::
SetLaneGraphFeature
(
Feature
*
feature
)
{
void
Obstacle
::
BuildLaneGraph
()
{
if
(
history_size
()
==
0
)
{
AERROR
<<
"No feature found."
;
return
;
}
Feature
*
feature
=
mutable_latest_feature
();
double
speed
=
feature
->
speed
();
double
road_graph_distance
=
std
::
max
(
speed
*
FLAGS_prediction_duration
+
...
...
modules/prediction/container/obstacles/obstacle.h
浏览文件 @
cf681114
...
...
@@ -150,6 +150,11 @@ class Obstacle {
*/
bool
IsNearJunction
();
/**
* @brief Build obstacle's lane graph
*/
void
BuildLaneGraph
();
/**
* @brief Set RNN state
* @param RNN state matrix
...
...
@@ -221,8 +226,6 @@ class Obstacle {
void
SetNearbyLanes
(
Feature
*
feature
);
void
SetLaneGraphFeature
(
Feature
*
feature
);
void
SetLanePoints
(
Feature
*
feature
);
void
SetLaneSequencePath
(
LaneGraph
*
const
lane_graph
);
...
...
modules/prediction/container/obstacles/obstacle_test.cc
浏览文件 @
cf681114
...
...
@@ -52,6 +52,7 @@ class ObstacleTest : public KMLMapBasedTest {
perception
::
PerceptionObstacles
perception_obstacles
;
common
::
util
::
GetProtoFromFile
(
filename
,
&
perception_obstacles
);
container_
.
Insert
(
perception_obstacles
);
container_
.
BuildLaneGraph
();
}
}
...
...
modules/prediction/container/obstacles/obstacles_container.cc
浏览文件 @
cf681114
...
...
@@ -33,6 +33,7 @@ ObstaclesContainer::ObstaclesContainer()
:
obstacles_
(
FLAGS_max_num_obstacles
)
{}
void
ObstaclesContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{
curr_frame_predictable_obstacle_ids_
.
clear
();
PerceptionObstacles
perception_obstacles
;
perception_obstacles
.
CopyFrom
(
dynamic_cast
<
const
PerceptionObstacles
&>
(
message
));
...
...
@@ -91,6 +92,7 @@ void ObstaclesContainer::InsertPerceptionObstacle(
ADEBUG
<<
"Perception obstacle ["
<<
id
<<
"] is not predictable."
;
return
;
}
curr_frame_predictable_obstacle_ids_
.
push_back
(
id
);
Obstacle
*
obstacle_ptr
=
obstacles_
.
GetSilently
(
id
);
if
(
obstacle_ptr
!=
nullptr
)
{
obstacle_ptr
->
Insert
(
perception_obstacle
,
timestamp
);
...
...
@@ -101,6 +103,18 @@ void ObstaclesContainer::InsertPerceptionObstacle(
}
}
void
ObstaclesContainer
::
BuildLaneGraph
()
{
// TODO(kechxu) implement building lane graph, lane sequences
for
(
const
int
id
:
curr_frame_predictable_obstacle_ids_
)
{
Obstacle
*
obstacle_ptr
=
obstacles_
.
GetSilently
(
id
);
if
(
obstacle_ptr
==
nullptr
)
{
AERROR
<<
"Null obstacle found."
;
continue
;
}
obstacle_ptr
->
BuildLaneGraph
();
}
}
bool
ObstaclesContainer
::
IsPredictable
(
const
PerceptionObstacle
&
perception_obstacle
)
{
if
(
!
perception_obstacle
.
has_type
()
||
...
...
modules/prediction/container/obstacles/obstacles_container.h
浏览文件 @
cf681114
...
...
@@ -22,6 +22,8 @@
#ifndef MODULES_PREDICTION_CONTAINER_OBSTACLES_OBSTACLES_CONTAINER_H_
#define MODULES_PREDICTION_CONTAINER_OBSTACLES_OBSTACLES_CONTAINER_H_
#include <vector>
#include "cybertron/common/macros.h"
#include "modules/common/util/lru_cache.h"
...
...
@@ -59,6 +61,11 @@ class ObstaclesContainer : public Container {
const
perception
::
PerceptionObstacle
&
perception_obstacle
,
const
double
timestamp
);
/**
* @brief Build lane graph for obstacles
*/
void
BuildLaneGraph
();
/**
* @brief Get obstacle pointer
* @param Obstacle ID
...
...
@@ -82,6 +89,7 @@ class ObstaclesContainer : public Container {
private:
double
timestamp_
=
-
1.0
;
common
::
util
::
LRUCache
<
int
,
Obstacle
>
obstacles_
;
std
::
vector
<
int
>
curr_frame_predictable_obstacle_ids_
;
};
}
// namespace prediction
...
...
modules/prediction/prediction_component.cc
浏览文件 @
cf681114
...
...
@@ -233,6 +233,8 @@ bool PredictionComponent::Proc(
CHECK_NOTNULL
(
obstacles_container
);
obstacles_container
->
Insert
(
*
perception_obstacles
);
obstacles_container
->
BuildLaneGraph
();
ADEBUG
<<
"Received a perception message ["
<<
perception_obstacles
->
ShortDebugString
()
<<
"]."
;
...
...
modules/prediction/predictor/lane_sequence/lane_sequence_predictor_test.cc
浏览文件 @
cf681114
...
...
@@ -54,6 +54,7 @@ TEST_F(LaneSequencePredictorTest, OnLaneCase) {
MLPEvaluator
mlp_evaluator
;
ObstaclesContainer
container
;
container
.
Insert
(
perception_obstacles_
);
container
.
BuildLaneGraph
();
Obstacle
*
obstacle_ptr
=
container
.
GetObstacle
(
1
);
EXPECT_TRUE
(
obstacle_ptr
!=
nullptr
);
mlp_evaluator
.
Evaluate
(
obstacle_ptr
);
...
...
modules/prediction/predictor/move_sequence/move_sequence_predictor_test.cc
浏览文件 @
cf681114
...
...
@@ -54,6 +54,7 @@ TEST_F(MoveSequencePredictorTest, OnLaneCase) {
MLPEvaluator
mlp_evaluator
;
ObstaclesContainer
container
;
container
.
Insert
(
perception_obstacles_
);
container
.
BuildLaneGraph
();
Obstacle
*
obstacle_ptr
=
container
.
GetObstacle
(
1
);
EXPECT_TRUE
(
obstacle_ptr
!=
nullptr
);
mlp_evaluator
.
Evaluate
(
obstacle_ptr
);
...
...
@@ -71,6 +72,7 @@ TEST_F(MoveSequencePredictorTest, Polynomial) {
MLPEvaluator
mlp_evaluator
;
ObstaclesContainer
container
;
container
.
Insert
(
perception_obstacles_
);
container
.
BuildLaneGraph
();
Obstacle
*
obstacle_ptr
=
container
.
GetObstacle
(
1
);
EXPECT_TRUE
(
obstacle_ptr
!=
nullptr
);
mlp_evaluator
.
Evaluate
(
obstacle_ptr
);
...
...
modules/prediction/predictor/sequence/sequence_predictor_test.cc
浏览文件 @
cf681114
...
...
@@ -54,6 +54,7 @@ TEST_F(SequencePredictorTest, General) {
MLPEvaluator
mlp_evaluator
;
ObstaclesContainer
container
;
container
.
Insert
(
perception_obstacles_
);
container
.
BuildLaneGraph
();
Obstacle
*
obstacle_ptr
=
container
.
GetObstacle
(
1
);
EXPECT_TRUE
(
obstacle_ptr
!=
nullptr
);
mlp_evaluator
.
Evaluate
(
obstacle_ptr
);
...
...
modules/prediction/predictor/single_lane/single_lane_predictor_test.cc
浏览文件 @
cf681114
...
...
@@ -54,6 +54,7 @@ TEST_F(SingleLanePredictorTest, OnLaneCase) {
CostEvaluator
cost_evaluator
;
ObstaclesContainer
container
;
container
.
Insert
(
perception_obstacles_
);
container
.
BuildLaneGraph
();
Obstacle
*
obstacle_ptr
=
container
.
GetObstacle
(
1
);
EXPECT_TRUE
(
obstacle_ptr
!=
nullptr
);
cost_evaluator
.
Evaluate
(
obstacle_ptr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录