VW MQB: Fixes for network location detection (#22174)

* VW MQB: Fixes for network location detection

* apply review suggestion

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* FP back to 100ms; VIN state poll at 50Hz

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 5a4d03da29
commatwo_master
Jason Young 4 years ago committed by GitHub
parent 58aec2531e
commit 1df072cd3a
  1. 4
      selfdrive/boardd/boardd.cc
  2. 8
      selfdrive/car/volkswagen/interface.py

@ -61,7 +61,7 @@ void safety_setter_thread(Panda *panda) {
LOGW("got CarVin %s", value_vin.c_str());
break;
}
util::sleep_for(100);
util::sleep_for(20);
}
// VIN query done, stop listening to OBDII
@ -170,7 +170,7 @@ static Panda *usb_retry_connect() {
LOGW("connected to board");
return panda;
}
util::sleep_for(100);
util::sleep_for(100);
};
return nullptr;
}

@ -30,18 +30,18 @@ class CarInterface(CarInterfaceBase):
if True: # pylint: disable=using-constant-test
# Set global MQB parameters
ret.safetyModel = car.CarParams.SafetyModel.volkswagen
ret.enableBsm = 0x30F in fingerprint[0]
ret.enableBsm = 0x30F in fingerprint[0] # SWA_01
if 0xAD in fingerprint[0]: # Getriebe_11
ret.transmissionType = TransmissionType.automatic
elif 0x187 in fingerprint[0]: # EV_Gearshift
ret.transmissionType = TransmissionType.direct
else: # No trans message at all, must be a true stick-shift manual
else:
ret.transmissionType = TransmissionType.manual
if 0x86 in fingerprint[1]: # LWI_01 seen on bus 1, we're wired to the CAN gateway
if any(msg in fingerprint[1] for msg in [0x40, 0x86, 0xB2]): # Airbag_01, LWI_01, ESP_19
ret.networkLocation = NetworkLocation.gateway
else: # We're wired to the LKAS camera
else:
ret.networkLocation = NetworkLocation.fwdCamera
# Global tuning defaults, can be overridden per-vehicle

Loading…
Cancel
Save