Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AP-S 2020 - PyRaTk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DELTA
DELTA Low-Cost 5.8GHz FMCW Radar PCB
AP-S 2020 Software
AP-S 2020 - PyRaTk
Commits
1cc4d03f
Commit
1cc4d03f
authored
4 years ago
by
Merlo, Jason
Browse files
Options
Downloads
Patches
Plain Diff
Added heat map to tracker
parent
1d6dc270
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyratk/widgets/polar_tracker_widget.py
+14
-6
14 additions, 6 deletions
pyratk/widgets/polar_tracker_widget.py
with
14 additions
and
6 deletions
pyratk/widgets/polar_tracker_widget.py
+
14
−
6
View file @
1cc4d03f
...
@@ -17,7 +17,7 @@ from pyratk.datatypes.geometry import Point, Circle
...
@@ -17,7 +17,7 @@ from pyratk.datatypes.geometry import Point, Circle
class
PolarTrackerWidget
(
pg
.
GraphicsLayoutWidget
):
class
PolarTrackerWidget
(
pg
.
GraphicsLayoutWidget
):
def
__init__
(
self
,
tracker
,
max_range
=
20
,
moving_average_weight
=
0.2
,
trail_length
=
1
0
0
):
def
__init__
(
self
,
tracker
,
max_range
=
20
,
moving_average_weight
=
0.2
,
trail_length
=
1
5
0
):
super
().
__init__
()
super
().
__init__
()
"""
"""
Initialize polar tracker widget.
Initialize polar tracker widget.
...
@@ -70,6 +70,13 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
...
@@ -70,6 +70,13 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
# self.plot.addItem(self.radar_loc_plot)
# self.plot.addItem(self.radar_loc_plot)
# self.pw_trajectory = self.plot.plot()
self
.
sw_trajectory
=
pg
.
ScatterPlotItem
(
size
=
25
,
pen
=
pg
.
mkPen
(
None
),
brush
=
pg
.
mkBrush
(
0
,
0
,
255
,
10
))
self
.
plot
.
addItem
(
self
.
sw_trajectory
)
# Add radar detection marker plot
# Add radar detection marker plot
self
.
det_loc_plot
=
pg
.
ScatterPlotItem
(
self
.
det_loc_plot
=
pg
.
ScatterPlotItem
(
size
=
10
,
pen
=
pg
.
mkPen
(
None
),
brush
=
pg
.
mkBrush
(
255
,
255
,
0
,
255
))
size
=
10
,
pen
=
pg
.
mkPen
(
None
),
brush
=
pg
.
mkBrush
(
255
,
255
,
0
,
255
))
...
@@ -77,8 +84,6 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
...
@@ -77,8 +84,6 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
self
.
plot
.
addItem
(
self
.
det_loc_plot
)
self
.
plot
.
addItem
(
self
.
det_loc_plot
)
self
.
pw_trajectory
=
self
.
plot
.
plot
()
# Set up plot
# Set up plot
#self.plot.setLimits(yMin=0)
#self.plot.setLimits(yMin=0)
self
.
plot
.
setRange
(
yRange
=
[
0
,
self
.
max_range
],
xRange
=
[
-
self
.
max_range
,
self
.
max_range
])
self
.
plot
.
setRange
(
yRange
=
[
0
,
self
.
max_range
],
xRange
=
[
-
self
.
max_range
,
self
.
max_range
])
...
@@ -97,6 +102,7 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
...
@@ -97,6 +102,7 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
Draw detections on graph.
Draw detections on graph.
'''
'''
self
.
det_loc_plot
.
clear
()
self
.
det_loc_plot
.
clear
()
self
.
sw_trajectory
.
clear
()
if
self
.
tracker
.
detections
:
if
self
.
tracker
.
detections
:
det
=
self
.
tracker
.
detections
[
0
]
det
=
self
.
tracker
.
detections
[
0
]
...
@@ -115,9 +121,11 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
...
@@ -115,9 +121,11 @@ class PolarTrackerWidget(pg.GraphicsLayoutWidget):
self
.
trajectory
.
append
(
self
.
det_loc
)
self
.
trajectory
.
append
(
self
.
det_loc
)
data
=
np
.
array
([(
p
[
0
],
p
[
1
])
for
p
in
self
.
trajectory
[
self
.
trail_length
]])
data
=
np
.
array
([(
p
[
0
],
p
[
1
])
for
p
in
self
.
trajectory
[
-
self
.
trail_length
:]])
trajectory_pen
=
pg
.
mkPen
({
'
color
'
:
"
FF0A
"
,
'
width
'
:
2
})
self
.
sw_trajectory
.
addPoints
(
pos
=
data
)
self
.
pw_trajectory
.
setData
(
data
,
pen
=
trajectory_pen
)
# trajectory_pen = pg.mkPen({'color': "FFFA", 'width': 2})
# self.pw_trajectory.setData(data, pen=trajectory_pen)
self
.
det_loc_plot
.
addPoints
(
pos
=
[
self
.
det_loc
])
self
.
det_loc_plot
.
addPoints
(
pos
=
[
self
.
det_loc
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment