diff --git a/release/remote_build.py b/release/remote_build.py index 1dc430c622..1bd7ada0fa 100755 --- a/release/remote_build.py +++ b/release/remote_build.py @@ -46,7 +46,7 @@ def start_build(name): conn.send("echo \"git took $SECONDS seconds\"\n") push = "PUSH=master-ci" if branch == "master" else "" - comma_jwt = "COMMA_JWT=" + os.getenv('COMMA_JWT', '') + #comma_jwt = "COMMA_JWT=" + os.getenv('COMMA_JWT', '') conn.send("%s /data/openpilot_source/release/build_devel.sh\n" % push) conn.send('echo "RESULT:" $?\n') diff --git a/scripts/get_fan_control_type.py b/scripts/get_fan_control_type.py index d98f605666..da43596183 100755 --- a/scripts/get_fan_control_type.py +++ b/scripts/get_fan_control_type.py @@ -12,11 +12,12 @@ def setup_fan(): bus.write_byte_data(0x21, 0x02, 0x2) # needed? bus.write_byte_data(0x21, 0x04, 0x4) # manual override source print("OP detected") - return False + ret = False except IOError: print("LEON detected") - return True + ret = True bus.close() + return ret def get_fan_type(): if not setup_fan(): @@ -27,7 +28,7 @@ def get_fan_type(): # alternate type bus.write_i2c_block_data(0x3d, 0, [0x1]) print("Alternate type detected") - return + return except IOError: # tusb320 type print("tusb320 type detected") diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py index 3c97fb30fb..69b3862df4 100755 --- a/selfdrive/car/mock/interface.py +++ b/selfdrive/car/mock/interface.py @@ -15,8 +15,7 @@ LPG = 2 * 3.1415 * YAW_FR * TS / (1 + 2 * 3.1415 * YAW_FR * TS) class CarInterface(CarInterfaceBase): def __init__(self, CP, CarController, CarState): - self.CP = CP - self.CC = CarController + super().__init__(CP, CarController, CarState) cloudlog.debug("Using Mock Car Interface") diff --git a/selfdrive/debug/show_matching_cars.py b/selfdrive/debug/show_matching_cars.py index 273ae1469b..81dff1f060 100755 --- a/selfdrive/debug/show_matching_cars.py +++ b/selfdrive/debug/show_matching_cars.py @@ -3,12 +3,6 @@ from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_ca import cereal.messaging as messaging -# Prius and Leuxs es 300H -fingerprint = {898: 8, 905: 8, 810: 2, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 921: 8, 800: 8, 944: 8, 1570: 8, 1059: 1, 36: 8, 37: 8, 550: 8, 295: 8, 296: 8, 170: 8, 1071: 8, 560: 7, 945: 8, 562: 6, 180: 8, 1077: 8, 950: 8, 951: 8, 953: 8, 1595: 8, 1084: 8, 829: 2, 1086: 8, 1568: 8, 452: 8, 581: 5, 1057: 8, 713: 8, 971: 7, 975: 5, 1571: 8, 466: 8, 467: 8, 1572: 8, 1114: 8, 933: 8, 863: 8, 608: 8, 993: 8, 610: 8, 955: 8, 166: 8, 1056: 8, 956: 8, 1132: 8, 1085: 8, 552: 4, 1779: 8, 1017: 8, 1020: 8, 426: 6, 1279: 8} - -# rav4 2019 and corolla tss2 -fingerprint = {896: 8, 898: 8, 976: 1, 1541: 8, 905: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1552: 8, 1553: 8, 1556: 8, 921: 8, 1056: 8, 544: 4, 1570: 8, 1059: 1, 36: 8, 37: 8, 550: 8, 552: 4, 170: 8, 812: 8, 944: 8, 945: 8, 562: 6, 180: 8, 1077: 8, 951: 8, 824: 8, 1076: 8, 186: 4, 955: 8, 956: 8, 705: 8, 452: 8, 1592: 8, 464: 8, 1571: 8, 466: 8, 467: 8, 761: 8, 728: 8, 1572: 8, 1114: 8, 933: 8, 800: 8, 608: 8, 865: 8, 610: 8, 1595: 8, 1745: 8, 764: 8, 1002: 8, 1649: 8, 1779: 8, 1568: 8, 1017: 8, 1279: 8, 1020: 8, 810: 2, 426: 6} - # rav4 2019 and corolla tss2 fingerprint = {896: 8, 898: 8, 900: 6, 976: 1, 1541: 8, 902: 6, 905: 8, 810: 2, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1552: 8, 1553: 8, 1556: 8, 1571: 8, 921: 8, 1056: 8, 544: 4, 1570: 8, 1059: 1, 36: 8, 37: 8, 550: 8, 935: 8, 552: 4, 170: 8, 812: 8, 944: 8, 945: 8, 562: 6, 180: 8, 1077: 8, 951: 8, 1592: 8, 1076: 8, 186: 4, 955: 8, 956: 8, 1001: 8, 705: 8, 452: 8, 1788: 8, 464: 8, 824: 8, 466: 8, 467: 8, 761: 8, 728: 8, 1572: 8, 1114: 8, 933: 8, 800: 8, 608: 8, 865: 8, 610: 8, 1595: 8, 934: 8, 998: 5, 1745: 8, 1000: 8, 764: 8, 1002: 8, 999: 7, 1789: 8, 1649: 8, 1779: 8, 1568: 8, 1017: 8, 1786: 8, 1787: 8, 1020: 8, 426: 6, 1279: 8} diff --git a/selfdrive/locationd/ubloxd_test.cc b/selfdrive/locationd/ubloxd_test.cc index 68fe6351ea..ec65577f2a 100644 --- a/selfdrive/locationd/ubloxd_test.cc +++ b/selfdrive/locationd/ubloxd_test.cc @@ -30,13 +30,13 @@ using namespace ublox; extern volatile sig_atomic_t do_exit; -void write_file(std::string fpath, uint8_t *data, int len) { +void write_file(std::string fpath, uint8_t *to_write, int len) { FILE* f = fopen(fpath.c_str(), "wb"); if (!f) { std::cout << "Open " << fpath << " failed" << std::endl; return; } - fwrite(data, len, 1, f); + fwrite(to_write, len, 1, f); fclose(f); } @@ -72,11 +72,11 @@ Message * poll_ubloxraw_msg(Poller * poller) { } } -int send_gps_event(PubSocket *s, const void *buf, size_t len) { +int send_gps_event(PubSocket *s, const void *buf, size_t length) { assert(s); - write_file(prefix + "/" + std::to_string(save_idx), (uint8_t *)buf, len); + write_file(prefix + "/" + std::to_string(save_idx), (uint8_t *)buf, length); save_idx++; - return len; + return length; } int main(int argc, char** argv) { diff --git a/tools/carcontrols/debug_controls.py b/tools/carcontrols/debug_controls.py index afb02a09a5..7d13a0b76b 100755 --- a/tools/carcontrols/debug_controls.py +++ b/tools/carcontrols/debug_controls.py @@ -64,11 +64,7 @@ def steer_thread(): #print "enable", enabled, "steer", actuators.steer, "accel", actuators.gas - actuators.brake hud_alert = 0 - audible_alert = 0 - if joystick.testJoystick.buttons[2]: - audible_alert = "beepSingle" if joystick.testJoystick.buttons[3]: - audible_alert = "chimeRepeated" hud_alert = "steerRequired" CC.actuators.gas = actuators.gas diff --git a/tools/replay/ui.py b/tools/replay/ui.py index 61f01dc4e2..2a91c1b55b 100755 --- a/tools/replay/ui.py +++ b/tools/replay/ui.py @@ -111,7 +111,6 @@ def ui_thread(addr, frame_address): draw_plots = init_plots(plot_arr, name_to_arr_idx, plot_xlims, plot_ylims, plot_names, plot_colors, plot_styles, bigplots=True) - counter = 0 while 1: list(pygame.event.get()) diff --git a/tools/replay/unlogger.py b/tools/replay/unlogger.py index 52294c5550..920d9d0b34 100755 --- a/tools/replay/unlogger.py +++ b/tools/replay/unlogger.py @@ -438,6 +438,7 @@ def main(argv): except TimeoutError: p.terminate() continue + return 0 if __name__ == "__main__": sys.exit(main(sys.argv[1:])) diff --git a/tools/sim/lib/can.py b/tools/sim/lib/can.py index 867a8447e7..3a3890ba13 100755 --- a/tools/sim/lib/can.py +++ b/tools/sim/lib/can.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import cereal.messaging as messaging -from opendbc.can.parser import CANParser +#from opendbc.can.parser import CANParser from opendbc.can.packer import CANPacker from selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp from selfdrive.car.honda.values import FINGERPRINTS, CAR diff --git a/tools/sim/lib/helpers.py b/tools/sim/lib/helpers.py index 2156e7bc4a..104d5e3633 100644 --- a/tools/sim/lib/helpers.py +++ b/tools/sim/lib/helpers.py @@ -1,5 +1,3 @@ -import numpy as np - class FakeSteeringWheel(): def __init__(self, dt=0.01): # physical params @@ -13,7 +11,7 @@ class FakeSteeringWheel(): self.angle = 0. # start centered # self.omega = 0. - + def response(self, torque, vego=0): exerted_torque = torque * self.DAC # centering_torque = np.clip(-(self.centering_k * self.angle), -1.1, 1.1)