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
7910d6bb
Commit
7910d6bb
authored
Dec 27, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交添加配置项
parent
33cebb92
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
11 deletions
+57
-11
BaseTrack.h
BaseTracker/BaseTrack.h
+5
-0
BaseTracker.h
BaseTracker/BaseTracker.h
+14
-4
Track3D.cpp
BaseTracker/Track3D.cpp
+20
-4
Track3D.h
BaseTracker/Track3D.h
+2
-0
TrackingRos.cpp
TrackingRos.cpp
+16
-3
No files found.
BaseTracker/BaseTrack.h
View file @
7910d6bb
...
...
@@ -44,6 +44,11 @@ public:
float
*
GetPredictPtr
();
float
*
GetRPtr
();
void
SetIouThreshold
(
float
threshold
)
{
m_iou_threshold
=
threshold
;
}
void
SetMaxCoastCycles
(
int
cycles
)
{
m_kMaxCoastCycles
=
cycles
;
}
void
SetValidUpdateCount
(
int
count
)
{
m_updateValidCount
=
count
;
}
virtual
void
SetValues
(
std
::
vector
<
float
>&
data
)
{}
int
coast_cycles_
=
0
,
hit_streak_
=
0
;
int
m_update_count
=
0
;
//数据更新的次数
...
...
BaseTracker/BaseTracker.h
View file @
7910d6bb
...
...
@@ -23,10 +23,11 @@ class BaseTracker
public
:
BaseTracker
()
{}
void
SetGPU
(
int
gpu
)
{
m_isGPU
=
gpu
;
}
void
SetGPU
(
int
gpu
)
{
m_isGPU
=
gpu
;
}
void
SetIouThreshold
(
float
threshold
)
{
m_iou_threshold
=
threshold
;
}
void
SetMaxCoastCycles
(
int
cycles
)
{
m_kMaxCoastCycles
=
cycles
;
}
void
SetValidUpdateCount
(
int
count
){
m_updateValidCount
=
count
;
}
void
SetValues
(
std
::
vector
<
float
>&
values
)
{
m_values
=
values
;
}
int
Run
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
std
::
vector
<
uint64_t
>&
detectionsId
,
std
::
map
<
uint64_t
,
int
>&
updateId
,
std
::
vector
<
uint64_t
>&
lostId
);
...
...
@@ -43,6 +44,11 @@ public:
int
m_isGPU
=
0
;
//默认不使用
float
m_iou_threshold
=
0
.
01
;
//iou计算之后匹配的最小值
int
m_kMaxCoastCycles
=
2
;
//predict之后,计算几次认为丢失。
int
m_updateValidCount
=
3
;
//更新多少次认为是一个有效数据。
std
::
vector
<
float
>
m_values
;
//调整矩阵参数的配置
};
...
...
@@ -133,6 +139,10 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std:
{
std
::
shared_ptr
<
T
>
trackPtr
=
std
::
make_shared
<
T
>
();
trackPtr
->
Init
(
detections
[
det
]);
trackPtr
->
SetIouThreshold
(
m_iou_threshold
);
trackPtr
->
SetMaxCoastCycles
(
m_kMaxCoastCycles
);
trackPtr
->
SetValidUpdateCount
(
m_updateValidCount
);
trackPtr
->
SetValues
(
m_values
);
// Create new track and generate new ID
uint64_t
newId
=
++
m_countId
;
m_tracker
[
newId
]
=
trackPtr
;
...
...
BaseTracker/Track3D.cpp
View file @
7910d6bb
...
...
@@ -104,8 +104,6 @@ Track3D::Track3D():BaseTrack(10, 7)
kf_
=
kf
;
m_iou_threshold
=
0.01
;
}
void
Track3D
::
Init
(
const
std
::
vector
<
float
>&
data
)
{
...
...
@@ -337,4 +335,23 @@ void Track3D::UpdateDataCheck(const std::vector<float>& data, std::vector<float>
out
=
data
;
out
[
3
]
=
rot_y
;
}
\ No newline at end of file
}
void
Track3D
::
SetValues
(
std
::
vector
<
float
>&
data
)
{
if
(
data
.
size
()
<
1
)
return
;
float
a
=
data
[
0
];
if
(
kf_
==
nullptr
)
return
;
kf
->
R_
<<
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
a
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
;
}
BaseTracker/Track3D.h
View file @
7910d6bb
...
...
@@ -43,6 +43,8 @@ public:
virtual
void
UpdateDataCheck
(
const
std
::
vector
<
float
>&
data
,
std
::
vector
<
float
>&
out
);
//对于输入数据进行修正
virtual
void
SetValues
(
std
::
vector
<
float
>&
data
);
trackOjbPtr
m_obj
=
nullptr
;
std
::
vector
<
point2d
>
m_points
;
//保存最近的5个移动的点位
...
...
TrackingRos.cpp
View file @
7910d6bb
...
...
@@ -173,9 +173,22 @@ void TrackingRos::Init(ros::NodeHandle& nh)
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
);
YAML
::
Node
config
=
YAML
::
LoadFile
(
file
.
c_str
());
float
threshold
;
nh
.
param
<
float
>
(
"iou_threshold"
,
threshold
,
0.01
);
m_tracker
.
SetIouThreshold
(
threshold
);
int
max_coastcycles
;
nh
.
param
<
int32_t
>
(
"max_coastcycles"
,
max_coastcycles
,
2
);
m_tracker
.
SetMaxCoastCycles
(
max_coastcycles
);
int
update_valid_count
;
nh
.
param
<
int32_t
>
(
"update_valid_count"
,
update_valid_count
,
2
);
m_tracker
.
SetValidUpdateCount
(
update_valid_count
);
float
matrix_angle_r_value
;
nh
.
param
<
float
>
(
"matrix_angle_r_value"
,
matrix_angle_r_value
,
0.1
);
std
::
vector
<
float
>
values
;
values
.
push_back
(
matrix_angle_r_value
);
m_tracker
.
SetValues
(
values
);
YAML
::
Node
config
=
YAML
::
LoadFile
(
file
.
c_str
())
auto
cfg
=
config
[
"TRACKING"
];
m_trans
=
cfg
[
"TRANS"
].
as
<
std
::
vector
<
std
::
vector
<
double
>>>
();
...
...
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