Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
8155a0cf
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,发现更多精彩内容 >>
提交
8155a0cf
编写于
7月 17, 2019
作者:
P
panjiacheng
提交者:
Kecheng Xu
7月 17, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: correct a few bugs and add ADC into obstacle-container.
上级
503785a3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
19 deletion
+42
-19
modules/prediction/common/message_process.cc
modules/prediction/common/message_process.cc
+13
-1
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+0
-4
modules/prediction/container/obstacles/obstacles_container.cc
...les/prediction/container/obstacles/obstacles_container.cc
+17
-8
modules/prediction/container/obstacles/obstacles_container.h
modules/prediction/container/obstacles/obstacles_container.h
+2
-0
modules/prediction/evaluator/evaluator_manager.cc
modules/prediction/evaluator/evaluator_manager.cc
+5
-4
modules/prediction/evaluator/vehicle/lane_scanning_evaluator.cc
...s/prediction/evaluator/vehicle/lane_scanning_evaluator.cc
+5
-2
未找到文件。
modules/prediction/common/message_process.cc
浏览文件 @
8155a0cf
...
...
@@ -17,6 +17,8 @@
#include "modules/prediction/common/message_process.h"
#include <algorithm>
#include <iomanip>
#include <limits>
#include <vector>
#include "cyber/common/file.h"
...
...
@@ -94,6 +96,7 @@ void MessageProcess::OnPerception(
ContainerManager
::
Instance
()
->
GetContainer
<
ObstaclesContainer
>
(
AdapterConfig
::
PERCEPTION_OBSTACLES
);
CHECK_NOTNULL
(
ptr_obstacles_container
);
ptr_obstacles_container
->
CleanUp
();
// Get pose_container
auto
ptr_ego_pose_container
=
...
...
@@ -111,8 +114,17 @@ void MessageProcess::OnPerception(
const
PerceptionObstacle
*
ptr_ego_vehicle
=
ptr_ego_pose_container
->
ToPerceptionObstacle
();
if
(
ptr_ego_vehicle
!=
nullptr
)
{
double
perception_obs_timestamp
=
ptr_ego_vehicle
->
timestamp
();
if
(
perception_obstacles
.
has_header
()
&&
perception_obstacles
.
header
().
has_timestamp_sec
())
{
ADEBUG
<<
"Correcting "
<<
std
::
fixed
<<
std
::
setprecision
(
6
)
<<
ptr_ego_vehicle
->
timestamp
()
<<
" to "
<<
std
::
fixed
<<
std
::
setprecision
(
6
)
<<
perception_obstacles
.
header
().
timestamp_sec
();
perception_obs_timestamp
=
perception_obstacles
.
header
().
timestamp_sec
();
}
ptr_obstacles_container
->
InsertPerceptionObstacle
(
*
ptr_ego_vehicle
,
p
tr_ego_vehicle
->
timestamp
()
);
*
ptr_ego_vehicle
,
p
erception_obs_timestamp
);
double
x
=
ptr_ego_vehicle
->
position
().
x
();
double
y
=
ptr_ego_vehicle
->
position
().
y
();
ADEBUG
<<
"Get ADC position ["
<<
std
::
fixed
<<
std
::
setprecision
(
6
)
<<
x
...
...
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
8155a0cf
...
...
@@ -443,10 +443,6 @@ void Obstacle::SetType(const PerceptionObstacle& perception_obstacle,
void
Obstacle
::
SetTimestamp
(
const
PerceptionObstacle
&
perception_obstacle
,
const
double
timestamp
,
Feature
*
feature
)
{
double
ts
=
timestamp
;
if
(
perception_obstacle
.
has_timestamp
()
&&
perception_obstacle
.
timestamp
()
>
0.0
)
{
ts
=
perception_obstacle
.
timestamp
();
}
feature
->
set_timestamp
(
ts
);
ADEBUG
<<
"Obstacle ["
<<
id_
<<
"] has timestamp ["
<<
std
::
fixed
...
...
modules/prediction/container/obstacles/obstacles_container.cc
浏览文件 @
8155a0cf
...
...
@@ -16,6 +16,8 @@
#include "modules/prediction/container/obstacles/obstacles_container.h"
#include <iomanip>
#include <limits>
#include <unordered_set>
#include <utility>
...
...
@@ -37,16 +39,18 @@ ObstaclesContainer::ObstaclesContainer()
:
ptr_obstacles_
(
FLAGS_max_num_obstacles
),
id_mapping_
(
FLAGS_max_num_obstacles
)
{}
// This is called by Perception module at every frame to insert all
// detected obstacles.
void
ObstaclesContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{
void
ObstaclesContainer
::
CleanUp
()
{
// Clean up the history and get the PerceptionObstacles
curr_frame_id_mapping_
.
clear
();
curr_frame_movable_obstacle_ids_
.
clear
();
curr_frame_unmovable_obstacle_ids_
.
clear
();
curr_frame_considered_obstacle_ids_
.
clear
();
curr_frame_id_perception_obstacle_map_
.
clear
();
}
// This is called by Perception module at every frame to insert all
// detected obstacles.
void
ObstaclesContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{
PerceptionObstacles
perception_obstacles
;
perception_obstacles
.
CopyFrom
(
dynamic_cast
<
const
PerceptionObstacles
&>
(
message
));
...
...
@@ -56,7 +60,6 @@ void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
// obstacle history.
// - If it's not a valid time (earlier than history), continue.
// - Also consider the offline_mode case.
double
timestamp
=
0.0
;
if
(
perception_obstacles
.
has_header
()
&&
perception_obstacles
.
header
().
has_timestamp_sec
())
{
...
...
@@ -116,7 +119,8 @@ void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
}
timestamp_
=
timestamp
;
ADEBUG
<<
"Current timestamp is ["
<<
timestamp_
<<
"]"
;
ADEBUG
<<
"Current timestamp is ["
<<
std
::
fixed
<<
std
::
setprecision
(
6
)
<<
timestamp_
<<
"]"
;
// Prediction tracking adaptation
if
(
FLAGS_enable_tracking_adaptation
)
{
...
...
@@ -136,7 +140,8 @@ void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
ADEBUG
<<
"Perception obstacle ["
<<
perception_obstacle
.
id
()
<<
"] "
<<
"was inserted"
;
}
// 3. Sort the Obstacles
SetConsideredObstacleIds
();
ObstacleClusters
::
SortObstacles
();
}
...
...
@@ -230,6 +235,8 @@ void ObstaclesContainer::InsertPerceptionObstacle(
// Insert the obstacle and also update the LRUCache.
auto
obstacle_ptr
=
GetObstacleWithLRUUpdate
(
id
);
if
(
obstacle_ptr
!=
nullptr
)
{
ADEBUG
<<
"Current time = "
<<
std
::
fixed
<<
std
::
setprecision
(
6
)
<<
timestamp
;
obstacle_ptr
->
Insert
(
perception_obstacle
,
timestamp
,
id
);
ADEBUG
<<
"Refresh obstacle ["
<<
id
<<
"]"
;
}
else
{
...
...
@@ -242,10 +249,11 @@ void ObstaclesContainer::InsertPerceptionObstacle(
ADEBUG
<<
"Insert obstacle ["
<<
id
<<
"]"
;
}
if
(
id
!=
FLAGS_ego_vehicle_id
)
{
if
(
FLAGS_prediction_offline_mode
==
PredictionConstants
::
kDumpDataForLearning
||
id
!=
FLAGS_ego_vehicle_id
)
{
curr_frame_movable_obstacle_ids_
.
push_back
(
id
);
}
SetConsideredObstacleIds
();
}
void
ObstaclesContainer
::
InsertFeatureProto
(
const
Feature
&
feature
)
{
...
...
@@ -354,6 +362,7 @@ void ObstaclesContainer::BuildLaneGraph() {
obstacle_ptr
->
BuildLaneGraphFromLeftToRight
();
}
else
{
ADEBUG
<<
"Building ordered Lane Graph."
;
ADEBUG
<<
"Building lane graph for id = "
<<
id
;
obstacle_ptr
->
BuildLaneGraphFromLeftToRight
();
}
obstacle_ptr
->
SetNearbyObstacles
();
...
...
modules/prediction/container/obstacles/obstacles_container.h
浏览文件 @
8155a0cf
...
...
@@ -94,6 +94,8 @@ class ObstaclesContainer : public Container {
*/
void
Clear
();
void
CleanUp
();
size_t
NumOfObstacles
()
{
return
ptr_obstacles_
.
size
();
}
const
apollo
::
perception
::
PerceptionObstacle
&
GetPerceptionObstacle
(
...
...
modules/prediction/evaluator/evaluator_manager.cc
浏览文件 @
8155a0cf
...
...
@@ -145,6 +145,11 @@ void EvaluatorManager::Init(const PredictionConf& config) {
}
else
{
vehicle_in_junction_evaluator_
=
obstacle_conf
.
evaluator_type
();
}
if
(
FLAGS_prediction_offline_mode
==
PredictionConstants
::
kDumpDataForLearning
)
{
vehicle_in_junction_evaluator_
=
ObstacleConf
::
LANE_SCANNING_EVALUATOR
;
}
}
break
;
}
...
...
@@ -222,10 +227,6 @@ void EvaluatorManager::Run() {
});
}
else
{
for
(
int
id
:
obstacles_container
->
curr_frame_considered_obstacle_ids
())
{
if
(
id
<
0
)
{
ADEBUG
<<
"The obstacle has invalid id ["
<<
id
<<
"]."
;
continue
;
}
Obstacle
*
obstacle
=
obstacles_container
->
GetObstacle
(
id
);
if
(
obstacle
==
nullptr
)
{
...
...
modules/prediction/evaluator/vehicle/lane_scanning_evaluator.cc
浏览文件 @
8155a0cf
...
...
@@ -92,9 +92,12 @@ bool LaneScanningEvaluator::Evaluate(Obstacle* obstacle_ptr,
std
::
vector
<
double
>
labels
=
{
0.0
};
if
(
FLAGS_prediction_offline_mode
==
PredictionConstants
::
kDumpDataForLearning
)
{
std
::
string
learning_data_tag
=
"cruise"
;
if
(
latest_feature_ptr
->
has_junction_feature
())
{
learning_data_tag
=
"junction"
;
}
FeatureOutput
::
InsertDataForLearning
(
*
latest_feature_ptr
,
feature_values
,
string_feature_values
,
"cruise"
,
nullptr
);
string_feature_values
,
learning_data_tag
,
nullptr
);
ADEBUG
<<
"Save extracted features for learning locally."
;
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录