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
5e775a87
Commit
5e775a87
authored
Dec 22, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交修正角度代码
parent
7672746b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
1 deletion
+78
-1
BaseTrack.h
BaseTracker/BaseTrack.h
+3
-0
Track3D.cpp
BaseTracker/Track3D.cpp
+75
-0
TrackingRos.cpp
TrackingRos.cpp
+0
-1
No files found.
BaseTracker/BaseTrack.h
View file @
5e775a87
...
...
@@ -5,6 +5,9 @@
#include <vector>
#include <memory>
#define _PI_ 3.1415926
class
BaseTrack
{
public
:
...
...
BaseTracker/Track3D.cpp
View file @
5e775a87
...
...
@@ -217,5 +217,79 @@ int Track3D::GetKFDataOrder(std::vector<int>& order)
}
void
Track3D
::
UpdateDataCheck
(
const
std
::
vector
<
float
>&
data
,
std
::
vector
<
float
>&
out
)
{
if
(
kf_
==
nullptr
)
return
;
float
x_angle
=
kf_
->
x_
[
3
];
float
angle
=
data
[
3
];
float
deta
=
angle
-
x_angle
;
while
(
deta
>=
_PI_
)
{
deta
-=
_PI_
*
2
;
}
while
(
deta
<
-
_PI_
)
{
deta
+=
_PI_
*
2
;
}
angle
=
x_angle
+
deta
;
out
=
data
;
out
[
3
]
=
angle
;
/*
t = time.time()
points = self.last_x_y_list[:]
points = np.array(points)
x_list = points[:, 0]
y_list = points[:, 1]
if len(points) >= NUM_FRAME and abs(x_list[-1] - x_list[0]) > DIST_THRED or abs(y_list[-1] - y_list[0]) > DIST_THRED:
center_rot_y = center_rot_y_f(points)
rot_y = bbox3D[3]
if rot_y > np.pi: rot_y -= int((rot_y + np.pi)/(2*np.pi)) * np.pi * 2
if rot_y < -np.pi: rot_y += int((np.pi - rot_y)/(2*np.pi)) * np.pi * 2
if abs(center_rot_y - rot_y) > np.pi / 2.0 and abs(
center_rot_y - rot_y) < np.pi * 3 / 2.0: # if the angle of two theta is not acute angle
rot_y += np.pi
if rot_y > np.pi: rot_y -= np.pi * 2 # make the theta still in the range
if rot_y < -np.pi: rot_y += np.pi * 2
bbox3D[3] = rot_y
t3_0 = time.time() - t
t = time.time()
self.time_since_update = 0
self.history = []
self.hits += 1
if self.still_first:
self.first_continuing_hit += 1 # number of continuing hit in the fist time
######################### orientation correction
if self.kf.x[3] >= np.pi: self.kf.x[3] -= np.pi * 2 # make the theta still in the range
if self.kf.x[3] < -np.pi: self.kf.x[3] += np.pi * 2
new_theta = bbox3D[3]
if new_theta >= np.pi: new_theta -= np.pi * 2 # make the theta still in the range
if new_theta < -np.pi: new_theta += np.pi * 2
bbox3D[3] = new_theta
predicted_theta = self.kf.x[3]
if abs(new_theta - predicted_theta) > np.pi / 2.0 and abs(
new_theta - predicted_theta) < np.pi * 3 / 2.0: # if the angle of two theta is not acute angle
self.kf.x[3] += np.pi
if self.kf.x[3] > np.pi: self.kf.x[3] -= np.pi * 2 # make the theta still in the range
if self.kf.x[3] < -np.pi: self.kf.x[3] += np.pi * 2
# now the angle is acute: < 90 or > 270, convert the case of > 270 to < 90
if abs(new_theta - self.kf.x[3]) >= np.pi * 3 / 2.0:
if new_theta > 0:
self.kf.x[3] += np.pi * 2
else:
self.kf.x[3] -= np.pi * 2
t3_1 = time.time() - t
*/
}
\ No newline at end of file
TrackingRos.cpp
View file @
5e775a87
...
...
@@ -7,7 +7,6 @@
#include "matrix.h"
#include <eigen3/Eigen/Dense>
#define _PI_ 3.1415926
float
to360
(
float
rot_y
,
float
lidar_x_angle
)
{
...
...
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