Skip to content

Commit

Permalink
set plot limits for touch events viz (#34277)
Browse files Browse the repository at this point in the history
lim
  • Loading branch information
maxime-desroches authored Dec 17, 2024
1 parent d40fd19 commit 155d842
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions selfdrive/debug/touch_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@
if fingers[current_slot][1] != -1:
touch_points.append(fingers[current_slot].copy())

if not touch_points:
print(f'No touch events found for {route}')
quit()

unique_points, counts = np.unique(touch_points, axis=0, return_counts=True)

plt.figure(figsize=(10, 3))
plt.scatter(unique_points[:, 0], unique_points[:, 1], c=counts, s=counts * 20, edgecolors='red')
plt.colorbar()
plt.title(f'Touches for {route}')
plt.xlim(0, w)
plt.ylim(0, h)
plt.grid(True)
plt.show()

0 comments on commit 155d842

Please sign in to comment.