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
f310159d
Commit
f310159d
authored
Jul 07, 2022
by
ChenKun
🕺🏿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add udp server
parent
368acc3b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
11 deletions
+100
-11
rvfusion_config.yaml
config/rvfusion_config.yaml
+25
-0
fusionDistribTask.h
incl/fusionDistribTask.h
+1
-0
fusionUdpObj.h
incl/fusionUdpObj.h
+47
-0
fusion.launch
launch/fusion.launch
+1
-1
fusionDistribTask.cpp
src/fusionDistribTask.cpp
+26
-10
No files found.
config/rvfusion_config.yaml
0 → 100644
View file @
f310159d
GlobalConfig
:
mec_id
:
"
00000051"
FusionConfig
:
thread
:
4
center_lon
:
0
center_lat
:
0
fusion_stdout
:
true
log_indata
:
true
log_path
:
"
/workspace/fusion_data/origin"
filter_radius
:
130
fusion_radius
:
130
vision_vehicle_out_radius
:
130
vision_unvehicle_out_radius
:
130
first_mode
:
"
r"
create_fobj_mode
:
"
rv"
check_objtype
:
true
filter_radar_nonvehicle
:
true
filter_radar_vehicle
:
false
filter_vision_nonvehicle
:
false
filter_vision_vehicle
:
false
filter_devid_r
:
[]
filter_devid_v
:
[]
dynamicDropFrame
:
true
heading_keep
:
[]
incl/fusionDistribTask.h
View file @
f310159d
...
...
@@ -22,6 +22,7 @@
#include "fusionCsv.h"
#include "sensDevice.h"
#include "fusionDataLog.h"
#include "fusionUdpObj.h"
using
namespace
std
;
...
...
incl/fusionUdpObj.h
0 → 100644
View file @
f310159d
#ifndef FUSION_UDP_OBJ_H
#define FUSION_UDP_OBJ_H
#include <cstdint>
#include <string>
#pragma pack(1)
typedef
struct
_UdpRadarObj
{
std
::
string
id
;
std
::
string
strId
;
std
::
string
type
;
int32_t
vehType
;
double
vehL
;
double
vehW
;
double
vehH
;
double
xPos
;
double
yPos
;
double
speed
;
double
heading
;
double
dist
;
double
bearing
;
double
rcs
;
double
prop
;
double
lon
;
double
lat
;
double
alt
;
int32_t
objPos
;
std
::
string
cross_name
;
std
::
string
inner_pos
;
}
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
launch/fusion.launch
View file @
f310159d
<launch>
<arg name="rvfusion_config_path" default="
/workspace/etc
/rvfusion_config.yaml" />
<arg name="rvfusion_config_path" default="
$(find jfx_multi_site)/config
/rvfusion_config.yaml" />
<node pkg="jfx_rvfusion_cx" type="jfx_rvfusion_cx" name="jfx_rvfusion_cx" output="screen" respawn="true" >
<param name="config_file" value="$(arg rvfusion_config_path)" />
</node>
...
...
src/fusionDistribTask.cpp
View file @
f310159d
...
...
@@ -160,14 +160,12 @@ void FusionDistributeTask::onVisionData(const jfx_common_msgs::det_tracking_arra
}
}
// ToDO: 用实际的结构代替这个
typedef
struct
_tagSTTempData
{
}
STTempData
;
void
FusionDistributeTask
::
udpSrv
()
{
int
socketHandle
;
struct
sockaddr_in
server
,
client
;
STTemp
Data
data
;
UdpRadar
Data
data
;
socketHandle
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
-
1
==
socketHandle
)
{
...
...
@@ -198,14 +196,32 @@ void FusionDistributeTask::udpSrv()
continue
;
}
// ToDO: set tObjPtr value
UdpRadarData
radar_data
=
{};
memcpy
((
void
*
)
radar_data
,
data
,
(
size_t
)
sizeof
(
data
));
tObjPtr
->
mDevIDStr
=
radar_data
.
device
;
tObjPtr
->
mModeStr
=
"r"
;
for
(
const
auto
obj
:
radar_data
.
objs
)
{
tObjPtr
->
mID
=
obj
.
id
;
tObjPtr
->
mMS
=
obj
.
create_stamp
;
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
();
}
mBufTrafficObjListMutex
.
lock
();
mBufTrafficObjList
.
push_back
(
tObjPtr
);
mBufTrafficObjListMutex
.
unlock
();
close
(
socketHandle
);
}
close
(
socketHandle
);
}
void
FusionDistributeTask
::
run
()
...
...
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