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
e01a1828
Commit
e01a1828
authored
Dec 29, 2021
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交nsight代码
parent
49acb8fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
BaseTracker.h
BaseTracker/BaseTracker.h
+22
-2
TrackingRos.cpp
TrackingRos.cpp
+15
-0
No files found.
BaseTracker/BaseTracker.h
View file @
e01a1828
...
...
@@ -17,6 +17,10 @@
#include "kalman_update_batch_online.h"
#endif
#ifdef _USING_NSIGHT_
#include <nvToolsExt.h>
#endif
template
<
class
T
>
class
BaseTracker
{
...
...
@@ -56,6 +60,9 @@ template<class T>
int
BaseTracker
<
T
>::
Run
(
const
std
::
vector
<
std
::
vector
<
float
>
>&
detections
,
int
_no
/*观测数量*/
,
int
_ns
/*状态数量*/
,
std
::
vector
<
uint64_t
>&
detectionsId
,
std
::
map
<
uint64_t
,
int
>&
updateId
,
std
::
vector
<
uint64_t
>&
lostId
)
{
/*** Predict internal tracks from previous frame ***/
#ifdef _USING_NSIGHT_
nvtxRangePush
(
"Run Predict"
);
#endif
for
(
auto
&
track
:
m_tracker
)
{
track
.
second
->
Predict
();
...
...
@@ -63,10 +70,16 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, int
//track.second->GetPredictData(predict);
//SDK_LOG(SDK_INFO, "predict id = %d, data = [%f,%f,%f,%f,%f,%f,%f]",track.first,predict[0], predict[1], predict[2], predict[3], predict[4], predict[5], predict[6]);
}
#ifdef _USING_NSIGHT_
nvtxRangePop
();
#endif
if
(
detections
.
empty
())
{
return
0
;
}
#ifdef _USING_NSIGHT_
nvtxRangePush
(
"Run AssociateDetectionsToTrackers"
);
#endif
detectionsId
.
resize
(
detections
.
size
());
// Hash-map between track ID and associated detection bounding box
std
::
map
<
uint64_t
,
int
>
matched
;
...
...
@@ -75,8 +88,13 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, int
// return values - matched, unmatched_det
AssociateDetectionsToTrackers
(
detections
,
_no
,
_ns
,
m_tracker
,
matched
,
unmatched_det
);
#ifdef _USING_NSIGHT_
nvtxRangePop
();
#endif
/*** Update tracks with associated bbox ***/
#ifdef _USING_NSIGHT_
nvtxRangePush
(
"Run Update"
);
#endif
if
(
m_isGPU
==
0
)
{
for
(
const
auto
&
match
:
matched
)
...
...
@@ -137,7 +155,9 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, int
//SDK_LOG(SDK_INFO, "after P = [%s]", GetMatrixStr(P.get(), ns * ns, bs).c_str());
}
}
#ifdef _USING_NSIGHT_
nvtxRangePop
();
#endif
/*** Create new tracks for unmatched detections ***/
for
(
const
auto
&
det
:
unmatched_det
)
{
...
...
TrackingRos.cpp
View file @
e01a1828
...
...
@@ -6,6 +6,9 @@
#include <yaml-cpp/yaml.h>
#include "matrix.h"
#include <eigen3/Eigen/Dense>
#ifdef _USING_NSIGHT_
#include <nvToolsExt.h>
#endif
float
to360
(
float
rot_y
,
float
lidar_x_angle
)
...
...
@@ -293,6 +296,9 @@ void TrackingRos::ThreadTrackingProcess()
bool
ret
=
m_objsQueue
.
timeout_pop
(
objsPtr
,
2000
);
if
(
ret
)
{
#ifdef _USING_NSIGHT_
nvtxRangePush
(
"ThreadTrackingProcess"
);
#endif
m_frameNum
++
;
//SDK_LOG(SDK_INFO, "get objs size = %d,m_frameNum = %d",objsPtr->array.size(), m_frameNum);
std
::
vector
<
std
::
vector
<
float
>
>
input
;
...
...
@@ -315,7 +321,13 @@ void TrackingRos::ThreadTrackingProcess()
std
::
vector
<
uint64_t
>
lostId
;
uint64_t
begin
=
GetCurTime
();
#ifdef _USING_NSIGHT_
nvtxRangePush
(
"m_tracker.Run"
);
#endif
m_tracker
.
Run
(
input
,
7
,
10
,
detectionsId
,
updateId
,
lostId
);
#ifdef _USING_NSIGHT_
nvtxRangePop
();
#endif
uint64_t
rTime
=
GetCurTime
()
-
begin
;
//SDK_LOG(SDK_INFO, "m_tracker.Run time = %llu", rTime);
std
::
map
<
uint64_t
,
std
::
shared_ptr
<
Track3D
>
>&
trackers
=
m_tracker
.
GetStates
();
...
...
@@ -464,6 +476,9 @@ void TrackingRos::ThreadTrackingProcess()
m_pub
.
publish
(
sendObjs
);
m_pubBoundingBoxes
.
publish
(
sendBoxes
);
#ifdef _USING_NSIGHT_
nvtxRangePop
();
#endif
}
}
...
...
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