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
e0aa98cb
Commit
e0aa98cb
authored
Mar 17, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交多线程运行http连接。
parent
ca8a2f7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
EventsRos.cpp
EventsRos.cpp
+17
-2
EventsRos.h
EventsRos.h
+1
-1
No files found.
EventsRos.cpp
View file @
e0aa98cb
...
...
@@ -241,7 +241,22 @@ int EventsRos::Start()
#if defined(_ROS_XISHAN_) || defined(_ROS_HEFEI_R_) || defined(_ROS_HEFEI_L_)
SendRosEvents
(
outs
);
#else
SendEventsCb
(
outs
);
//SendEventsCb(outs);
std
::
thread
tmp
(
&
EventsRos
::
SendEventsCb
,
this
,
outs
);
tmp
.
detach
();
static
int
countCb
=
0
;
countCb
++
;
static
uint64_t
countBeginCb
=
0
;
if
(
countBeginCb
==
0
)
countBeginCb
=
GetCurTime
();
if
(
GetCurTime
()
-
countBeginCb
>
3000
*
1000
)
{
SDK_LOG
(
SDK_INFO
,
"SendEventsCb count = %d, average rate = %f"
,
countCb
,
(
float
)
countCb
/
3
);
//SDK_LOG(SDK_INFO, "recv camera msg count = %d, average rate = %f", countC, (float)countC / 3);
countBeginCb
=
GetCurTime
();
countCb
=
0
;
}
#endif
});
...
...
@@ -394,7 +409,7 @@ void EventsRos::SendRosEvents(TrkObjsPtr& outs)
}
void
EventsRos
::
SendEventsCb
(
TrkObjsPtr
&
outs
)
void
EventsRos
::
SendEventsCb
(
TrkObjsPtr
outs
)
{
for
(
auto
&
iter
:
outs
->
objs
)
{
...
...
EventsRos.h
View file @
e0aa98cb
...
...
@@ -46,7 +46,7 @@ public:
int
Start
();
void
SendEventsCb
(
TrkObjsPtr
&
outs
);
//发送event事件的函数
void
SendEventsCb
(
TrkObjsPtr
outs
);
//发送event事件的函数
void
SendRosEvents
(
TrkObjsPtr
&
outs
);
//发送event事件的函数
JfxEvents
m_jfx_events
;
//event处理对象
...
...
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