Skip to content

Commit 155d842

Browse files
set plot limits for touch events viz (commaai#34277)
lim
1 parent d40fd19 commit 155d842

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

selfdrive/debug/touch_replay.py

+6
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@
3838
if fingers[current_slot][1] != -1:
3939
touch_points.append(fingers[current_slot].copy())
4040

41+
if not touch_points:
42+
print(f'No touch events found for {route}')
43+
quit()
44+
4145
unique_points, counts = np.unique(touch_points, axis=0, return_counts=True)
4246

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

0 commit comments

Comments
 (0)