Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_rvfusion_cx
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
ChenKun
jfx_rvfusion_cx
Commits
2abbd02e
Commit
2abbd02e
authored
Jul 07, 2022
by
haoshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
d5379273
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
40 deletions
+25
-40
fusionUdpObj.h
incl/fusionUdpObj.h
+4
-15
fusionDistribTask.cpp
src/fusionDistribTask.cpp
+21
-25
No files found.
incl/fusionUdpObj.h
View file @
2abbd02e
...
...
@@ -3,15 +3,16 @@
#include <cstdint>
#include <string>
#include <vector>
#pragma pack(1)
typedef
struct
_UdpRadarObj
{
char
device
[
20
];
int32_t
id
;
uint64_t
time
;
std
::
string
strId
;
std
::
string
type
;
char
type
[
20
];
int32_t
vehType
;
double
vehL
;
double
vehW
;
...
...
@@ -28,20 +29,9 @@ typedef struct _UdpRadarObj
double
lat
;
double
alt
;
int32_t
objPos
;
std
::
string
cross_name
;
std
::
string
inner_pos
;
uint64_t
pt
[
4
];
}
UdpRadarObj
;
typedef
struct
_UdpRadarData
{
std
::
string
device
;
uint64_t
tm
;
std
::
string
str_tm
;
int32_t
size
;
UdpRadarObj
objs
[
100
];
uint64_t
pt
[];
}
UdpRadarData
;
#pragma pack()
#endif // FUSION_UDP_OBJ_H
\ No newline at end of file
src/fusionDistribTask.cpp
View file @
2abbd02e
...
...
@@ -165,7 +165,7 @@ void FusionDistributeTask::udpSrv()
{
int
socketHandle
;
struct
sockaddr_in
server
,
client
;
UdpRadar
Data
data
;
UdpRadar
Obj
obj
;
socketHandle
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
-
1
==
socketHandle
)
{
...
...
@@ -186,8 +186,8 @@ void FusionDistributeTask::udpSrv()
char
buf
[
10240
]
=
{
0
};
while
(
FConfPtr
->
mBAppExit
==
false
)
{
int
cliLen
=
sizeof
(
client
);
int
ret
=
recvfrom
(
socketHandle
,
(
void
*
)
&
data
,
(
size_t
)
sizeof
(
data
),
0
,
(
struct
sockaddr
*
)
&
client
,
(
socklen_t
*
)
&
cliLen
);
if
(
ret
!=
sizeof
(
data
))
{
int
ret
=
recvfrom
(
socketHandle
,
(
void
*
)
&
obj
,
(
size_t
)
sizeof
(
obj
),
0
,
(
struct
sockaddr
*
)
&
client
,
(
socklen_t
*
)
&
cliLen
);
if
(
ret
!=
sizeof
(
obj
))
{
continue
;
}
...
...
@@ -196,29 +196,25 @@ void FusionDistributeTask::udpSrv()
continue
;
}
UdpRadarData
radar_data
=
{};
memcpy
((
void
*
)
&
radar_data
,
data
,
(
size_t
)
sizeof
(
data
));
tObjPtr
->
mDevIDStr
=
radar_data
.
device
;
tObjPtr
->
mDevIDStr
=
obj
.
device
;
tObjPtr
->
mModeStr
=
"r"
;
for
(
const
auto
obj
:
radar_data
.
objs
)
{
tObjPtr
->
mID
=
obj
.
id
;
tObjPtr
->
mMS
=
obj
.
time
;
tObjPtr
->
mLon
=
obj
.
lon
;
tObjPtr
->
mLat
=
obj
.
lat
;
tObjPtr
->
mAlt
=
0
;
tObjPtr
->
mHeading
=
obj
.
heading
;
tObjPtr
->
mSpeed
=
obj
.
speed
;
tObjPtr
->
mLength
=
obj
.
vehL
;
tObjPtr
->
mWidth
=
obj
.
vehW
;
tObjPtr
->
mHeight
=
obj
.
vehH
;
tObjPtr
->
mXPos
=
obj
.
xPos
;
tObjPtr
->
mYPos
=
obj
.
yPos
;
tObjPtr
->
mTypeStr
=
obj
.
type
;
tObjPtr
->
mSubType
=
0
;
mBufTrafficObjListMutex
.
lock
();
mBufTrafficObjList
.
push_back
(
tObjPtr
);
mBufTrafficObjListMutex
.
unlock
();
}
tObjPtr
->
mID
=
obj
.
id
;
tObjPtr
->
mMS
=
obj
.
time
;
tObjPtr
->
mLon
=
obj
.
lon
;
tObjPtr
->
mLat
=
obj
.
lat
;
tObjPtr
->
mAlt
=
0
;
tObjPtr
->
mHeading
=
obj
.
heading
;
tObjPtr
->
mSpeed
=
obj
.
speed
;
tObjPtr
->
mLength
=
obj
.
vehL
;
tObjPtr
->
mWidth
=
obj
.
vehW
;
tObjPtr
->
mHeight
=
obj
.
vehH
;
tObjPtr
->
mXPos
=
obj
.
xPos
;
tObjPtr
->
mYPos
=
obj
.
yPos
;
tObjPtr
->
mTypeStr
=
obj
.
type
;
tObjPtr
->
mSubType
=
0
;
mBufTrafficObjListMutex
.
lock
();
mBufTrafficObjList
.
push_back
(
tObjPtr
);
mBufTrafficObjListMutex
.
unlock
();
close
(
socketHandle
);
}
...
...
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