mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-16 19:32:12 +08:00
fixes
This commit is contained in:
@@ -144,8 +144,6 @@ class RadarTracks:
|
||||
d_rel, y_rel, v_rel = track.dRel, track.yRel, track.vRel
|
||||
if not (math.isfinite(d_rel) and math.isfinite(y_rel) and math.isfinite(v_rel)):
|
||||
continue
|
||||
if radar_track_is_stationary(v_rel, v_ego):
|
||||
continue
|
||||
|
||||
pt = map_to_screen(d_rel, -y_rel, path_offset_z)
|
||||
if pt is None:
|
||||
@@ -153,7 +151,8 @@ class RadarTracks:
|
||||
|
||||
x, y = pt[0] + screen_offset[0], pt[1] + screen_offset[1]
|
||||
color = radar_track_color(v_rel, v_ego)
|
||||
radius = track_size
|
||||
stationary = radar_track_is_stationary(v_rel, v_ego)
|
||||
radius = max(1, track_size - 4) if stationary else track_size
|
||||
track_id = int(track.trackId)
|
||||
highlight_color = highlighted_tracks.get(track_id)
|
||||
if highlight_color is not None:
|
||||
|
||||
@@ -94,7 +94,7 @@ def test_draw_radar_tracks_allows_unknown_acceleration(monkeypatch):
|
||||
assert drawn_colors == [color_tuple(radar_track_color(-5))]
|
||||
|
||||
|
||||
def test_draw_radar_tracks_hides_stationary_dots(monkeypatch):
|
||||
def test_draw_radar_tracks_shrinks_stationary_dots(monkeypatch):
|
||||
live_tracks = car.RadarData.new_message()
|
||||
point = live_tracks.init("points", 1)[0]
|
||||
point.dRel = 10
|
||||
@@ -108,7 +108,7 @@ def test_draw_radar_tracks_hides_stationary_dots(monkeypatch):
|
||||
live_tracks, lambda d_rel, y_rel, z: (20, 30), path_offset_z=1.2, track_size=6, v_ego=20,
|
||||
)
|
||||
|
||||
assert drawn_sizes == []
|
||||
assert drawn_sizes == [2]
|
||||
|
||||
|
||||
def test_draw_radar_tracks_keeps_matched_speed_dots_large(monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user