Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
a321f498
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,发现更多精彩内容 >>
提交
a321f498
编写于
1月 29, 2019
作者:
K
kechxu
提交者:
Kecheng Xu
2月 01, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: add ego-vehicle feature into junction mlp model
上级
3e37fdf6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
65 addition
and
2 deletion
+65
-2
modules/prediction/evaluator/vehicle/BUILD
modules/prediction/evaluator/vehicle/BUILD
+2
-0
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.cc
...es/prediction/evaluator/vehicle/junction_mlp_evaluator.cc
+52
-0
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.h
...les/prediction/evaluator/vehicle/junction_mlp_evaluator.h
+11
-2
未找到文件。
modules/prediction/evaluator/vehicle/BUILD
浏览文件 @
a321f498
...
...
@@ -109,8 +109,10 @@ cc_library(
"junction_mlp_evaluator.h"
,
],
deps
=
[
"//modules/common/math:geometry"
,
"//modules/prediction/common:feature_output"
,
"//modules/prediction/common:prediction_util"
,
"//modules/prediction/container:container_manager"
,
"//modules/prediction/evaluator"
,
"//modules/prediction/proto:fnn_vehicle_model_proto"
,
],
...
...
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.cc
浏览文件 @
a321f498
...
...
@@ -19,15 +19,20 @@
#include <algorithm>
#include <unordered_map>
#include "modules/common/math/vec2d.h"
#include "modules/common/adapters/proto/adapter_config.pb.h"
#include "modules/prediction/common/feature_output.h"
#include "modules/prediction/common/prediction_gflags.h"
#include "modules/prediction/common/prediction_map.h"
#include "modules/prediction/common/prediction_system_gflags.h"
#include "modules/prediction/common/prediction_util.h"
#include "modules/prediction/container/container_manager.h"
#include "modules/prediction/container/pose/pose_container.h"
namespace
apollo
{
namespace
prediction
{
using
apollo
::
common
::
adapter
::
AdapterConfig
;
using
apollo
::
prediction
::
math_util
::
EvaluateCubicPolynomial
;
using
apollo
::
prediction
::
math_util
::
ComputePolynomial
;
...
...
@@ -151,6 +156,15 @@ void JunctionMLPEvaluator::ExtractFeatureValues(
return
;
}
std
::
vector
<
double
>
ego_vehicle_feature_values
;
SetEgoVehicleFeatureValues
(
obstacle_ptr
,
&
ego_vehicle_feature_values
);
if
(
ego_vehicle_feature_values
.
size
()
!=
EGO_VEHICLE_FEATURE_SIZE
)
{
AERROR
<<
"Obstacle ["
<<
id
<<
"] has fewer than "
<<
"expected ego vehicle feature_values"
<<
ego_vehicle_feature_values
.
size
()
<<
"."
;
return
;
}
std
::
vector
<
double
>
junction_feature_values
;
SetJunctionFeatureValues
(
obstacle_ptr
,
&
junction_feature_values
);
if
(
junction_feature_values
.
size
()
!=
JUNCTION_FEATURE_SIZE
)
{
...
...
@@ -163,6 +177,9 @@ void JunctionMLPEvaluator::ExtractFeatureValues(
feature_values
->
insert
(
feature_values
->
end
(),
obstacle_feature_values
.
begin
(),
obstacle_feature_values
.
end
());
feature_values
->
insert
(
feature_values
->
end
(),
ego_vehicle_feature_values
.
begin
(),
ego_vehicle_feature_values
.
end
());
feature_values
->
insert
(
feature_values
->
end
(),
junction_feature_values
.
begin
(),
junction_feature_values
.
end
());
...
...
@@ -182,6 +199,41 @@ void JunctionMLPEvaluator::SetObstacleFeatureValues(
feature_values
->
push_back
(
feature
.
junction_feature
().
junction_range
());
}
void
JunctionMLPEvaluator
::
SetEgoVehicleFeatureValues
(
Obstacle
*
obstacle_ptr
,
std
::
vector
<
double
>*
const
feature_values
)
{
feature_values
->
clear
();
*
feature_values
=
std
::
vector
<
double
>
(
4
,
0.0
);
auto
ego_pose_container_ptr
=
ContainerManager
::
Instance
()
->
GetContainer
<
PoseContainer
>
(
AdapterConfig
::
LOCALIZATION
);
if
(
ego_pose_container_ptr
==
nullptr
)
{
(
*
feature_values
)[
0
]
=
100.0
;
(
*
feature_values
)[
1
]
=
100.0
;
return
;
}
const
auto
ego_pose_obstacle_ptr
=
ego_pose_container_ptr
->
ToPerceptionObstacle
();
const
auto
ego_position
=
ego_pose_obstacle_ptr
->
position
();
const
auto
ego_velocity
=
ego_pose_obstacle_ptr
->
velocity
();
CHECK_GT
(
obstacle_ptr
->
history_size
(),
0
);
const
Feature
&
obstacle_feature
=
obstacle_ptr
->
latest_feature
();
apollo
::
common
::
math
::
Vec2d
ego_relative_position
(
ego_position
.
x
()
-
obstacle_feature
.
position
().
x
(),
ego_position
.
y
()
-
obstacle_feature
.
position
().
y
());
apollo
::
common
::
math
::
Vec2d
ego_relative_velocity
(
ego_velocity
.
x
(),
ego_velocity
.
y
());
ego_relative_velocity
.
rotate
(
-
obstacle_feature
.
velocity_heading
());
(
*
feature_values
)[
0
]
=
ego_relative_position
.
x
();
(
*
feature_values
)[
1
]
=
ego_relative_position
.
y
();
(
*
feature_values
)[
2
]
=
ego_relative_velocity
.
x
();
(
*
feature_values
)[
3
]
=
ego_relative_velocity
.
y
();
ADEBUG
<<
"ego relative pos = {"
<<
ego_relative_position
.
x
()
<<
", "
<<
ego_relative_position
.
y
()
<<
"} "
<<
"ego_relative_velocity = {"
<<
ego_relative_velocity
.
x
()
<<
", "
<<
ego_relative_velocity
.
y
()
<<
"}"
;
}
void
JunctionMLPEvaluator
::
SetJunctionFeatureValues
(
Obstacle
*
obstacle_ptr
,
std
::
vector
<
double
>*
feature_values
)
{
feature_values
->
clear
();
...
...
modules/prediction/evaluator/vehicle/junction_mlp_evaluator.h
浏览文件 @
a321f498
...
...
@@ -69,7 +69,15 @@ class JunctionMLPEvaluator : public Evaluator {
* Feature container in a vector for receiving the feature values
*/
void
SetObstacleFeatureValues
(
Obstacle
*
obstacle_ptr
,
std
::
vector
<
double
>*
feature_values
);
std
::
vector
<
double
>*
const
feature_values
);
/**
* @brief Set ego vehicle feature vector
* @param Obstacle pointer
* Feature container in a vector for receiving the feature values
*/
void
SetEgoVehicleFeatureValues
(
Obstacle
*
obstacle_ptr
,
std
::
vector
<
double
>*
const
feature_values
);
/**
* @brief Set junction feature vector
...
...
@@ -77,7 +85,7 @@ class JunctionMLPEvaluator : public Evaluator {
* Feature container in a vector for receiving the feature values
*/
void
SetJunctionFeatureValues
(
Obstacle
*
obstacle_ptr
,
std
::
vector
<
double
>*
feature_values
);
std
::
vector
<
double
>*
const
feature_values
);
/**
* @brief Load mode file
...
...
@@ -93,6 +101,7 @@ class JunctionMLPEvaluator : public Evaluator {
private:
static
const
size_t
OBSTACLE_FEATURE_SIZE
=
3
;
static
const
size_t
EGO_VEHICLE_FEATURE_SIZE
=
4
;
static
const
size_t
JUNCTION_FEATURE_SIZE
=
72
;
std
::
unique_ptr
<
FnnVehicleModel
>
model_ptr_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录