Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
E
event_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
event_src
Commits
d2a856e5
Commit
d2a856e5
authored
Mar 24, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交时间点逻辑
parent
e08fcfbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
EventsRos.cpp
EventsRos.cpp
+13
-0
EventInfo.h
msg/EventInfo.h
+1
-0
No files found.
EventsRos.cpp
View file @
d2a856e5
...
...
@@ -245,6 +245,10 @@ void EventsRos::TrackCallBackFunc(const jfxrosperceiver::det_tracking_arrayConst
obj
.
speed
=
sqrt
(
pow
(
item
.
v_x
,
2
)
+
pow
(
item
.
v_y
,
2
)
+
pow
(
item
.
v_z
,
2
));
//计算出车的速度
objsPtr
->
objs
.
emplace_back
(
obj
);
}
for
(
int
i
=
0
;
i
<
msg
->
pt
.
size
();
i
++
)
{
objsPtr
->
pt
.
push_back
(
msg
->
pt
[
i
]);
}
m_jfx_events
.
PushEventInfos
(
objsPtr
);
}
#endif
...
...
@@ -395,6 +399,15 @@ void EventsRos::SendRosEvents(TrkObjsPtr& outs)
traffic
.
lane_angle
=
angle
>
360
?
angle
-
360
:
angle
;
eventMsgs
.
traffic
.
emplace_back
(
traffic
);
}
if
(
outs
.
pt
.
size
()
==
4
)
{
eventMsgs
.
pt
.
push_back
(
outs
.
pt
[
0
]);
eventMsgs
.
pt
.
push_back
(
outs
.
pt
[
1
]);
eventMsgs
.
pt
.
push_back
(
outs
.
pt
[
3
]);
auto
time_p
=
ros
::
Time
::
now
();
std
::
uint64_t
tt
=
(
std
::
uint64_t
)
time_p
.
sec
*
1000
+
time_p
.
nsec
*
1e-6
;
eventMsgs
.
pt
.
push_back
(
tt
);
//发送发送的时间点
}
m_pub
.
publish
(
eventMsgs
);
//删除过时的记录
...
...
msg/EventInfo.h
View file @
d2a856e5
...
...
@@ -143,6 +143,7 @@ typedef struct _TrkObjs {
std
::
vector
<
TrkObj
>
objs
;
std
::
vector
<
trafficJamInfo
>
traffic
;
std
::
vector
<
flowEvent
>
flowInfo
;
std
::
vector
<
uint64_t
>
pt
;
}
TrkObjs
;
using
TrkObjsPtr
=
std
::
shared_ptr
<
TrkObjs
>
;
...
...
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