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
e66dba40
Commit
e66dba40
authored
Dec 20, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
2df9306e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
TrackingRos.cpp
TrackingRos.cpp
+13
-9
No files found.
TrackingRos.cpp
View file @
e66dba40
...
...
@@ -9,25 +9,27 @@
#define _PI_ 3.1415926
void
to360
(
float
&
rot_y
,
float
lidar_x_angle
)
float
to360
(
float
rot_y
,
float
lidar_x_angle
)
{
while
(
rot_y
>=
_PI_
)
float
angle
=
rot_y
;
while
(
angle
>=
_PI_
)
{
rot_y
-=
_PI_
*
2
;
angle
-=
_PI_
*
2
;
}
while
(
rot_y
<
-
_PI_
)
while
(
angle
<
-
_PI_
)
{
rot_y
+=
_PI_
*
2
;
angle
+=
_PI_
*
2
;
}
float
tmp_angle
=
0.0
f
;
float
car_angle
=
rot_y
/
_PI_
*
180.0
f
;
float
car_angle
=
angle
/
_PI_
*
180.0
f
;
tmp_angle
=
lidar_x_angle
-
car_angle
;
tmp_angle
+=
360
;
while
(
tmp_angle
>
360
)
{
tmp_angle
-=
360
;
}
rot_y
=
tmp_angle
;
angle
=
tmp_angle
;
return
angle
;
}
void
CalculateGuassPos
(
float
x
,
float
y
,
float
z
,
std
::
vector
<
std
::
vector
<
float
>>&
trans
,
float
&
gx
,
float
&
gy
)
...
...
@@ -272,7 +274,9 @@ void TrackingRos::ThreadTrackingProcess()
}
}
//修正rot_y值,变为角度
to360
(
obj
.
rot_y
,
m_lidar_x_angle
);
float
rot_y_angle
=
obj
.
rot_y
;
obj
.
rot_y
=
to360
(
obj
.
rot_y
,
m_lidar_x_angle
);
rot_y_angle
=
obj
.
rot_y
/
180
*
3.14159265
;
jsk_recognition_msgs
::
BoundingBox
box
=
{};
box
.
label
=
obj
.
obj_id
;
...
...
@@ -284,7 +288,7 @@ void TrackingRos::ThreadTrackingProcess()
box
.
pose
.
position
.
x
=
obj
.
x
;
box
.
pose
.
position
.
y
=
obj
.
y
;
box
.
pose
.
position
.
z
=
obj
.
z
;
Eigen
::
AngleAxisd
V3
(
obj
.
rot_y
/
180
*
3.14159265
,
Eigen
::
Vector3d
(
0
,
0
,
1
));
Eigen
::
AngleAxisd
V3
(
rot_y_angle
,
Eigen
::
Vector3d
(
0
,
0
,
1
));
Eigen
::
Quaterniond
R_quat
(
V3
);
box
.
pose
.
orientation
.
x
=
R_quat
.
x
();
box
.
pose
.
orientation
.
y
=
R_quat
.
y
();
...
...
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