From b8ca61cef138855b71e06742b9a47e4108549669 Mon Sep 17 00:00:00 2001 From: Kumar <36933347+rav4kumar@users.noreply.github.com> Date: Wed, 13 Jan 2021 12:36:55 -0700 Subject: [PATCH] sync (#95) * support for kfv and kfbp and overshooting fix (#768) * toyota rsa logic * no arne messaging and add opedit * add gas_press, smartspeed and spdval1 to carstate * more fixes * new_message * thats right we dont have anglelater code yet. * revert to working mapd code? and pylint ignore mapd * flake8 ignore. * flake8 e701 fix * control df with distance button? * wrong struct * Update carstate.py * update missing * start MessagedArneThread * Update carstate.py * pubmaster? * message * update carstate.py * no .status * pm * use dp_dynamic_follow to send DF status * sntax * encoding='utf8' * Update carstate.py * Update carstate.py * pyopencl pipenv * change the order so we can display right thing with distance toggle * doesnt work well with dg * Revert "change the order so we can display right thing with distance toggle" This reverts commit ee4522ae5cc6857a8bb3423609a9296598afbd6b. * turn off distance button for now. * Parametrize MIN_CAN_SPEED in car interfaces * Parametrize stoppingBrakeRate * Parametrize startingBrakeRate * add the parameter to cereal . * Update dp_common.py * tune dg * add AVALON_2021 in dp080 * sync (#93) * Update dp_common.py * Update dp_common.py * RSA, Distance button and briskspirit longcontrol (#762) * toyota rsa logic * no arne messaging and add opedit * add gas_press, smartspeed and spdval1 to carstate * more fixes * new_message * thats right we dont have anglelater code yet. * revert to working mapd code? and pylint ignore mapd * flake8 ignore. * flake8 e701 fix * control df with distance button? * wrong struct * Update carstate.py * update missing * start MessagedArneThread * Update carstate.py * pubmaster? * message * update carstate.py * no .status * pm * use dp_dynamic_follow to send DF status * sntax * encoding='utf8' * Update carstate.py * Update carstate.py * pyopencl pipenv * change the order so we can display right thing with distance toggle * doesnt work well with dg * Revert "change the order so we can display right thing with distance toggle" This reverts commit ee4522ae5cc6857a8bb3423609a9296598afbd6b. * turn off distance button for now. * Parametrize MIN_CAN_SPEED in car interfaces * Parametrize stoppingBrakeRate * Parametrize startingBrakeRate * add the parameter to cereal . * Update dp_common.py Co-authored-by: Arne Schwarck Co-authored-by: George Hotz Co-authored-by: Igor * corolla_TSS2: tune (#760) * Update interface.py updated corollatss2 tuning * Update toyota_nodsu_pt_generated.dbc * Update toyota_nodsu_hybrid_pt_generated.dbc * Update op_params.py * Create toyota_nodsu_pt_generated_corolla_tss2.dbc * Create toyota_nodsu_pt_generated_corollah_tss2.dbc * revert to stock. * revert to stock * point corolla and corollah to its own separate dbc. * add corolla and corollah dbc to release. * Update interface.py Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com> Co-authored-by: Arne Schwarck Co-authored-by: George Hotz Co-authored-by: Igor Co-authored-by: SCshredder17 <57152954+SCshredder17@users.noreply.github.com> * added dbc to release and test route. * cant use the route since comma doesnt got it. * i cant spell * add PIControllerk_f * Add kfV and kfBP to PIDTuning * update the car interfaces for bfv and kfbp tunning. * Add scanner for Cython dependencies * cleanup unused android libs in phonelibs (#19702) Co-authored-by: Comma Device * syntax * E502 flake8 fix * fix * make it list. * ugh list * kfV * forgot vw * update ford * Shanes PIDController: orvershooting fix * action fix. * restore crash logging trackign of fork and branch. * add pirus to nodsu * fix * fix for crash * my bad. * revert. * working. Co-authored-by: Arne Schwarck Co-authored-by: George Hotz Co-authored-by: Igor Co-authored-by: SCshredder17 <57152954+SCshredder17@users.noreply.github.com> Co-authored-by: Willem Melching Co-authored-by: Adeeb Shihadeh Co-authored-by: Comma Device * better logging for fingerprint missing * Function log_fingerprinted not needed Co-authored-by: Arne Schwarck Co-authored-by: George Hotz Co-authored-by: Igor Co-authored-by: SCshredder17 <57152954+SCshredder17@users.noreply.github.com> Co-authored-by: Willem Melching Co-authored-by: Adeeb Shihadeh Co-authored-by: Comma Device --- selfdrive/car/car_helpers.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 288f63748e21d1..7fb756a3e01158 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -10,7 +10,6 @@ import cereal.messaging as messaging from selfdrive.car import gen_empty_fingerprint from cereal import car -from common.dp_common import is_online from common.travis_checker import travis if not travis: import selfdrive.crash as crash @@ -180,6 +179,25 @@ def fingerprint(logcan, sendcan, has_relay): put_nonblocking('dp_car_detected', car_fingerprint) return car_fingerprint, finger, vin, car_fw, source +def is_connected_to_internet(timeout=5): + try: + requests.get("https://sentry.io", timeout=timeout) + return True + except: + return False + +def crash_log(candidate): + while True: + if is_connected_to_internet(): + crash.capture_warning("fingerprinted %s" % candidate) + break + +def crash_log2(fingerprints, fw): + while True: + if is_connected_to_internet(): + crash.capture_warning("car doesn't match any fingerprints: %s" % fingerprints) + crash.capture_warning("car doesn't match any fw: %s" % fw) + break def get_car(logcan, sendcan, has_relay=False): candidate, fingerprints, vin, car_fw, source = fingerprint(logcan, sendcan, has_relay) @@ -187,9 +205,12 @@ def get_car(logcan, sendcan, has_relay=False): if candidate is None: cloudlog.warning("car doesn't match any fingerprints: %r", fingerprints) candidate = "mock" + if not travis: + y = threading.Thread(target=crash_log2, args=(fingerprints,car_fw,)) + y.start() - if is_online(): - x = threading.Thread(target=log_fingerprinted, args=(candidate,)) + if not travis: + x = threading.Thread(target=crash_log, args=(candidate,)) x.start() CarInterface, CarController, CarState = interfaces[candidate] @@ -199,8 +220,3 @@ def get_car(logcan, sendcan, has_relay=False): car_params.fingerprintSource = source return CarInterface(car_params, CarController, CarState), car_params - -def log_fingerprinted(candidate): - while True: - crash.capture_warning("fingerprinted %s" % candidate) - break