Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_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
jfx_kalman_filter_src
Commits
6332b534
Commit
6332b534
authored
Dec 01, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交写log日志的逻辑。
parent
7914ee49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
21 deletions
+55
-21
TrackingRos.cpp
TrackingRos.cpp
+20
-2
jfx_log.cpp
log/jfx_log.cpp
+35
-19
No files found.
TrackingRos.cpp
View file @
6332b534
...
...
@@ -341,8 +341,21 @@ void TrackingRos::Init(ros::NodeHandle& nh)
#endif
// SDK_LOG(SDK_INFO, "trans = [%s]", GetMatrixStr(m_trans, 4, 4).c_str());
SDK_LOG
(
SDK_INFO
,
"kitti2origin = [%s]"
,
GetMatrixStr
(
m_kitti2origin
,
4
,
4
).
c_str
());
// ADD_DEF_LOG(1, "tracking.csv");
// SDK_IDX_LOG(1, SDK_INFO, "date,frameNum,time,id,input_radian,input_angle,predict_radian,predict_angle,output_radian,output_angle,input_type,input_x,input_y,input_z,input_l,input_w,input_h,last_type,predict_x,predict_y,predict_z,predict_l,predict_w,preditc_h,output_type,output_x,output_y,output_z,output_l,output_w,output_h,output_rot_y,v_x,v_y,v_z,lat,lon");
int
is_save_log
=
0
;
if
(
config
[
"is_save_log"
])
is_save_log
=
config
[
"is_save_log"
].
as
<
int
>
();
if
(
is_save_log
==
1
)
{
std
::
string
logFile
=
"./tracking_log.log"
;
if
(
config
[
"save_log_file"
])
logFile
=
config
[
"save_log_file"
].
as
<
std
::
string
>
();
ADD_DEF_LOG
(
1
,
logFile
.
c_str
());
SDK_IDX_LOG
(
1
,
SDK_INFO
,
"frame,type,score,h,w,l,x,y,z,rot_y,obj_id,v_x,v_y,v_z,loc_x,loc_y,loc_z,Lat,Long,center_Lat,center_Long,name,license_plate_number,color_name"
);
// frame,type,score,h,w,l,x,y,z,rot_y,obj_id,v_x,v_y,v_z,loc_x,loc_y,loc_z,Lat,Long,center_Lat,center_Long,name,license_plate_number,color_name
// 时间戳(整型),目标类型(整型),置信度(浮点),高度(浮点),宽度(浮点),长度(浮点),中心点局部x坐标(浮点),中心点局部y坐标(浮点),中心点局部z坐标(浮点),航向角(浮点),跟踪ID(整型),速度x(浮点),速度y(浮点),速度z(浮点),定位点x(浮点),定位点y(浮点),定位点z(浮点),定位点纬度(双精度浮点),定位点经度(双精度浮点),中心点纬度(双精度浮点),中心点经度(双精度浮点),名称(字符串,可选),车牌号(字符串,可选),颜色(字符串,可选)
}
//m_coordinate.Init(value[0][0], value[0][1], value[0][2], value[0][3], value[1][0], value[1][1]);
std
::
string
fusion_topic
=
"/fusion_res"
;
...
...
@@ -720,6 +733,11 @@ void TrackingRos::ThreadTrackingProcess()
// last_type,predict[0], predict[1], predict[2], predict[4], predict[5], predict[6],
// obj.type,obj.x, obj.y, obj.z, obj.l, obj.w, obj.h, obj.rot_y, obj.v_x, obj.v_y, obj.v_z, obj.Lat, obj.Long);
}
// frame,type,score,h,w,l,x,y,z,rot_y,obj_id,v_x,v_y,v_z,loc_x,loc_y,loc_z,Lat,Long,center_Lat,center_Long,name,license_plate_number,color_name
// 时间戳(整型),目标类型(整型),置信度(浮点),高度(浮点),宽度(浮点),长度(浮点),中心点局部x坐标(浮点),中心点局部y坐标(浮点),中心点局部z坐标(浮点),航向角(浮点),跟踪ID(整型),速度x(浮点),速度y(浮点),速度z(浮点),定位点x(浮点),定位点y(浮点),定位点z(浮点),定位点纬度(双精度浮点),定位点经度(双精度浮点),中心点纬度(双精度浮点),中心点经度(双精度浮点),名称(字符串,可选),车牌号(字符串,可选),颜色(字符串,可选)
SDK_IDX_LOG
(
1
,
SDK_INFO
,
"%llu,%d,%f,%f,%f,%f,%f,%f,%f,%f,%u,%f,%f,%f,0,0,0,0,0,%.10f,%.10f,%s,%s,%s"
,
obj
.
frame
,
obj
.
type
,
obj
.
score
,
obj
.
h
,
obj
.
w
,
obj
.
l
,
obj
.
x
,
obj
.
y
,
obj
.
z
,
obj
.
rot_y
,
obj
.
obj_id
,
obj
.
v_x
*
10
,
obj
.
v_y
*
10
,
obj
.
v_z
*
10
,
obj
.
Lat
,
obj
.
Long
,
obj
.
name
.
c_str
(),
obj
.
license_plate_number
.
c_str
(),
obj
.
color_name
.
c_str
());
jsk_recognition_msgs
::
BoundingBox
box
=
{};
box
.
label
=
obj
.
obj_id
;
...
...
log/jfx_log.cpp
View file @
6332b534
...
...
@@ -47,25 +47,41 @@ int AddLogFileSys(const char* file, int& fileIdx)
if
(
name
.
empty
())
return
-
1
;
fileIdx
=
1
;
std
::
string
path
=
GetRootDir
();
time_t
tt
=
time
(
NULL
);
tm
*
t
=
localtime
(
&
tt
);
char
logName
[
1024
]
=
{};
sprintf
(
logName
,
"%04d%02d%02d-%02d%02d%02d_%s"
,
t
->
tm_year
+
1900
,
t
->
tm_mon
+
1
,
t
->
tm_mday
,
t
->
tm_hour
,
t
->
tm_min
,
t
->
tm_sec
,
file
);
std
::
string
csvFile
=
std
::
string
(
logName
);
std
::
string
dir
=
path
+
"/"
+
csvFile
;
LOG
(
INFO
)
<<
"AddLogFileSys save file = "
<<
dir
;
#ifdef _WIN32
if
(
fopen_s
(
&
g_file
,
dir
.
c_str
(),
"wt"
)
!=
0
)
#else
if
(
nullptr
==
(
g_file
=
fopen
(
dir
.
c_str
(),
"wt"
)))
#endif
{
g_file
=
nullptr
;
return
-
2
;
}
if
(
name
==
"csv"
)
{
std
::
string
path
=
GetRootDir
();
time_t
tt
=
time
(
NULL
);
tm
*
t
=
localtime
(
&
tt
);
char
logName
[
1024
]
=
{};
sprintf
(
logName
,
"%04d%02d%02d-%02d%02d%02d_%s"
,
t
->
tm_year
+
1900
,
t
->
tm_mon
+
1
,
t
->
tm_mday
,
t
->
tm_hour
,
t
->
tm_min
,
t
->
tm_sec
,
file
);
std
::
string
csvFile
=
std
::
string
(
logName
);
std
::
string
dir
=
path
+
"/"
+
csvFile
;
LOG
(
INFO
)
<<
"AddLogFileSys save file = "
<<
dir
;
#ifdef _WIN32
if
(
fopen_s
(
&
g_file
,
dir
.
c_str
(),
"wt"
)
!=
0
)
#else
if
(
nullptr
==
(
g_file
=
fopen
(
dir
.
c_str
(),
"wt"
)))
#endif
{
g_file
=
nullptr
;
return
-
2
;
}
}
else
{
std
::
string
dir
=
name
;
LOG
(
INFO
)
<<
"AddLogFileSys save file = "
<<
dir
;
#ifdef _WIN32
if
(
fopen_s
(
&
g_file
,
dir
.
c_str
(),
"wt+"
)
!=
0
)
#else
if
(
nullptr
==
(
g_file
=
fopen
(
dir
.
c_str
(),
"wt"
)))
#endif
{
g_file
=
nullptr
;
return
-
2
;
}
}
}
return
0
;
}
...
...
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