Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
jfx_kalman_filter_src
Commits
604a9794
Commit
604a9794
authored
Apr 01, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改计算方向的逻辑
parent
b585795c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
Track3D.cpp
BaseTracker/Track3D.cpp
+10
-3
Track3D.h
BaseTracker/Track3D.h
+2
-0
No files found.
BaseTracker/Track3D.cpp
View file @
604a9794
...
...
@@ -340,6 +340,7 @@ void Track3D::UpdateDataCheck(const std::vector<float>& data, std::vector<float>
if
(
dataSource
==
1
&&
m_points
.
size
()
>=
5
&&
(
abs
(
m_points
[
4
].
x
-
m_points
[
0
].
x
)
>
DIST_THRED
||
abs
(
m_points
[
4
].
y
-
m_points
[
0
].
y
)
>
DIST_THRED
))
{
double
center_rot_y
=
correct_angle
(
m_points
);
m_center_rot_y
=
center_rot_y
;
//SDK_LOG(SDK_INFO, "center_rot_y = %f,rot_y = %f", center_rot_y,rot_y);
double
rotate
=
abs
(
center_rot_y
-
rot_y
);
while
(
rotate
>
_PI_
)
...
...
@@ -351,10 +352,16 @@ void Track3D::UpdateDataCheck(const std::vector<float>& data, std::vector<float>
rot_y
+=
_PI_
;
}
}
else
if
(
dataSource
>
1
&&
m_points
.
size
()
>=
5
&&
(
abs
(
m_points
[
4
].
x
-
m_points
[
0
].
x
)
>
DIST_THRED
||
abs
(
m_points
[
4
].
y
-
m_points
[
0
].
y
)
>
DIST_THRED
)
)
else
if
(
dataSource
>
1
&&
m_points
.
size
()
>=
5
)
{
double
center_rot_y
=
correct_angle
(
m_points
);
rot_y
=
center_rot_y
;
if
((
abs
(
m_points
[
4
].
x
-
m_points
[
0
].
x
)
>
DIST_THRED
||
abs
(
m_points
[
4
].
y
-
m_points
[
0
].
y
)
>
DIST_THRED
))
//5个点首尾有距离差才计算方向
{
double
center_rot_y
=
correct_angle
(
m_points
);
m_center_rot_y
=
center_rot_y
;
rot_y
=
center_rot_y
;
}
else
//没有距离差就使用最后一次的方向
rot_y
=
center_rot_y
;
}
double
x_angle
=
kf_
->
x_
[
3
];
double
deta
=
rot_y
-
x_angle
;
...
...
BaseTracker/Track3D.h
View file @
604a9794
...
...
@@ -53,6 +53,8 @@ public:
std
::
vector
<
point2d
>
m_points
;
//保存最近的5个移动的点位
uint64_t
m_lastLastTimestamp
=
0
;
//记录上上一次的时间戳
double
m_center_rot_y
=
0
;
//通过计算轨迹上的五个点算出来的方向
};
double
correct_angle
(
std
::
vector
<
point2d
>&
points
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment