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
abf8c4ff
Commit
abf8c4ff
authored
Feb 18, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交数据结构变动
parent
1064a249
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
TimeQueueStruct.h
TimeQueueStruct.h
+2
-11
TrackingRosEx.cpp
TrackingRosEx.cpp
+14
-9
No files found.
TimeQueueStruct.h
View file @
abf8c4ff
...
...
@@ -14,19 +14,10 @@ enum class QueueDataEnum //数据类型的枚举
struct
TimeQueueData
{
TimeQueueData
()
{
}
~
TimeQueueData
()
{
}
uint64_t
timestamp
=
0
;
//排序的时间
QueueDataEnum
dataType
=
QueueDataEnum
::
QD_NONE
;
//数据类型
union
UserData
{
jfx_common_msgs
::
det_tracking_array
detArray
;
jfx_common_msgs
::
InferReses
infRes
;
};
UserData
data
;
std
::
shared_ptr
<
jfx_common_msgs
::
det_tracking_array
>
detArray
=
nullptr
;
std
::
shared_ptr
<
jfx_common_msgs
::
InferReses
>
infReses
=
nullptr
;
};
TrackingRosEx.cpp
View file @
abf8c4ff
...
...
@@ -400,15 +400,15 @@ void TrackingRos::Init(ros::NodeHandle& nh)
}
void
TrackingRos
::
TimeQueueProcess
(
std
::
vector
<
TimeQueueDataPtr
>&
outs
)
{
jfx_common_msgs
::
det_tracking_array
*
cloudPtr
=
nullptr
;
jfx_common_msgs
::
InferReses
*
msg
=
nullptr
;
objTrackListPtr
cloudPtr
=
nullptr
;
std
::
shared_ptr
<
jfx_common_msgs
::
InferReses
>
msg
=
nullptr
;
uint64_t
timestamp
=
0
;
for
(
auto
iter
:
outs
)
{
if
(
iter
->
dataType
==
QueueDataEnum
::
QD_DET_TRACKING_ARRAY
)
cloudPtr
=
&
(
iter
->
data
.
detArray
)
;
cloudPtr
=
iter
->
detArray
;
if
(
iter
->
dataType
==
QueueDataEnum
::
QD_INFERRESES
)
msg
=
&
(
iter
->
data
.
infRes
)
;
msg
=
iter
->
infReses
;
}
if
(
cloudPtr
)
{
...
...
@@ -647,13 +647,15 @@ void TrackingRos::TimeQueueProcess(std::vector< TimeQueueDataPtr>& outs)
void
TrackingRos
::
TrackingCallBackFunc
(
const
jfx_common_msgs
::
det_tracking_arrayConstPtr
&
msg
)
//接受ros发过来的消息
{
objTrackListPtr
objsPtr
=
std
::
make_shared
<
jfx_common_msgs
::
det_tracking_array
>
();
objsPtr
->
array
=
msg
->
array
;
objsPtr
->
cloud
=
msg
->
cloud
;
TimeQueueDataPtr
tqdPtr
=
std
::
make_shared
<
TimeQueueData
>
();
//objTrackListPtr objsPtr = std::make_shared<jfx_common_msgs::det_tracking_array>();
tqdPtr
->
dataType
=
QueueDataEnum
::
QD_DET_TRACKING_ARRAY
;
tqdPtr
->
data
.
detArray
.
array
=
msg
->
array
;
tqdPtr
->
data
.
detArray
.
cloud
=
msg
->
cloud
;
tqdPtr
->
detArray
=
objsPtr
;
tqdPtr
->
timestamp
=
(
unsigned
long
long
)
msg
->
cloud
.
header
.
stamp
.
sec
*
1000000
+
(
unsigned
long
long
)
msg
->
cloud
.
header
.
stamp
.
nsec
*
1e-3
;
tqdPtr
->
timestamp
=
(
unsigned
long
long
)
msg
->
cloud
.
header
.
stamp
.
sec
*
1000000
+
(
unsigned
long
long
)
msg
->
cloud
.
header
.
stamp
.
nsec
*
1e-3
+
100
;
//SDK_LOG(SDK_INFO, "TrackingCallBackFunc msg->header.stamp.sec = %d,msg->header.stamp.nsec = %d time = %llu", msg->cloud.header.stamp.sec, msg->cloud.header.stamp.nsec, timestamp);
m_timeQueue
.
PushQueueData
(
tqdPtr
);
...
...
@@ -696,10 +698,13 @@ void TrackingRos::TrackingCameraCallBackFunc(const jfx_common_msgs::InferResesCo
countBeginC
=
GetCurTime
();
countC
=
0
;
}
std
::
shared_ptr
<
jfx_common_msgs
::
InferReses
>
msgPtr
=
std
::
make_shared
<
jfx_common_msgs
::
InferReses
>
();
*
msgPtr
=
*
msg
;
TimeQueueDataPtr
tqdPtr
=
std
::
make_shared
<
TimeQueueData
>
();
tqdPtr
->
dataType
=
QueueDataEnum
::
QD_INFERRESES
;
tqdPtr
->
timestamp
=
(
unsigned
long
long
)
msg
->
header
.
stamp
.
sec
*
1000
+
(
unsigned
long
long
)
msg
->
header
.
stamp
.
nsec
*
1e-6
;
tqdPtr
->
data
.
infRes
=
*
msg
;
tqdPtr
->
infReses
=
msgPtr
;
m_timeQueue
.
PushQueueData
(
tqdPtr
);
//SDK_LOG(SDK_INFO, "msg msg->header.stamp.sec = %d,msg->header.stamp.nsec = %d time = %llu", msg->header.stamp.sec, msg->header.stamp.nsec, timestamp);
...
...
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