mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-12 16:32:09 +08:00
enable flake8 E231: missing whitespace after comma
This commit is contained in:
+2
-2
@@ -22,12 +22,12 @@ args = parser.parse_args()
|
||||
|
||||
pm = messaging.PubMaster(['frame', 'sensorEvents', 'can'])
|
||||
|
||||
W,H = 1164, 874
|
||||
W, H = 1164, 874
|
||||
|
||||
def cam_callback(image):
|
||||
img = np.frombuffer(image.raw_data, dtype=np.dtype("uint8"))
|
||||
img = np.reshape(img, (H, W, 4))
|
||||
img = img[:, :, [0,1,2]].copy()
|
||||
img = img[:, :, [0, 1, 2]].copy()
|
||||
|
||||
dat = messaging.new_message('frame')
|
||||
dat.frame = {
|
||||
|
||||
@@ -37,7 +37,7 @@ def can_function(pm, speed, angle, idx, cruise_button=0, is_engaged=False):
|
||||
msg.append(packer.make_can_msg("GAS_PEDAL_2", 0, {}, idx))
|
||||
msg.append(packer.make_can_msg("SEATBELT_STATUS", 0, {"SEATBELT_DRIVER_LATCHED": 1}, idx))
|
||||
msg.append(packer.make_can_msg("STEER_STATUS", 0, {}, idx))
|
||||
msg.append(packer.make_can_msg("STEERING_SENSORS", 0, {"STEER_ANGLE":angle_to_sangle(angle)}, idx))
|
||||
msg.append(packer.make_can_msg("STEERING_SENSORS", 0, {"STEER_ANGLE": angle_to_sangle(angle)}, idx))
|
||||
msg.append(packer.make_can_msg("POWERTRAIN_DATA", 0, {}, idx))
|
||||
msg.append(packer.make_can_msg("VSA_STATUS", 0, {}, idx))
|
||||
msg.append(packer.make_can_msg("STANDSTILL", 0, {}, idx))
|
||||
@@ -63,7 +63,7 @@ def can_function(pm, speed, angle, idx, cruise_button=0, is_engaged=False):
|
||||
|
||||
# fill in the rest for fingerprint
|
||||
done = set([x[0] for x in msg])
|
||||
for k,v in FINGERPRINTS[CAR.CIVIC][0].items():
|
||||
for k, v in FINGERPRINTS[CAR.CIVIC][0].items():
|
||||
if k not in done and k not in [0xE4, 0x194]:
|
||||
msg.append([k, 0, b'\x00'*v, 0])
|
||||
pm.send('can', can_list_to_can_capnp(msg))
|
||||
|
||||
@@ -167,19 +167,19 @@ def wheel_poll_thread(q):
|
||||
q.put(str("steer_%f" % normalized))
|
||||
|
||||
if mtype & 0x01: # buttons
|
||||
if number in [0,19]: # X
|
||||
if number in [0, 19]: # X
|
||||
if value == 1: # press down
|
||||
q.put(str("cruise_down"))
|
||||
|
||||
if number in [3,18]: # triangle
|
||||
if number in [3, 18]: # triangle
|
||||
if value == 1: # press down
|
||||
q.put(str("cruise_up"))
|
||||
|
||||
if number in [1,6]: # square
|
||||
if number in [1, 6]: # square
|
||||
if value == 1: # press down
|
||||
q.put(str("cruise_cancel"))
|
||||
|
||||
if number in [10,21]: # R3
|
||||
if number in [10, 21]: # R3
|
||||
if value == 1: # press down
|
||||
q.put(str("reverse_switch"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user