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
4b7e5982
Commit
4b7e5982
authored
Feb 28, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改读取配置逻辑
parent
10afaad8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
TrackingRos.cpp
TrackingRos.cpp
+26
-15
No files found.
TrackingRos.cpp
View file @
4b7e5982
...
...
@@ -194,44 +194,55 @@ void TrackingRos::Init(ros::NodeHandle& nh)
//std::string file = folder + yaml;
int
gpu
=
0
;
gpu
=
m_config
[
"kf_gpu"
].
as
<
int32_t
>
();
if
(
m_config
[
"kf_gpu"
])
gpu
=
m_config
[
"kf_gpu"
].
as
<
int32_t
>
();
else
SDK_LOG
(
SDK_INFO
,
"can not load kf_gpu "
);
//nh.param<int32_t>("kf_gpu", gpu, 0);
SDK_LOG
(
SDK_INFO
,
"kf_gpu = %d"
,
gpu
);
m_tracker
.
SetGPU
(
gpu
);
m_lidar_x_angle
=
m_config
[
"lidar_x_angle"
].
as
<
float
>
();
if
(
m_config
[
"lidar_x_angle"
])
m_lidar_x_angle
=
m_config
[
"lidar_x_angle"
].
as
<
float
>
();
//nh.param<float>("lidar_x_angle", m_lidar_x_angle, 354.102);
SDK_LOG
(
SDK_INFO
,
"m_lidar_x_angle = %f"
,
m_lidar_x_angle
);
float
threshold
;
threshold
=
m_config
[
"iou_threshold"
].
as
<
float
>
();
float
threshold
=
0.00001
;
if
(
m_config
[
"iou_threshold"
])
threshold
=
m_config
[
"iou_threshold"
].
as
<
float
>
();
//nh.param<float>("iou_threshold", threshold, 0.01);
SDK_LOG
(
SDK_INFO
,
"iou_threshold = %f"
,
threshold
);
m_tracker
.
SetIouThreshold
(
threshold
);
int
max_coastcycles
;
max_coastcycles
=
m_config
[
"max_coastcycles"
].
as
<
int32_t
>
();
int
max_coastcycles
=
1
;
if
(
m_config
[
"max_coastcycles"
])
max_coastcycles
=
m_config
[
"max_coastcycles"
].
as
<
int32_t
>
();
//nh.param<int32_t>("max_coastcycles", max_coastcycles, 2);
SDK_LOG
(
SDK_INFO
,
"max_coastcycles = %d"
,
max_coastcycles
);
m_tracker
.
SetMaxCoastCycles
(
max_coastcycles
);
int
update_valid_count
;
update_valid_count
=
m_config
[
"update_valid_count"
].
as
<
int32_t
>
();
int
update_valid_count
=
2
;
if
(
m_config
[
"update_valid_count"
])
update_valid_count
=
m_config
[
"update_valid_count"
].
as
<
int32_t
>
();
//nh.param<int32_t>("update_valid_count", update_valid_count, 3);
SDK_LOG
(
SDK_INFO
,
"update_valid_count = %d"
,
update_valid_count
);
m_tracker
.
SetValidUpdateCount
(
update_valid_count
);
float
matrix_angle_r_value
;
matrix_angle_r_value
=
m_config
[
"matrix_angle_r_value"
].
as
<
float
>
();
float
matrix_angle_r_value
=
1
;
if
(
m_config
[
"matrix_angle_r_value"
])
matrix_angle_r_value
=
m_config
[
"matrix_angle_r_value"
].
as
<
float
>
();
//nh.param<float>("matrix_angle_r_value", matrix_angle_r_value, 0.1);
SDK_LOG
(
SDK_INFO
,
"matrix_angle_r_value = %f"
,
matrix_angle_r_value
);
std
::
vector
<
float
>
values
;
values
.
push_back
(
matrix_angle_r_value
);
m_tracker
.
SetValues
(
values
);
auto
cfg
=
config
;
m_trans
=
cfg
[
"TRANS"
].
as
<
std
::
vector
<
std
::
vector
<
double
>>>
();
if
(
config
[
"TRANS"
])
m_trans
=
config
[
"TRANS"
].
as
<
std
::
vector
<
std
::
vector
<
double
>>>
();
else
SDK_LOG
(
SDK_INFO
,
"can not load TRANS from yaml"
);
auto
cfg2
=
config
;
m_kitti2origin
=
cfg2
[
"KITTI2ORIGIN"
].
as
<
std
::
vector
<
std
::
vector
<
double
>>>
();
if
(
config
[
"KITTI2ORIGIN"
])
m_kitti2origin
=
config
[
"KITTI2ORIGIN"
].
as
<
std
::
vector
<
std
::
vector
<
double
>>>
();
else
SDK_LOG
(
SDK_INFO
,
"can not load KITTI2ORIGIN from yaml"
);
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
());
...
...
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