mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 00:36:32 +08:00
enable flake8 E231: missing whitespace after comma
This commit is contained in:
@@ -23,7 +23,7 @@ _PATH_X = np.arange(192.)
|
||||
_PATH_XD = np.arange(192.)
|
||||
_PATH_PINV = compute_path_pinv(50)
|
||||
#_BB_OFFSET = 290, 332
|
||||
_BB_OFFSET = 0,0
|
||||
_BB_OFFSET = 0, 0
|
||||
_BB_SCALE = 1164/640.
|
||||
_BB_TO_FULL_FRAME = np.asarray([
|
||||
[_BB_SCALE, 0., _BB_OFFSET[0]],
|
||||
@@ -110,24 +110,24 @@ def draw_lead_on(img, closest_x_m, closest_y_m, calibration, color, sz=10, img_o
|
||||
|
||||
|
||||
def init_plots(arr, name_to_arr_idx, plot_xlims, plot_ylims, plot_names, plot_colors, plot_styles, bigplots=False):
|
||||
color_palette = { "r": (1,0,0),
|
||||
"g": (0,1,0),
|
||||
"b": (0,0,1),
|
||||
"k": (0,0,0),
|
||||
"y": (1,1,0),
|
||||
"p": (0,1,1),
|
||||
"m": (1,0,1) }
|
||||
color_palette = { "r": (1, 0, 0),
|
||||
"g": (0, 1, 0),
|
||||
"b": (0, 0, 1),
|
||||
"k": (0, 0, 0),
|
||||
"y": (1, 1, 0),
|
||||
"p": (0, 1, 1),
|
||||
"m": (1, 0, 1) }
|
||||
|
||||
if bigplots:
|
||||
fig = plt.figure(figsize=(6.4, 7.0))
|
||||
else:
|
||||
fig = plt.figure()
|
||||
|
||||
fig.set_facecolor((0.2,0.2,0.2))
|
||||
fig.set_facecolor((0.2, 0.2, 0.2))
|
||||
|
||||
axs = []
|
||||
for pn in range(len(plot_ylims)):
|
||||
ax = fig.add_subplot(len(plot_ylims),1,len(axs)+1)
|
||||
ax = fig.add_subplot(len(plot_ylims), 1, len(axs)+1)
|
||||
ax.set_xlim(plot_xlims[pn][0], plot_xlims[pn][1])
|
||||
ax.set_ylim(plot_ylims[pn][0], plot_ylims[pn][1])
|
||||
ax.patch.set_facecolor((0.4, 0.4, 0.4))
|
||||
|
||||
@@ -35,7 +35,7 @@ if __name__ == "__main__":
|
||||
|
||||
if sm.updated['liveCalibration']:
|
||||
intrinsic_matrix = eon_intrinsics
|
||||
img_transform = np.array(fpkt.frame.transform).reshape(3,3)
|
||||
img_transform = np.array(fpkt.frame.transform).reshape(3, 3)
|
||||
extrinsic_matrix = np.asarray(sm['liveCalibration'].extrinsicMatrix).reshape(3, 4)
|
||||
ke = intrinsic_matrix.dot(extrinsic_matrix)
|
||||
warp_matrix = get_camera_frame_from_medmodel_frame(ke)
|
||||
|
||||
+8
-8
@@ -63,7 +63,7 @@ def ui_thread(addr, frame_address):
|
||||
|
||||
camera_surface = pygame.surface.Surface((640, 480), 0, 24).convert()
|
||||
cameraw_surface = pygame.surface.Surface(MODEL_INPUT_SIZE, 0, 24).convert()
|
||||
top_down_surface = pygame.surface.Surface((UP.lidar_x, UP.lidar_y),0,8)
|
||||
top_down_surface = pygame.surface.Surface((UP.lidar_x, UP.lidar_y), 0, 8)
|
||||
|
||||
frame = messaging.sub_sock('frame', addr=addr, conflate=True)
|
||||
sm = messaging.SubMaster(['carState', 'plan', 'carControl', 'radarState', 'liveCalibration', 'controlsState', 'liveTracks', 'model', 'liveMpc', 'liveParameters', 'pathPlan'], addr=addr)
|
||||
@@ -113,7 +113,7 @@ def ui_thread(addr, frame_address):
|
||||
while 1:
|
||||
list(pygame.event.get())
|
||||
|
||||
screen.fill((64,64,64))
|
||||
screen.fill((64, 64, 64))
|
||||
lid_overlay = lid_overlay_blank.copy()
|
||||
top_down = top_down_surface, lid_overlay
|
||||
|
||||
@@ -122,7 +122,7 @@ def ui_thread(addr, frame_address):
|
||||
rgb_img_raw = fpkt.frame.image
|
||||
|
||||
if fpkt.frame.transform:
|
||||
img_transform = np.array(fpkt.frame.transform).reshape(3,3)
|
||||
img_transform = np.array(fpkt.frame.transform).reshape(3, 3)
|
||||
else:
|
||||
# assume frame is flipped
|
||||
img_transform = np.array([
|
||||
@@ -200,17 +200,17 @@ def ui_thread(addr, frame_address):
|
||||
for lead in [sm['radarState'].leadOne, sm['radarState'].leadTwo]:
|
||||
if lead.status:
|
||||
if calibration is not None:
|
||||
draw_lead_on(img, lead.dRel, lead.yRel, calibration, color=(192,0,0))
|
||||
draw_lead_on(img, lead.dRel, lead.yRel, calibration, color=(192, 0, 0))
|
||||
|
||||
draw_lead_car(lead.dRel, top_down)
|
||||
|
||||
# *** blits ***
|
||||
pygame.surfarray.blit_array(camera_surface, img.swapaxes(0,1))
|
||||
pygame.surfarray.blit_array(camera_surface, img.swapaxes(0, 1))
|
||||
screen.blit(camera_surface, (0, 0))
|
||||
|
||||
# display alerts
|
||||
alert_line1 = alert1_font.render(sm['controlsState'].alertText1, True, (255,0,0))
|
||||
alert_line2 = alert2_font.render(sm['controlsState'].alertText2, True, (255,0,0))
|
||||
alert_line1 = alert1_font.render(sm['controlsState'].alertText1, True, (255, 0, 0))
|
||||
alert_line2 = alert2_font.render(sm['controlsState'].alertText2, True, (255, 0, 0))
|
||||
screen.blit(alert_line1, (180, 150))
|
||||
screen.blit(alert_line2, (180, 190))
|
||||
|
||||
@@ -229,7 +229,7 @@ def ui_thread(addr, frame_address):
|
||||
screen.blit(cameraw_surface, (320, 480))
|
||||
|
||||
pygame.surfarray.blit_array(*top_down)
|
||||
screen.blit(top_down[0], (640,0))
|
||||
screen.blit(top_down[0], (640, 0))
|
||||
|
||||
i = 0
|
||||
SPACING = 25
|
||||
|
||||
Reference in New Issue
Block a user