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
e08fcfbb
Commit
e08fcfbb
authored
Mar 23, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交发送给发布节点逻辑
parent
70f95b87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
EventsRos.cpp
EventsRos.cpp
+11
-1
EventsRos.h
EventsRos.h
+3
-0
No files found.
EventsRos.cpp
View file @
e08fcfbb
...
...
@@ -133,6 +133,10 @@ int EventsRos::loadConfig(ros::NodeHandle& nh)
#if defined(_ROS_XISHAN_) || defined(_ROS_HEFEI_R_) || defined(_ROS_HEFEI_L_)
m_pubFlow
=
nh
.
advertise
<
jfx_common_msgs
::
TrafficFlow
>
(
"/FlowData"
,
100
);
#endif
#ifdef _SEND_MSG_TO_PUBLIC_ROS_
m_pub
=
nh
.
advertise
<
jfx_common_msgs
::
OutFusionEventObjs
>
(
"/FusionEventData"
,
100
);
#endif
char
url
[
1024
]
=
{
0
};
// 自有平台
snprintf
(
url
,
1023
,
"http://%s:%d/traffic/uploadParticipants"
,
m_ip
.
c_str
(),
m_port
);
...
...
@@ -262,6 +266,10 @@ int EventsRos::Start()
#if defined(_ROS_XISHAN_) || defined(_ROS_HEFEI_R_) || defined(_ROS_HEFEI_L_)
SendRosEvents
(
outs
);
#else
#if defined(_SEND_MSG_TO_PUBLIC_ROS_) && defined(_ROS_QICHECHENG_NEW_)
SendRosEvents
(
outs
);
#endif
//SendEventsCb(outs);
std
::
thread
tmp
(
&
EventsRos
::
SendEventsCb
,
this
,
outs
);
tmp
.
detach
();
...
...
@@ -287,7 +295,7 @@ int EventsRos::Start()
}
void
EventsRos
::
SendRosEvents
(
TrkObjsPtr
&
outs
)
{
#if defined(_ROS_XISHAN_) || defined(_ROS_HEFEI_R_) || defined(_ROS_HEFEI_L_)
#if defined(_ROS_XISHAN_) || defined(_ROS_HEFEI_R_) || defined(_ROS_HEFEI_L_)
|| defined(_SEND_MSG_TO_PUBLIC_ROS_)
jfx_common_msgs
::
OutFusionEventObjs
eventMsgs
=
{};
for
(
auto
&
iter
:
outs
->
objs
)
{
...
...
@@ -432,6 +440,7 @@ void EventsRos::SendRosEvents(TrkObjsPtr& outs)
void
EventsRos
::
SendEventsCb
(
TrkObjsPtr
outs
)
{
#ifndef _SEND_MSG_TO_PUBLIC_ROS_
for
(
auto
&
iter
:
outs
->
objs
)
{
SDK_IDX_LOG
(
1
,
SDK_INFO
,
"%s,%d,%llu,%lld,%s,%.10f,%.10f,%f,%f,%d,%d,%d,%d,%f,%d,%d,%d,%d,%d,%d"
,
GetTimeStr
(
iter
.
time
).
c_str
(),
...
...
@@ -440,6 +449,7 @@ void EventsRos::SendEventsCb(TrkObjsPtr outs)
iter
.
eventList
.
size
()
>
1
?
iter
.
eventList
[
1
].
eventId
:
0
,
iter
.
eventList
.
size
()
>
1
?
iter
.
eventList
[
1
].
eventType
:
0
,
iter
.
eventList
.
size
()
>
1
?
iter
.
eventList
[
1
].
eventStatus
:
0
);
}
#endif
if
(
m_port
==
0
)
return
;
std
::
string
response
;
...
...
EventsRos.h
View file @
e08fcfbb
...
...
@@ -26,6 +26,9 @@
#include "jfxrosperceiver/det_tracking_array.h"
#endif
#ifdef _SEND_MSG_TO_PUBLIC_ROS_ //发送消息到公共的发布节点
#include "jfx_common_msgs/OutFusionEventObjs.h"
#endif
/**
* @brief ros系统和event类衔接的类,ros的发送和接受都放到这里
...
...
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