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
52b186b8
Commit
52b186b8
authored
Dec 20, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交修正rot_y
parent
16c37c9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
TrackingRos.cpp
TrackingRos.cpp
+19
-5
TrackingRos.h
TrackingRos.h
+2
-0
No files found.
TrackingRos.cpp
View file @
52b186b8
...
...
@@ -7,16 +7,27 @@
#include "matrix.h"
#include <eigen3/Eigen/Dense>
void
to360
(
float
&
rot_y
)
#define _PI_ 3.1415926
void
to360
(
float
&
rot_y
,
float
lidar_x_angle
)
{
if
(
rot_y
>
0
)
while
(
rot_y
>=
_PI_
)
{
rot_y
-=
_PI_
*
2
;
}
while
(
rot_y
<
-
_PI_
)
{
rot_y
=
2
*
3.1415926
-
rot_y
;
rot_y
+=
_PI_
*
2
;
}
else
float
tmp_angle
=
0.0
f
;
float
car_angle
=
rot_y
/
_PI_
*
180.0
f
;
tmp_angle
=
lidar_x_angle
-
car_angle
;
tmp_angle
+=
360
;
while
(
tmp_angle
>
360
)
{
rot_y
=
-
rot_y
;
tmp_angle
-=
360
;
}
rot_y
=
tmp_angle
;
}
void
CalculateGuassPos
(
float
x
,
float
y
,
float
z
,
std
::
vector
<
std
::
vector
<
float
>>&
trans
,
float
&
gx
,
float
&
gy
)
...
...
@@ -59,6 +70,8 @@ void TrackingRos::Init(ros::NodeHandle& nh)
SDK_LOG
(
SDK_INFO
,
"kf_gpu = %d"
,
gpu
);
m_tracker
.
SetGPU
(
gpu
);
nh
.
param
<
float
>
(
"lidar_x_angle"
,
m_lidar_x_angle
,
354.102412638
);
YAML
::
Node
config
=
YAML
::
LoadFile
(
file
.
c_str
());
...
...
@@ -258,6 +271,7 @@ void TrackingRos::ThreadTrackingProcess()
}
}
//修正rot_y值
to360
(
obj
.
rot_y
,
m_lidar_x_angle
);
jsk_recognition_msgs
::
BoundingBox
box
=
{};
box
.
label
=
obj
.
obj_id
;
...
...
TrackingRos.h
View file @
52b186b8
...
...
@@ -44,4 +44,6 @@ public:
ros
::
Publisher
m_pubBoundingBoxes
;
//发送3D框信息
std
::
vector
<
std
::
vector
<
float
>>
m_trans
;
float
m_lidar_x_angle
=
0
.
0
f
;
//修改rot_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