Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
e87f0985
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,发现更多精彩内容 >>
提交
e87f0985
编写于
7月 17, 2017
作者:
K
kechxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add InitKFLaneTracker
上级
b1de908c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
1 deletion
+47
-1
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+44
-1
modules/prediction/container/obstacles/obstacle.h
modules/prediction/container/obstacles/obstacle.h
+3
-0
未找到文件。
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
e87f0985
...
...
@@ -46,6 +46,7 @@ Obstacle::Obstacle() :
type_
(
PerceptionObstacle
::
UNKNOWN_MOVABLE
),
feature_history_
(
0
),
kf_motion_tracker_
(),
kf_motion_tracker_enabled_
(
false
),
kf_lane_trackers_
(
0
)
{
}
...
...
@@ -55,6 +56,7 @@ Obstacle::~Obstacle() {
type_
=
PerceptionObstacle
::
UNKNOWN_UNMOVABLE
;
feature_history_
.
clear
();
kf_lane_trackers_
.
clear
();
kf_motion_tracker_enabled_
=
false
;
// TODO(author) current_lanes_.clear();
}
...
...
@@ -131,7 +133,9 @@ void Obstacle::Insert(const PerceptionObstacle& perception_obstacle,
SetVelocity
(
perception_obstacle
,
&
feature
);
SetAcceleration
(
&
feature
);
SetTheta
(
perception_obstacle
,
&
feature
);
InitKFMotionTracker
(
&
feature
);
if
(
!
kf_motion_tracker_enabled_
)
{
InitKFMotionTracker
(
&
feature
);
}
UpdateKFMotionTracker
(
&
feature
);
}
...
...
@@ -368,6 +372,8 @@ void Obstacle::InitKFMotionTracker(Feature* feature) {
x
(
5
,
0
)
=
feature
->
acceleration
().
y
();
kf_motion_tracker_
.
SetStateEstimate
(
x
,
P
);
kf_motion_tracker_enabled_
=
true
;
}
void
Obstacle
::
UpdateKFMotionTracker
(
Feature
*
feature
)
{
...
...
@@ -422,5 +428,42 @@ void Obstacle::UpdateMotionBelief(Feature* feature) {
<<
"]."
;
}
void
Obstacle
::
InitKFLaneTracker
(
const
std
::
string
&
lane_id
,
const
double
beta
)
{
KalmanFilter
<
double
,
4
,
2
,
0
>
kf
;
// transition matrix: update delta_t at each processing step
Eigen
::
Matrix
<
double
,
4
,
4
>
F
;
F
.
setIdentity
();
F
(
1
,
1
)
=
beta
;
kf
.
SetTransitionMatrix
(
F
);
// observation matrix
Eigen
::
Matrix
<
double
,
2
,
4
>
H
;
H
(
0
,
0
)
=
1.0
;
H
(
1
,
1
)
=
1.0
;
kf
.
SetObservationMatrix
(
H
);
// Set covariance of transition noise matrix Q
Eigen
::
Matrix
<
double
,
4
,
4
>
Q
;
Q
.
setIdentity
();
Q
*=
FLAGS_q_var
;
kf
.
SetTransitionNoise
(
Q
);
// Set observation noise matrix R
Eigen
::
Matrix
<
double
,
2
,
2
>
R
;
R
.
setIdentity
();
R
*=
FLAGS_r_var
;
kf
.
SetObservationNoise
(
R
);
// Set current state covariance matrix P
Eigen
::
Matrix
<
double
,
4
,
4
>
P
;
P
.
setIdentity
();
P
*=
FLAGS_p_var
;
kf
.
SetStateCovariance
(
P
);
kf_lane_trackers_
.
emplace
(
lane_id
,
std
::
move
(
kf
));
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/container/obstacles/obstacle.h
浏览文件 @
e87f0985
...
...
@@ -103,11 +103,14 @@ class Obstacle {
void
UpdateMotionBelief
(
Feature
*
feature
);
void
InitKFLaneTracker
(
const
std
::
string
&
lane_id
,
const
double
beta
);
private:
int
id_
;
apollo
::
perception
::
PerceptionObstacle
::
Type
type_
;
std
::
deque
<
Feature
>
feature_history_
;
apollo
::
common
::
math
::
KalmanFilter
<
double
,
6
,
2
,
0
>
kf_motion_tracker_
;
bool
kf_motion_tracker_enabled_
;
std
::
unordered_map
<
std
::
string
,
apollo
::
common
::
math
::
KalmanFilter
<
double
,
4
,
2
,
0
>>
kf_lane_trackers_
;
// TODO(author) std::vector<const adu::hdmap::LaneInfo*> _current_lanes;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录