diff --git a/README.md b/README.md index 5783603..042e3ba 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Running IQ.Pilot * A modern comma, or clone device to run this software (Comma 3, 3x, 4, Konik A1/M, Mr.One C3, C3 Lite) -* One of [the supported cars](https://gitlvb.teallvbs.xyz/IQ.Lvbs/IQ.Pilot/src/branch/release/opendbc_repo/docs/CARS.md). +* One of [the supported cars](https://gitlvb.teallvbs.xyz/IQ.Lvbs/IQ.Pilot/src/branch/release/iqdbc_repo/docs/CARS.md). * A [car harness](https://comma.ai/shop/products/car-harness) to connect to your car #### Side Note: Volkswagen Group, and Tesla vehicles are currently the most compatible for use with IQ.Pilot, other manufacturers are supported at a minimum to the same level as stock openpilot, but are not a top priority while we are in beta. ## Installation diff --git a/SConstruct b/SConstruct index 0d571e7..e044420 100644 --- a/SConstruct +++ b/SConstruct @@ -208,7 +208,7 @@ Export('common') env_swaglog = env.Clone() env_swaglog['CXXFLAGS'].append('-DSWAGLOG="\\"common/swaglog.h\\""') SConscript(['msgq_repo/SConscript'], exports={'env': env_swaglog}) -SConscript(['opendbc_repo/SConscript'], exports={'env': env_swaglog}) +SConscript(['iqdbc_repo/SConscript'], exports={'env': env_swaglog}) SConscript(['cereal/SConscript']) diff --git a/cereal/car.capnp b/cereal/car.capnp index 4bc7f89..658a09d 120000 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -1 +1 @@ -../opendbc_repo/opendbc/car/car.capnp \ No newline at end of file +../iqdbc_repo/iqdbc/car/car.capnp \ No newline at end of file diff --git a/cereal/custom.capnp b/cereal/custom.capnp index 9056d21..4aed6b7 100644 --- a/cereal/custom.capnp +++ b/cereal/custom.capnp @@ -319,7 +319,6 @@ struct IQOnroadEvent @0xf4621d3ee9233bc9 { } struct IQCarParams @0xd4189b5c8aca9f78 { - # Data fields first (packed into the struct data section), pointer field last. # Ordinals are IQ-native; all consumers access by name. Live copies self-heal # via CLEAR_ON_MANAGER_START on the "IQCarParams" param; the persistent cache # is versioned separately (see IQCarParamsPersistentV2). @@ -329,6 +328,7 @@ struct IQCarParams @0xd4189b5c8aca9f78 { enableGasInterceptor @3 :Bool; iqLateralNet @4 :LateralNet; + longitudinalStoppingSpeedOverride @5 :Float32; # m/s; zero keeps the upstream default struct LateralNet { fuzzyFingerprint @0 :Bool; diff --git a/common/params.cc b/common/params.cc index 0b2a184..6af00fe 100644 --- a/common/params.cc +++ b/common/params.cc @@ -103,14 +103,10 @@ Params::~Params() { assert(queue.empty()); } -std::vector Params::allKeys(ParamKeyFlag flag) const { +std::vector Params::allKeys() const { std::vector ret; - ret.reserve(keys.size()); - for (const auto &[name, attrs] : keys) { - const bool matches = (flag == ALL) || ((attrs.flags & flag) != 0); - if (matches) { - ret.push_back(name); - } + for (auto &p : keys) { + ret.push_back(p.first); } return ret; } diff --git a/common/params.h b/common/params.h index 64ba5ed..8169063 100644 --- a/common/params.h +++ b/common/params.h @@ -18,7 +18,6 @@ enum ParamKeyFlag { DONT_LOG = 0x20, DEVELOPMENT_ONLY = 0x40, CLEAR_ON_IGNITION_ON = 0x80, - KONN3KT_BACKUP = 0x100, ALL = 0xFFFFFFFF }; @@ -46,7 +45,7 @@ public: Params(const Params&) = delete; Params& operator=(const Params&) = delete; - std::vector allKeys(ParamKeyFlag flag = ALL) const; + std::vector allKeys() const; bool checkKey(const std::string &key); ParamKeyFlag getKeyFlag(const std::string &key); ParamKeyType getKeyType(const std::string &key); diff --git a/common/params_keys.h b/common/params_keys.h index f62db7e..c6fc6b5 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -7,8 +7,8 @@ inline static std::unordered_map keys = { {"AccessToken", {CLEAR_ON_MANAGER_START | DONT_LOG, STRING}}, - {"AdbEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"AlwaysOnDM", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"AdbEnabled", {PERSISTENT, BOOL}}, + {"AlwaysOnDM", {PERSISTENT, BOOL}}, {"ApiCache_Device", {PERSISTENT, STRING}}, {"ApiCache_FirehoseStats", {PERSISTENT, JSON}}, {"AssistNowToken", {PERSISTENT, STRING}}, @@ -31,20 +31,20 @@ inline static std::unordered_map keys = { {"CurrentBootlog", {PERSISTENT, STRING}}, {"CurrentRoute", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, STRING}}, {"DisableLogging", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, - {"DisablePowerDown", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"DisableUpdates", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"UpdaterInstallMode", {PERSISTENT | KONN3KT_BACKUP, STRING, "download_and_install"}}, - {"DisengageOnAccelerator", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"DisablePowerDown", {PERSISTENT, BOOL}}, + {"DisableUpdates", {PERSISTENT, BOOL, "0"}}, + {"UpdaterInstallMode", {PERSISTENT, STRING, "download_and_install"}}, + {"DisengageOnAccelerator", {PERSISTENT, BOOL, "0"}}, {"DongleId", {PERSISTENT, STRING}}, {"DoReboot", {CLEAR_ON_MANAGER_START, BOOL}}, {"DevicePowerState", {CLEAR_ON_MANAGER_START, STRING}}, {"DoShutdown", {CLEAR_ON_MANAGER_START, BOOL}}, {"DoUninstall", {CLEAR_ON_MANAGER_START, BOOL}}, {"DriverTooDistracted", {CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON, BOOL}}, - {"AlphaLongitudinalEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"ExperimentalMode", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"ExperimentalModeConfirmed", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"FastSleep", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"AlphaLongitudinalEnabled", {PERSISTENT, BOOL}}, + {"ExperimentalMode", {PERSISTENT, BOOL}}, + {"ExperimentalModeConfirmed", {PERSISTENT, BOOL}}, + {"FastSleep", {PERSISTENT, BOOL}}, {"FirmwareQueryDone", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"ForcePowerDown", {PERSISTENT, BOOL}}, {"GitAuthBlob", {PERSISTENT, BYTES}}, @@ -52,21 +52,21 @@ inline static std::unordered_map keys = { {"GitCommit", {PERSISTENT, STRING}}, {"GitCommitDate", {PERSISTENT, STRING}}, {"GitDiff", {PERSISTENT, STRING}}, - {"GithubSshKeys", {PERSISTENT | KONN3KT_BACKUP, STRING}}, - {"GithubUsername", {PERSISTENT | KONN3KT_BACKUP, STRING}}, + {"GithubSshKeys", {PERSISTENT, STRING}}, + {"GithubUsername", {PERSISTENT, STRING}}, {"GitRemote", {PERSISTENT, STRING}}, - {"GsmApn", {PERSISTENT | KONN3KT_BACKUP, STRING}}, - {"GsmMetered", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"GsmRoaming", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"GsmApn", {PERSISTENT, STRING}}, + {"GsmMetered", {PERSISTENT, BOOL, "1"}}, + {"GsmRoaming", {PERSISTENT, BOOL}}, {"HardwareSerial", {PERSISTENT, STRING}}, {"HasAcceptedTerms", {PERSISTENT, STRING, "0"}}, {"HephaestusdPid", {PERSISTENT, INT}}, {"InstallDate", {PERSISTENT, TIME}}, {"IsDriverViewEnabled", {CLEAR_ON_MANAGER_START, BOOL}}, {"IsEngaged", {PERSISTENT, BOOL}}, - {"IsLdwEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"IsLdwEnabled", {PERSISTENT, BOOL}}, {"IsLiveStreaming", {CLEAR_ON_MANAGER_START, BOOL}}, - {"IsMetric", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"IsMetric", {PERSISTENT, BOOL}}, {"IsOffroad", {CLEAR_ON_MANAGER_START, BOOL}}, {"IsOnroad", {PERSISTENT, BOOL}}, {"IsRhdDetected", {PERSISTENT, BOOL}}, @@ -77,7 +77,8 @@ inline static std::unordered_map keys = { {"JoystickAolRequest", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, STRING}}, {"Konn3ktSshKeys", {PERSISTENT, STRING}}, {"Konn3ktBleTransportEnabled", {PERSISTENT, BOOL, "1"}}, - {"LanguageSetting", {PERSISTENT | KONN3KT_BACKUP, STRING, "en"}}, + {"Konn3ktLibdatachannelWebRTC", {PERSISTENT, BOOL, "0"}}, + {"LanguageSetting", {PERSISTENT, STRING, "en"}}, {"LastAthenaPingTime", {CLEAR_ON_MANAGER_START, INT}}, {"LastGPSPosition", {PERSISTENT, STRING}}, {"LastManagerExitReason", {CLEAR_ON_MANAGER_START, STRING}}, @@ -88,7 +89,7 @@ inline static std::unordered_map keys = { {"LastUpdateRouteCount", {PERSISTENT, INT, "0"}}, {"LastUpdateTime", {PERSISTENT, TIME}}, {"LastUpdateUptimeOnroad", {PERSISTENT, FLOAT, "0.0"}}, - {"LiveDelay", {PERSISTENT | KONN3KT_BACKUP, BYTES}}, + {"LiveDelay", {PERSISTENT, BYTES}}, {"LiveParameters", {PERSISTENT, JSON}}, {"LiveParametersV2", {PERSISTENT, BYTES}}, {"LivestreamEncoderBitrate", {CLEAR_ON_MANAGER_START | DONT_LOG, INT}}, @@ -97,8 +98,8 @@ inline static std::unordered_map keys = { {"LocationFilterInitialState", {PERSISTENT, BYTES}}, {"LateralManeuverMode", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL}}, {"LongitudinalManeuverMode", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL}}, - {"LongitudinalPersonality", {PERSISTENT | KONN3KT_BACKUP, INT, std::to_string(static_cast(cereal::LongitudinalPersonality::STANDARD))}}, - {"NetworkMetered", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"LongitudinalPersonality", {PERSISTENT, INT, std::to_string(static_cast(cereal::LongitudinalPersonality::STANDARD))}}, + {"NetworkMetered", {PERSISTENT, BOOL}}, {"ObdMultiplexingChanged", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"ObdMultiplexingEnabled", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"Offroad_CarUnrecognized", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, JSON}}, @@ -114,26 +115,26 @@ inline static std::unordered_map keys = { {"Offroad_UnregisteredHardware", {CLEAR_ON_MANAGER_START, JSON}}, {"Offroad_UpdateFailed", {CLEAR_ON_MANAGER_START, JSON}}, {"OnroadCycleRequested", {CLEAR_ON_MANAGER_START, BOOL}}, - {"OpenpilotEnabledToggle", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, + {"OpenpilotEnabledToggle", {PERSISTENT, BOOL, "1"}}, {"PandaHeartbeatLost", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL}}, {"PandaSomResetTriggered", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL}}, {"PandaSignatures", {CLEAR_ON_MANAGER_START, BYTES}}, {"PrimeType", {PERSISTENT, INT}}, - {"RecordAudio", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"RecordAudioFeedback", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"DashcamEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"RecordFront", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"RecordAudio", {PERSISTENT, BOOL}}, + {"RecordAudioFeedback", {PERSISTENT, BOOL, "0"}}, + {"DashcamEnabled", {PERSISTENT, BOOL, "1"}}, + {"RecordFront", {PERSISTENT, BOOL}}, {"RecordFrontLock", {PERSISTENT, BOOL}}, // for the internal fleet - {"SecOCKey", {PERSISTENT | DONT_LOG | KONN3KT_BACKUP, STRING}}, + {"SecOCKey", {PERSISTENT | DONT_LOG, STRING}}, {"ShowDebugInfo", {PERSISTENT, BOOL}}, {"RouteCount", {PERSISTENT, INT, "0"}}, {"SnoozeUpdate", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL}}, - {"SshEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"SshEnabled", {PERSISTENT, BOOL}}, {"TermsVersion", {PERSISTENT, STRING}}, - {"TorqueBar", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"TorqueBar", {PERSISTENT, BOOL, "0"}}, {"TrainingVersion", {PERSISTENT, STRING}}, {"UbloxAvailable", {PERSISTENT, BOOL}}, - {"UsbStorageEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"UsbStorageEnabled", {PERSISTENT, BOOL}}, {"UpdateAvailable", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"UpdateFailedCount", {CLEAR_ON_MANAGER_START, INT}}, {"UpdaterAvailableBranches", {PERSISTENT, STRING}}, @@ -151,132 +152,132 @@ inline static std::unordered_map keys = { // --- iqpilot params --- // {"ApiCache_DriveStats", {PERSISTENT, JSON}}, - {"AutoLaneChangeBsmDelay", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"AutoLaneChangeTimer", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"NavExitLaneChange", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQBlinkerMinLateralSpeed", {PERSISTENT | KONN3KT_BACKUP, INT, "20"}}, // MPH or km/h - {"IQBlinkerPauseLateral", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"Brightness", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, + {"AutoLaneChangeBsmDelay", {PERSISTENT, BOOL, "0"}}, + {"AutoLaneChangeTimer", {PERSISTENT, INT, "0"}}, + {"NavExitLaneChange", {PERSISTENT, BOOL, "0"}}, + {"IQBlinkerMinLateralSpeed", {PERSISTENT, INT, "20"}}, // MPH or km/h + {"IQBlinkerPauseLateral", {PERSISTENT, INT, "0"}}, + {"Brightness", {PERSISTENT, INT, "0"}}, {"CarList", {PERSISTENT, JSON}}, {"IQCarParams", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BYTES}}, {"IQCarParamsCache", {CLEAR_ON_MANAGER_START, BYTES}}, {"IQCarParamsPersistent", {PERSISTENT, BYTES}}, {"IQCarParamsPersistentV2", {PERSISTENT, BYTES}}, - {"CarPlatformBundle", {PERSISTENT | KONN3KT_BACKUP, JSON}}, - {"ChevronInfo", {PERSISTENT | KONN3KT_BACKUP, INT, "4"}}, - {"DeviceBootMode", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"IQDevUIInfo", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"EnableEsimProvisioning", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"GreenLightAlert", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"InteractivityTimeout", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, + {"CarPlatformBundle", {PERSISTENT, JSON}}, + {"ChevronInfo", {PERSISTENT, INT, "4"}}, + {"DeviceBootMode", {PERSISTENT, INT, "0"}}, + {"IQDevUIInfo", {PERSISTENT, INT, "0"}}, + {"EnableEsimProvisioning", {PERSISTENT, BOOL, "1"}}, + {"GreenLightAlert", {PERSISTENT, BOOL, "0"}}, + {"InteractivityTimeout", {PERSISTENT, INT, "0"}}, {"IsDevelopmentBranch", {CLEAR_ON_MANAGER_START, BOOL}}, {"IsReleaseIqBranch", {CLEAR_ON_MANAGER_START, BOOL}}, {"LastGPSPositionIQLoc", {PERSISTENT, STRING}}, - {"LeadDepartAlert", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"LongIncrementsEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"LongIncrementTapStep", {PERSISTENT | KONN3KT_BACKUP, INT, "1"}}, - {"LongIncrementHoldStep", {PERSISTENT | KONN3KT_BACKUP, INT, "5"}}, - {"IQE2ESetSpeedMode", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"IQE2ESetSpeedUseCurrent", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQE2ESetSpeedMph", {PERSISTENT | KONN3KT_BACKUP, INT, "65"}}, - {"MaxTimeOffroad", {PERSISTENT | KONN3KT_BACKUP, INT, "1800"}}, - {"NightMode", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"newLeadMpc", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, + {"LeadDepartAlert", {PERSISTENT, BOOL, "0"}}, + {"LongIncrementsEnabled", {PERSISTENT, BOOL, "0"}}, + {"LongIncrementTapStep", {PERSISTENT, INT, "1"}}, + {"LongIncrementHoldStep", {PERSISTENT, INT, "5"}}, + {"IQE2ESetSpeedMode", {PERSISTENT, INT, "0"}}, + {"IQE2ESetSpeedUseCurrent", {PERSISTENT, BOOL, "0"}}, + {"IQE2ESetSpeedMph", {PERSISTENT, INT, "65"}}, + {"MaxTimeOffroad", {PERSISTENT, INT, "1800"}}, + {"NightMode", {PERSISTENT, BOOL, "0"}}, + {"newLeadMpc", {PERSISTENT, BOOL, "1"}}, {"ModelRunnerTypeCache", {CLEAR_ON_ONROAD_TRANSITION, INT}}, {"ForceOnroadUntil", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, INT, "0"}}, {"OffroadMode", {CLEAR_ON_MANAGER_START, BOOL}}, {"Offroad_TiciSupport", {CLEAR_ON_MANAGER_START, JSON}}, - {"OnroadScreenOffBrightness", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"OnroadScreenOffTimer", {PERSISTENT | KONN3KT_BACKUP, INT, "15"}}, - {"OnScreenNavigation", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OnlineOSMaps", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"OfflineOSMaps", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OSMapsStyleMode", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"OSMapsHeadingUp", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, + {"OnroadScreenOffBrightness", {PERSISTENT, INT, "0"}}, + {"OnroadScreenOffTimer", {PERSISTENT, INT, "15"}}, + {"OnScreenNavigation", {PERSISTENT, BOOL, "0"}}, + {"OnlineOSMaps", {PERSISTENT, BOOL, "1"}}, + {"OfflineOSMaps", {PERSISTENT, BOOL, "0"}}, + {"OSMapsStyleMode", {PERSISTENT, INT, "0"}}, + {"OSMapsHeadingUp", {PERSISTENT, BOOL, "1"}}, {"OfflineTilesBaseUrl", {PERSISTENT, STRING}}, - {"OnroadUploads", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQAlertSilence", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"RainbowMode", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"RocketFuel", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ShowTurnSignals", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"StandstillTimer", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"OnroadUploads", {PERSISTENT, BOOL, "1"}}, + {"IQAlertSilence", {PERSISTENT, BOOL, "0"}}, + {"RainbowMode", {PERSISTENT, BOOL, "0"}}, + {"RocketFuel", {PERSISTENT, BOOL, "0"}}, + {"ShowTurnSignals", {PERSISTENT, BOOL, "0"}}, + {"StandstillTimer", {PERSISTENT, BOOL, "0"}}, // AOL (Always On Lateral) params - {"AolEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"AolMainCruiseAllowed", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"AolSteeringMode", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"AolUnifiedEngagementMode", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, + {"AolEnabled", {PERSISTENT, BOOL, "1"}}, + {"AolMainCruiseAllowed", {PERSISTENT, BOOL, "1"}}, + {"AolSteeringMode", {PERSISTENT, INT, "0"}}, + {"AolUnifiedEngagementMode", {PERSISTENT, BOOL, "1"}}, // Model Manager params {"ModelManager_ActiveBundle", {PERSISTENT, JSON}}, {"ModelManager_ClearCache", {CLEAR_ON_MANAGER_START, BOOL}}, {"ModelManager_DownloadIndex", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, INT, "-1"}}, - {"ModelManager_Favs", {PERSISTENT | KONN3KT_BACKUP, STRING}}, + {"ModelManager_Favs", {PERSISTENT, STRING}}, {"ModelManager_LastSyncTime", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, INT, "0"}}, - {"ModelManager_ModelsCache", {PERSISTENT | KONN3KT_BACKUP, JSON}}, + {"ModelManager_ModelsCache", {PERSISTENT, JSON}}, // Neural Network Feed Forward - {"NeuralNetworkFeedForward", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"NeuralNetworkFeedForward", {PERSISTENT, BOOL, "0"}}, // Backup Manager params {"BackupManager_CreateBackup", {PERSISTENT, BOOL}}, {"BackupManager_RestoreVersion", {PERSISTENT, STRING}}, // iqpilot car specific params - {"HyundaiLongitudinalTuning", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"SubaruStopAndGo", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SubaruStopAndGoManualParkingBrake", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"TeslaCoopSteering", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ToyotaEnforceStockLongitudinal", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"HyundaiLongitudinalTuning", {PERSISTENT, INT, "0"}}, + {"SubaruStopAndGo", {PERSISTENT, BOOL, "0"}}, + {"SubaruStopAndGoManualParkingBrake", {PERSISTENT, BOOL, "0"}}, + {"TeslaCoopSteering", {PERSISTENT, BOOL, "0"}}, + {"ToyotaEnforceStockLongitudinal", {PERSISTENT, BOOL, "0"}}, {"VwPqEpsPatched", {PERSISTENT, BOOL}}, - {"ToyotaSnGHack", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"pqhca5or7Toggle", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"iqMqbAccResume", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"iqMqbSteeringLockout", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"AllowLateralWhenLongUnavailable", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"ToyotaSnGHack", {PERSISTENT, BOOL, "0"}}, + {"pqhca5or7Toggle", {PERSISTENT, BOOL}}, + {"iqMqbAccResume", {PERSISTENT, BOOL, "0"}}, + {"iqMqbSteeringLockout", {PERSISTENT, BOOL, "0"}}, + {"AllowLateralWhenLongUnavailable", {PERSISTENT, BOOL}}, - {"IQDynamicMode", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQDynamicBlendStockRadar", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQDynamicConditionalCurves", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQDynamicConditionalSlowerLead", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQDynamicConditionalStoppedLead", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQDynamicConditionalModelStops", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQDynamicConditionalSLCFallback", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQDynamicConditionalSpeed", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "18.0"}}, - {"IQDynamicConditionalLeadSpeed", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "24.0"}}, - {"IQDynamicModelStopTime", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "3.0"}}, - {"IQDynamicMinimumForceStopLength", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0.0"}}, - {"IQForceStops", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"IQCustomStopDistance", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, // meters, -2..2; negative = stop closer, positive = stop further back; independent of IQForceStops - {"BlindSpot", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQExpandedStatus", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"IQDynamicMode", {PERSISTENT, BOOL, "0"}}, + {"IQDynamicBlendStockRadar", {PERSISTENT, BOOL, "0"}}, + {"IQDynamicConditionalCurves", {PERSISTENT, BOOL, "1"}}, + {"IQDynamicConditionalSlowerLead", {PERSISTENT, BOOL, "1"}}, + {"IQDynamicConditionalStoppedLead", {PERSISTENT, BOOL, "1"}}, + {"IQDynamicConditionalModelStops", {PERSISTENT, BOOL, "1"}}, + {"IQDynamicConditionalSLCFallback", {PERSISTENT, BOOL, "1"}}, + {"IQDynamicConditionalSpeed", {PERSISTENT, FLOAT, "18.0"}}, + {"IQDynamicConditionalLeadSpeed", {PERSISTENT, FLOAT, "24.0"}}, + {"IQDynamicModelStopTime", {PERSISTENT, FLOAT, "3.0"}}, + {"IQDynamicMinimumForceStopLength", {PERSISTENT, FLOAT, "0.0"}}, + {"IQForceStops", {PERSISTENT, BOOL, "1"}}, + {"IQCustomStopDistance", {PERSISTENT, INT, "0"}}, // meters, -2..2; negative = stop closer, positive = stop further back; independent of IQForceStops + {"BlindSpot", {PERSISTENT, BOOL, "0"}}, + {"IQExpandedStatus", {PERSISTENT, BOOL, "0"}}, {"HomePanelWidget", {PERSISTENT, STRING, "changelog"}}, // iqpilot model params - {"CameraOffset", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0.0"}}, - {"LagdToggle", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"LagdToggleDelay", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0.2"}}, + {"CameraOffset", {PERSISTENT, FLOAT, "0.0"}}, + {"LagdToggle", {PERSISTENT, BOOL, "1"}}, + {"LagdToggleDelay", {PERSISTENT, FLOAT, "0.2"}}, {"LagdValueCache", {PERSISTENT, FLOAT, "0.2"}}, - {"LaneChangeBsd", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, // -1 ignore BSD, 0 default, 1 block lane change on BSD - {"LaneChangeContinuous", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, // 0 one-shot per blinker, 1 chain on held blinker (torque-gated) - {"LaneChangeDelay", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0.0"}}, // tenths of a second; scaled by 0.1 in desire_helper - {"LaneChangeNeedTorque", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, // <0 disable blinker LC, 0 default, >0 require torque - {"IQLaneTurnDesire", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQLaneTurnValue", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "19.0"}}, - {"PlanplusControl", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "1.0"}}, + {"LaneChangeBsd", {PERSISTENT, INT, "0"}}, // -1 ignore BSD, 0 default, 1 block lane change on BSD + {"LaneChangeContinuous", {PERSISTENT, BOOL, "0"}}, // 0 one-shot per blinker, 1 chain on held blinker (torque-gated) + {"LaneChangeDelay", {PERSISTENT, FLOAT, "0.0"}}, // tenths of a second; scaled by 0.1 in desire_helper + {"LaneChangeNeedTorque", {PERSISTENT, INT, "0"}}, // <0 disable blinker LC, 0 default, >0 require torque + {"IQLaneTurnDesire", {PERSISTENT, BOOL, "0"}}, + {"IQLaneTurnValue", {PERSISTENT, FLOAT, "19.0"}}, + {"PlanplusControl", {PERSISTENT, FLOAT, "1.0"}}, {"LatSmoothSec", {PERSISTENT, INT, "13"}}, - {"ModelSmoothingEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ModelLatSmoothSec", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, + {"ModelSmoothingEnabled", {PERSISTENT, BOOL, "0"}}, + {"ModelLatSmoothSec", {PERSISTENT, INT, "0"}}, // IQ.Pilot Parameters: - {"ShowBSMIndicators", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ShowSteeringArc", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ShowRoadName", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ShowRealTimeAcceleration", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"ShowBSMIndicators", {PERSISTENT, BOOL, "0"}}, + {"ShowSteeringArc", {PERSISTENT, BOOL, "0"}}, + {"ShowRoadName", {PERSISTENT, BOOL, "0"}}, + {"ShowRealTimeAcceleration", {PERSISTENT, BOOL, "0"}}, {"ForceSmallUI", {PERSISTENT, BOOL, "0"}}, - {"DeveloperUI", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OBrightness", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OBrightnessManual", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OBrightnessDelay", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"DeveloperUI", {PERSISTENT, BOOL, "0"}}, + {"OBrightness", {PERSISTENT, BOOL, "0"}}, + {"OBrightnessManual", {PERSISTENT, BOOL, "0"}}, + {"OBrightnessDelay", {PERSISTENT, BOOL, "0"}}, {"MapAdvisorySpeedLimit", {CLEAR_ON_ONROAD_TRANSITION, FLOAT}}, {"MapdVersion", {PERSISTENT, STRING}}, {"MapdSettings", {PERSISTENT, JSON}}, // pfeiferj/mapd v2 persistent settings (read/written by the mapd binary) @@ -290,10 +291,10 @@ inline static std::unordered_map keys = { {"AthenaNavigationRoute", {CLEAR_ON_MANAGER_START, JSON}}, {"NavigationActive", {CLEAR_ON_MANAGER_START, BOOL, "0"}}, {"NavigationDestination", {CLEAR_ON_MANAGER_START, JSON}}, - {"NavigationEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"NavigationDebugFlags", {PERSISTENT | KONN3KT_BACKUP, JSON}}, + {"NavigationEnabled", {PERSISTENT, BOOL, "0"}}, + {"NavigationDebugFlags", {PERSISTENT, JSON}}, {"NavigationManeuvers", {CLEAR_ON_MANAGER_START, JSON}}, - {"NavigationPreferences", {PERSISTENT | KONN3KT_BACKUP, JSON}}, + {"NavigationPreferences", {PERSISTENT, JSON}}, {"NavigationRenderRoute", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, JSON}}, {"NavigationRecalculateRoutes", {CLEAR_ON_MANAGER_START, BOOL, "0"}}, {"NavigationRouteAlternatives", {CLEAR_ON_MANAGER_START, JSON}}, @@ -311,37 +312,37 @@ inline static std::unordered_map keys = { {"OsmStateNames", {PERSISTENT, JSON}}, {"OsmWayTest", {PERSISTENT, STRING}}, {"RoadName", {CLEAR_ON_ONROAD_TRANSITION, STRING}}, - {"RoadNameToggle", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"IQSpeedAssistMode", {PERSISTENT | KONN3KT_BACKUP, INT, "1"}}, - {"IQSpeedAssistOffsetType", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"IQSpeedAssistPolicy", {PERSISTENT | KONN3KT_BACKUP, INT, "3"}}, - {"IQSpeedAssistValueOffset", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"SpeedLimitController", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ConstructionZoneAssist", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"VisionVehicleTracks", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"AmbientTrackDots", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"ConstructionZoneSpeed", {PERSISTENT | KONN3KT_BACKUP, INT, "60"}}, - {"ShowSpeedLimits", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SLCPolicy", {PERSISTENT | KONN3KT_BACKUP, INT, "1"}}, - {"SLCAutoConfirm", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SLCSetSpeedToLimit", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"speed_limit_offset1", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"speed_limit_offset2", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"speed_limit_offset3", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"speed_limit_offset4", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"speed_limit_offset5", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"speed_limit_offset6", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"speed_limit_offset7", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "0"}}, - {"SpeedLimitConfirmationHigher", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"SpeedLimitConfirmationLower", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"MapSpeedLookaheadHigher", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "5.0"}}, - {"MapSpeedLookaheadLower", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "5.0"}}, - {"SLCFallbackExperimentalMode", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SLCFallbackSetSpeed", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SLCFallbackPreviousSpeedLimit", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"SLCOverrideMethod", {PERSISTENT | KONN3KT_BACKUP, INT, "0"}}, - {"SLCOnlineFiller", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SLCDataCollection", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"RoadNameToggle", {PERSISTENT, BOOL, "0"}}, + {"IQSpeedAssistMode", {PERSISTENT, INT, "1"}}, + {"IQSpeedAssistOffsetType", {PERSISTENT, INT, "0"}}, + {"IQSpeedAssistPolicy", {PERSISTENT, INT, "3"}}, + {"IQSpeedAssistValueOffset", {PERSISTENT, INT, "0"}}, + {"SpeedLimitController", {PERSISTENT, BOOL, "0"}}, + {"ConstructionZoneAssist", {PERSISTENT, BOOL, "0"}}, + {"VisionVehicleTracks", {PERSISTENT, BOOL, "0"}}, + {"AmbientTrackDots", {PERSISTENT, BOOL, "1"}}, + {"ConstructionZoneSpeed", {PERSISTENT, INT, "60"}}, + {"ShowSpeedLimits", {PERSISTENT, BOOL, "0"}}, + {"SLCPolicy", {PERSISTENT, INT, "1"}}, + {"SLCAutoConfirm", {PERSISTENT, BOOL, "0"}}, + {"SLCSetSpeedToLimit", {PERSISTENT, BOOL, "0"}}, + {"speed_limit_offset1", {PERSISTENT, FLOAT, "0"}}, + {"speed_limit_offset2", {PERSISTENT, FLOAT, "0"}}, + {"speed_limit_offset3", {PERSISTENT, FLOAT, "0"}}, + {"speed_limit_offset4", {PERSISTENT, FLOAT, "0"}}, + {"speed_limit_offset5", {PERSISTENT, FLOAT, "0"}}, + {"speed_limit_offset6", {PERSISTENT, FLOAT, "0"}}, + {"speed_limit_offset7", {PERSISTENT, FLOAT, "0"}}, + {"SpeedLimitConfirmationHigher", {PERSISTENT, BOOL, "1"}}, + {"SpeedLimitConfirmationLower", {PERSISTENT, BOOL, "0"}}, + {"MapSpeedLookaheadHigher", {PERSISTENT, FLOAT, "5.0"}}, + {"MapSpeedLookaheadLower", {PERSISTENT, FLOAT, "5.0"}}, + {"SLCFallbackExperimentalMode", {PERSISTENT, BOOL, "0"}}, + {"SLCFallbackSetSpeed", {PERSISTENT, BOOL, "0"}}, + {"SLCFallbackPreviousSpeedLimit", {PERSISTENT, BOOL, "1"}}, + {"SLCOverrideMethod", {PERSISTENT, INT, "0"}}, + {"SLCOnlineFiller", {PERSISTENT, BOOL, "0"}}, + {"SLCDataCollection", {PERSISTENT, BOOL, "0"}}, {"MapBoxRequests", {PERSISTENT, JSON}}, {"OverpassRequests", {PERSISTENT, JSON}}, {"SpeedLimits", {PERSISTENT, JSON}}, @@ -350,37 +351,37 @@ inline static std::unordered_map keys = { {"UpdateSpeedLimits", {CLEAR_ON_IGNITION_ON}}, {"UpdateSpeedLimitsStatus", {CLEAR_ON_IGNITION_ON, STRING}}, {"SLCMapboxSpeedLimit", {CLEAR_ON_ONROAD_TRANSITION, FLOAT, "0"}}, - {"NavigateOnIQPilot", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"NavOnlineTargets", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"NavOfflineFallback", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"NavPreferOfflineSources", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OfflineRoutingEnabled", {PERSISTENT | KONN3KT_BACKUP, BOOL, "1"}}, - {"OfflineRoutingOnly", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"OfflineRoutingHost", {PERSISTENT | KONN3KT_BACKUP, STRING, "http://127.0.0.1:8002"}}, - {"pqhca5or7Toggle", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"AllowLateralWhenLongUnavailable", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"EnableCurvatureController", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"EnableSpeedLimitControl", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"MapCurveSpeedController", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"VisionCurveSpeedController", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SpeedCameraAlerts", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"RedLightCameraAlerts", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"FlockCameraAlerts", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SpeedCameraSlowdown", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"SpeedCameraSafetyFactor", {PERSISTENT | KONN3KT_BACKUP, FLOAT, "1.0"}}, + {"NavigateOnIQPilot", {PERSISTENT, BOOL, "1"}}, + {"NavOnlineTargets", {PERSISTENT, BOOL, "1"}}, + {"NavOfflineFallback", {PERSISTENT, BOOL, "1"}}, + {"NavPreferOfflineSources", {PERSISTENT, BOOL, "0"}}, + {"OfflineRoutingEnabled", {PERSISTENT, BOOL, "1"}}, + {"OfflineRoutingOnly", {PERSISTENT, BOOL, "0"}}, + {"OfflineRoutingHost", {PERSISTENT, STRING, "http://127.0.0.1:8002"}}, + {"pqhca5or7Toggle", {PERSISTENT, BOOL}}, + {"AllowLateralWhenLongUnavailable", {PERSISTENT, BOOL}}, + {"EnableCurvatureController", {PERSISTENT, BOOL, "0"}}, + {"EnableSpeedLimitControl", {PERSISTENT, BOOL, "0"}}, + {"MapCurveSpeedController", {PERSISTENT, BOOL, "0"}}, + {"VisionCurveSpeedController", {PERSISTENT, BOOL, "0"}}, + {"SpeedCameraAlerts", {PERSISTENT, BOOL, "0"}}, + {"RedLightCameraAlerts", {PERSISTENT, BOOL, "0"}}, + {"FlockCameraAlerts", {PERSISTENT, BOOL, "0"}}, + {"SpeedCameraSlowdown", {PERSISTENT, BOOL, "0"}}, + {"SpeedCameraSafetyFactor", {PERSISTENT, FLOAT, "1.0"}}, {"NavCamerasData", {PERSISTENT, JSON}}, - {"EnableLongComfortMode", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"EnableSpeedLimitPredicative", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"EnableSLPredReactToSL", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"EnableSLPredReactToCurves", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, - {"ForceRHDForBSM", {PERSISTENT | KONN3KT_BACKUP, BOOL, "0"}}, + {"EnableLongComfortMode", {PERSISTENT, BOOL, "0"}}, + {"EnableSpeedLimitPredicative", {PERSISTENT, BOOL, "0"}}, + {"EnableSLPredReactToSL", {PERSISTENT, BOOL, "0"}}, + {"EnableSLPredReactToCurves", {PERSISTENT, BOOL, "0"}}, + {"ForceRHDForBSM", {PERSISTENT, BOOL, "0"}}, {"NavDestination", {PERSISTENT, STRING}}, - {"eBrakeActive", {CLEAR_ON_MANAGER_START | KONN3KT_BACKUP, BOOL, "0"}}, - {"Konn3ktAllowOffroadExternalCanTx", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"MapboxToken", {PERSISTENT | KONN3KT_BACKUP, STRING}}, - {"MapboxTokenQRCode", {PERSISTENT | KONN3KT_BACKUP, JSON}}, - {"TomTomToken", {PERSISTENT | KONN3KT_BACKUP, STRING}}, - {"UIAccentColor", {PERSISTENT | KONN3KT_BACKUP, STRING, "#00FFF5"}}, - {"AngleLateralControl", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, - {"ALCTorqueBlend", {PERSISTENT | KONN3KT_BACKUP, BOOL}}, + {"eBrakeActive", {CLEAR_ON_MANAGER_START, BOOL, "0"}}, + {"Konn3ktAllowOffroadExternalCanTx", {PERSISTENT, BOOL}}, + {"MapboxToken", {PERSISTENT, STRING}}, + {"MapboxTokenQRCode", {PERSISTENT, JSON}}, + {"TomTomToken", {PERSISTENT, STRING}}, + {"UIAccentColor", {PERSISTENT, STRING, "#00FFF5"}}, + {"AngleLateralControl", {PERSISTENT, BOOL}}, + {"ALCTorqueBlend", {PERSISTENT, BOOL}}, }; diff --git a/common/params_pyx.pyx b/common/params_pyx.pyx index 783cb3f..636ad44 100644 --- a/common/params_pyx.pyx +++ b/common/params_pyx.pyx @@ -18,7 +18,6 @@ cdef extern from "common/params.h": CLEAR_ON_OFFROAD_TRANSITION DEVELOPMENT_ONLY CLEAR_ON_IGNITION_ON - KONN3KT_BACKUP ALL cpdef enum ParamKeyType: @@ -44,7 +43,7 @@ cdef extern from "common/params.h": optional[string] getKeyDefaultValue(string) nogil string getParamPath(string) nogil void clearAll(ParamKeyFlag) - vector[string] allKeys(ParamKeyFlag) + vector[string] allKeys() PYTHON_2_CPP = { (str, STRING): lambda v: v, @@ -182,8 +181,8 @@ cdef class Params: def get_type(self, key): return self.p.getKeyType(self.check_key(key)) - def all_keys(self, flag=ParamKeyFlag.ALL): - return self.p.allKeys(flag) + def all_keys(self): + return self.p.allKeys() def get_default_value(self, key): cdef string k = self.check_key(key) diff --git a/iqdbc b/iqdbc new file mode 120000 index 0000000..7baddc7 --- /dev/null +++ b/iqdbc @@ -0,0 +1 @@ +iqdbc_repo/iqdbc \ No newline at end of file diff --git a/opendbc_repo/.codespellignore b/iqdbc_repo/.codespellignore similarity index 100% rename from opendbc_repo/.codespellignore rename to iqdbc_repo/.codespellignore diff --git a/opendbc_repo/.gitignore b/iqdbc_repo/.gitignore similarity index 62% rename from opendbc_repo/.gitignore rename to iqdbc_repo/.gitignore index 7571ddf..0f5ebf6 100644 --- a/opendbc_repo/.gitignore +++ b/iqdbc_repo/.gitignore @@ -23,13 +23,13 @@ __pycache__/ mull.yml *.profraw -opendbc/can/build/ -opendbc/can/obj/ -opendbc/dbc/*_generated.dbc +iqdbc/can/build/ +iqdbc/can/obj/ +iqdbc/dbc/*_generated.dbc cppcheck-addon-ctu-file-list -opendbc/safety/tests/coverage-out +iqdbc/safety/tests/coverage-out compile_commands.json .mull/ -/opendbc/car/volkswagen/tests/test_mqb_iq_alc_state.py +/iqdbc/car/volkswagen/tests/test_mqb_iq_alc_state.py diff --git a/opendbc_repo/LICENSE b/iqdbc_repo/LICENSE similarity index 100% rename from opendbc_repo/LICENSE rename to iqdbc_repo/LICENSE diff --git a/opendbc_repo/LICENSE.md b/iqdbc_repo/LICENSE.md similarity index 100% rename from opendbc_repo/LICENSE.md rename to iqdbc_repo/LICENSE.md diff --git a/iqdbc_repo/MANIFEST.in b/iqdbc_repo/MANIFEST.in new file mode 100644 index 0000000..aae73e4 --- /dev/null +++ b/iqdbc_repo/MANIFEST.in @@ -0,0 +1,3 @@ +include iqdbc/car/car.capnp +include iqdbc/car/include/c++.capnp +recursive-include iqdbc/safety *.h diff --git a/iqdbc_repo/SConscript b/iqdbc_repo/SConscript new file mode 100644 index 0000000..c40f56b --- /dev/null +++ b/iqdbc_repo/SConscript @@ -0,0 +1,5 @@ +SConscript(['iqdbc/dbc/SConscript']) + +# test files +if GetOption('extras'): + SConscript('iqdbc/safety/tests/libsafety/SConscript') diff --git a/opendbc_repo/SConstruct b/iqdbc_repo/SConstruct similarity index 100% rename from opendbc_repo/SConstruct rename to iqdbc_repo/SConstruct diff --git a/opendbc_repo/conftest.py b/iqdbc_repo/conftest.py similarity index 94% rename from opendbc_repo/conftest.py rename to iqdbc_repo/conftest.py index f5f6b78..4b01283 100644 --- a/opendbc_repo/conftest.py +++ b/iqdbc_repo/conftest.py @@ -1,7 +1,7 @@ # pytest attempts to execute shell scripts while collecting collect_ignore_glob = [ - "opendbc/safety/tests/misra/*.sh", - "opendbc/safety/tests/misra/cppcheck/", + "iqdbc/safety/tests/misra/*.sh", + "iqdbc/safety/tests/misra/cppcheck/", ] _ABSTRACT_BASES = frozenset(("CarSafetyTest", "AolSafetyTestBase", "SafetyTest", "SafetyTestBase")) diff --git a/opendbc_repo/docs/CARS.md b/iqdbc_repo/docs/CARS.md similarity index 99% rename from opendbc_repo/docs/CARS.md rename to iqdbc_repo/docs/CARS.md index 7604419..534c98a 100644 --- a/opendbc_repo/docs/CARS.md +++ b/iqdbc_repo/docs/CARS.md @@ -417,7 +417,7 @@ # Types of Support -**opendbc can support many more cars than it currently does.** There are a few reasons your car may not be supported. +**iqdbc can support many more cars than it currently does.** There are a few reasons your car may not be supported. If your car doesn't fit into any of the incompatibility criteria here, then there's a good chance it can be supported! We're adding support for new cars all the time. **We don't have a roadmap for car support**, and in fact, most car support comes from users like you! diff --git a/opendbc_repo/examples/joystick.py b/iqdbc_repo/examples/joystick.py similarity index 97% rename from opendbc_repo/examples/joystick.py rename to iqdbc_repo/examples/joystick.py index 2b80b34..ed989cf 100755 --- a/opendbc_repo/examples/joystick.py +++ b/iqdbc_repo/examples/joystick.py @@ -8,8 +8,8 @@ from inputs import get_gamepad from kbhit import KBHit -from opendbc.car.structs import CarControl -from opendbc.car.panda_runner import PandaRunner +from iqdbc.car.structs import CarControl +from iqdbc.car.panda_runner import PandaRunner class Keyboard: diff --git a/opendbc_repo/examples/kbhit.py b/iqdbc_repo/examples/kbhit.py similarity index 100% rename from opendbc_repo/examples/kbhit.py rename to iqdbc_repo/examples/kbhit.py diff --git a/opendbc_repo/opendbc/__init__.py b/iqdbc_repo/iqdbc/__init__.py similarity index 74% rename from opendbc_repo/opendbc/__init__.py rename to iqdbc_repo/iqdbc/__init__.py index 9f4ee65..fcee772 100644 --- a/opendbc_repo/opendbc/__init__.py +++ b/iqdbc_repo/iqdbc/__init__.py @@ -2,5 +2,5 @@ import os DBC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dbc') -# -I include path for e.g. "#include " +# -I include path for e.g. "#include " INCLUDE_PATH = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../")) diff --git a/iqdbc_repo/iqdbc/can/__init__.py b/iqdbc_repo/iqdbc/can/__init__.py new file mode 100644 index 0000000..f4f57dd --- /dev/null +++ b/iqdbc_repo/iqdbc/can/__init__.py @@ -0,0 +1,8 @@ +from iqdbc.can.packer import CANPacker +from iqdbc.can.parser import CANParser, CANDefine + +__all__ = [ + "CANDefine", + "CANParser", + "CANPacker", +] diff --git a/opendbc_repo/opendbc/can/dbc.py b/iqdbc_repo/iqdbc/can/dbc.py similarity index 91% rename from opendbc_repo/opendbc/can/dbc.py rename to iqdbc_repo/iqdbc/can/dbc.py index 0c274c5..d924dc3 100644 --- a/opendbc_repo/opendbc/can/dbc.py +++ b/iqdbc_repo/iqdbc/can/dbc.py @@ -4,19 +4,19 @@ from collections.abc import Callable from dataclasses import dataclass from functools import cache -from opendbc import DBC_PATH +from iqdbc import DBC_PATH # TODO: these should just be passed in along with the DBC file -from opendbc.car.honda.hondacan import honda_checksum -from opendbc.car.toyota.toyotacan import toyota_checksum -from opendbc.car.subaru.subarucan import subaru_checksum -from opendbc.car.chrysler.chryslercan import chrysler_checksum, fca_giorgio_checksum -from opendbc.car.hyundai.hyundaicanfd import hkg_can_fd_checksum -from opendbc.car.volkswagen.mlbcan import volkswagen_mlb_checksum -from opendbc.car.volkswagen.mqbcan import volkswagen_mqb_meb_checksum, volkswagen_mqb_meb_gen2_checksum, xor_checksum -from opendbc.car.tesla.teslacan import tesla_checksum -from opendbc.car.body.bodycan import body_checksum -from opendbc.car.psa.psacan import psa_checksum +from iqdbc.car.honda.hondacan import honda_checksum +from iqdbc.car.toyota.toyotacan import toyota_checksum +from iqdbc.car.subaru.subarucan import subaru_checksum +from iqdbc.car.chrysler.chryslercan import chrysler_checksum, fca_giorgio_checksum +from iqdbc.car.hyundai.hyundaicanfd import hkg_can_fd_checksum +from iqdbc.car.volkswagen.mlbcan import volkswagen_mlb_checksum +from iqdbc.car.volkswagen.mqbcan import volkswagen_mqb_meb_checksum, volkswagen_mqb_meb_gen2_checksum, xor_checksum +from iqdbc.car.tesla.teslacan import tesla_checksum +from iqdbc.car.body.bodycan import body_checksum +from iqdbc.car.psa.psacan import psa_checksum class SignalType: diff --git a/opendbc_repo/opendbc/can/packer.py b/iqdbc_repo/iqdbc/can/packer.py similarity index 96% rename from opendbc_repo/opendbc/can/packer.py rename to iqdbc_repo/iqdbc/can/packer.py index efc1c81..8b716b6 100644 --- a/opendbc_repo/opendbc/can/packer.py +++ b/iqdbc_repo/iqdbc/can/packer.py @@ -1,7 +1,7 @@ import math -from opendbc.car.carlog import carlog -from opendbc.can.dbc import DBC, Signal, SignalType +from iqdbc.car.carlog import carlog +from iqdbc.can.dbc import DBC, Signal, SignalType class CANPacker: diff --git a/opendbc_repo/opendbc/can/parser.py b/iqdbc_repo/iqdbc/can/parser.py similarity index 99% rename from opendbc_repo/opendbc/can/parser.py rename to iqdbc_repo/iqdbc/can/parser.py index e5640f4..929c8d6 100644 --- a/opendbc_repo/opendbc/can/parser.py +++ b/iqdbc_repo/iqdbc/can/parser.py @@ -3,8 +3,8 @@ import numbers from collections import defaultdict, deque from dataclasses import dataclass, field -from opendbc.car.carlog import carlog -from opendbc.can.dbc import DBC, Signal +from iqdbc.car.carlog import carlog +from iqdbc.can.dbc import DBC, Signal MAX_BAD_COUNTER = 5 diff --git a/opendbc_repo/opendbc/can/tests/.gitignore b/iqdbc_repo/iqdbc/can/tests/.gitignore similarity index 100% rename from opendbc_repo/opendbc/can/tests/.gitignore rename to iqdbc_repo/iqdbc/can/tests/.gitignore diff --git a/opendbc_repo/opendbc/can/tests/__init__.py b/iqdbc_repo/iqdbc/can/tests/__init__.py similarity index 87% rename from opendbc_repo/opendbc/can/tests/__init__.py rename to iqdbc_repo/iqdbc/can/tests/__init__.py index 3bf02fd..e1a91ca 100644 --- a/opendbc_repo/opendbc/can/tests/__init__.py +++ b/iqdbc_repo/iqdbc/can/tests/__init__.py @@ -1,7 +1,7 @@ import glob import os -from opendbc import DBC_PATH +from iqdbc import DBC_PATH ALL_DBCS = [os.path.basename(dbc).split('.')[0] for dbc in glob.glob(f"{DBC_PATH}/*.dbc")] diff --git a/opendbc_repo/opendbc/can/tests/benchmark.py b/iqdbc_repo/iqdbc/can/tests/benchmark.py similarity index 96% rename from opendbc_repo/opendbc/can/tests/benchmark.py rename to iqdbc_repo/iqdbc/can/tests/benchmark.py index 6652f44..8497421 100755 --- a/opendbc_repo/opendbc/can/tests/benchmark.py +++ b/iqdbc_repo/iqdbc/can/tests/benchmark.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import time -from opendbc.can import CANPacker, CANParser +from iqdbc.can import CANPacker, CANParser def _benchmark(checks, n): diff --git a/opendbc_repo/opendbc/can/tests/test.dbc b/iqdbc_repo/iqdbc/can/tests/test.dbc similarity index 100% rename from opendbc_repo/opendbc/can/tests/test.dbc rename to iqdbc_repo/iqdbc/can/tests/test.dbc diff --git a/opendbc_repo/opendbc/can/tests/test_checksums.py b/iqdbc_repo/iqdbc/can/tests/test_checksums.py similarity index 99% rename from opendbc_repo/opendbc/can/tests/test_checksums.py rename to iqdbc_repo/iqdbc/can/tests/test_checksums.py index a357819..7c3e354 100644 --- a/opendbc_repo/opendbc/can/tests/test_checksums.py +++ b/iqdbc_repo/iqdbc/can/tests/test_checksums.py @@ -1,5 +1,5 @@ import copy -from opendbc.can import CANPacker, CANParser +from iqdbc.can import CANPacker, CANParser class TestCanChecksums: @@ -7,7 +7,7 @@ class TestCanChecksums: def verify_checksum(self, subtests, dbc_file: str, msg_name: str, msg_addr: int, test_messages: list[bytes], checksum_field: str = 'CHECKSUM', counter_field = 'COUNTER'): """ - Verify that opendbc calculates payload CRCs/checksums matching those received in known-good sample messages + Verify that iqdbc calculates payload CRCs/checksums matching those received in known-good sample messages Depends on all non-zero bits in the sample message having a corresponding DBC signal, add UNKNOWN signals if needed """ parser = CANParser(dbc_file, [(msg_name, 0)], 0) @@ -173,7 +173,7 @@ class TestCanChecksums: b'\xbd\xed\xbf\xff\xaa\x20\x20\x10', b'\x67\xee\xbf\xff\xaa\x20\x20\x10', b'\x36\xef\xbf\xff\xaa\x20\x20\x10', - ], counter_field="COUNTER_DISABLED") # see opendbc#1235 + ], counter_field="COUNTER_DISABLED") # see iqdbc#1235 def test_volkswagen_mqb_crc_esp_21(self, subtests): self.verify_volkswagen_mqb_crc(subtests, "ESP_21", 0xFD, [ diff --git a/opendbc_repo/opendbc/can/tests/test_dbc_exceptions.py b/iqdbc_repo/iqdbc/can/tests/test_dbc_exceptions.py similarity index 88% rename from opendbc_repo/opendbc/can/tests/test_dbc_exceptions.py rename to iqdbc_repo/iqdbc/can/tests/test_dbc_exceptions.py index 858a643..1b16fdb 100644 --- a/opendbc_repo/opendbc/can/tests/test_dbc_exceptions.py +++ b/iqdbc_repo/iqdbc/can/tests/test_dbc_exceptions.py @@ -1,7 +1,7 @@ import pytest -from opendbc.can import CANDefine, CANPacker, CANParser -from opendbc.can.tests import TEST_DBC +from iqdbc.can import CANDefine, CANPacker, CANParser +from iqdbc.can.tests import TEST_DBC class TestCanParserPackerExceptions: diff --git a/opendbc_repo/opendbc/can/tests/test_dbc_parser.py b/iqdbc_repo/iqdbc/can/tests/test_dbc_parser.py similarity index 87% rename from opendbc_repo/opendbc/can/tests/test_dbc_parser.py rename to iqdbc_repo/iqdbc/can/tests/test_dbc_parser.py index 508b80b..3e60053 100644 --- a/opendbc_repo/opendbc/can/tests/test_dbc_parser.py +++ b/iqdbc_repo/iqdbc/can/tests/test_dbc_parser.py @@ -1,5 +1,5 @@ -from opendbc.can import CANParser -from opendbc.can.tests import ALL_DBCS +from iqdbc.can import CANParser +from iqdbc.can.tests import ALL_DBCS class TestDBCParser: diff --git a/opendbc_repo/opendbc/can/tests/test_define.py b/iqdbc_repo/iqdbc/can/tests/test_define.py similarity index 91% rename from opendbc_repo/opendbc/can/tests/test_define.py rename to iqdbc_repo/iqdbc/can/tests/test_define.py index 41cfa78..dec8cf5 100644 --- a/opendbc_repo/opendbc/can/tests/test_define.py +++ b/iqdbc_repo/iqdbc/can/tests/test_define.py @@ -1,5 +1,5 @@ -from opendbc.can import CANDefine -from opendbc.can.tests import ALL_DBCS +from iqdbc.can import CANDefine +from iqdbc.can.tests import ALL_DBCS class TestCANDefine: diff --git a/opendbc_repo/opendbc/can/tests/test_packer_parser.py b/iqdbc_repo/iqdbc/can/tests/test_packer_parser.py similarity index 99% rename from opendbc_repo/opendbc/can/tests/test_packer_parser.py rename to iqdbc_repo/iqdbc/can/tests/test_packer_parser.py index 51aa527..d9a63d8 100644 --- a/opendbc_repo/opendbc/can/tests/test_packer_parser.py +++ b/iqdbc_repo/iqdbc/can/tests/test_packer_parser.py @@ -1,8 +1,8 @@ import pytest import random -from opendbc.can import CANPacker, CANParser -from opendbc.can.tests import TEST_DBC +from iqdbc.can import CANPacker, CANParser +from iqdbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 diff --git a/opendbc_repo/opendbc/car/CARS_template.md b/iqdbc_repo/iqdbc/car/CARS_template.md similarity index 92% rename from opendbc_repo/opendbc/car/CARS_template.md rename to iqdbc_repo/iqdbc/car/CARS_template.md index 5b2ac5e..58510e6 100644 --- a/opendbc_repo/opendbc/car/CARS_template.md +++ b/iqdbc_repo/iqdbc/car/CARS_template.md @@ -11,7 +11,7 @@ # Types of Support -**opendbc can support many more cars than it currently does.** There are a few reasons your car may not be supported. +**iqdbc can support many more cars than it currently does.** There are a few reasons your car may not be supported. If your car doesn't fit into any of the incompatibility criteria here, then there's a good chance it can be supported! We're adding support for new cars all the time. **We don't have a roadmap for car support**, and in fact, most car support comes from users like you! @@ -54,9 +54,9 @@ Supported Models' section of each make [on our wiki](https://wiki.comma.ai/). Some notable works-in-progress: * Honda - * 2022-24 Acura RDX, commaai/opendbc#1967 - * Camera ACC stability improvements, commaai/opendbc#2192 - * Alpha longitudinal stability improvements, commaai/opendbc#2347 and commaai/opendbc#2165 + * 2022-24 Acura RDX, commaai/iqdbc#1967 + * Camera ACC stability improvements, commaai/iqdbc#2192 + * Alpha longitudinal stability improvements, commaai/iqdbc#2347 and commaai/iqdbc#2165 ## Incompatible diff --git a/opendbc_repo/opendbc/car/__init__.py b/iqdbc_repo/iqdbc/car/__init__.py similarity index 98% rename from opendbc_repo/opendbc/car/__init__.py rename to iqdbc_repo/iqdbc/car/__init__.py index 3216c18..a77c821 100644 --- a/opendbc_repo/opendbc/car/__init__.py +++ b/iqdbc_repo/iqdbc/car/__init__.py @@ -4,9 +4,9 @@ from dataclasses import dataclass, field from enum import IntFlag, ReprEnum, StrEnum, EnumType, auto from dataclasses import replace -from opendbc.car import structs, uds -from opendbc.car.can_definitions import CanData -from opendbc.car.docs_definitions import CarDocs, ExtraCarDocs +from iqdbc.car import structs, uds +from iqdbc.car.can_definitions import CanData +from iqdbc.car.docs_definitions import CarDocs, ExtraCarDocs DT_CTRL = 0.01 # car state and control loop timestep (s) diff --git a/opendbc_repo/opendbc/car/body/__init__.py b/iqdbc_repo/iqdbc/car/body/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/body/__init__.py rename to iqdbc_repo/iqdbc/car/body/__init__.py diff --git a/opendbc_repo/opendbc/car/body/bodycan.py b/iqdbc_repo/iqdbc/car/body/bodycan.py similarity index 89% rename from opendbc_repo/opendbc/car/body/bodycan.py rename to iqdbc_repo/iqdbc/car/body/bodycan.py index bec099f..2a7ee89 100644 --- a/opendbc_repo/opendbc/car/body/bodycan.py +++ b/iqdbc_repo/iqdbc/car/body/bodycan.py @@ -1,4 +1,4 @@ -from opendbc.car.crc import CRC8BODY +from iqdbc.car.crc import CRC8BODY def create_control(packer, torque_l, torque_r): diff --git a/opendbc_repo/opendbc/car/body/carcontroller.py b/iqdbc_repo/iqdbc/car/body/carcontroller.py similarity index 91% rename from opendbc_repo/opendbc/car/body/carcontroller.py rename to iqdbc_repo/iqdbc/car/body/carcontroller.py index 7daa2a5..7b22202 100644 --- a/opendbc_repo/opendbc/car/body/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/body/carcontroller.py @@ -1,11 +1,11 @@ import numpy as np -from opendbc.can import CANPacker -from opendbc.car import Bus, DT_CTRL -from opendbc.car.common.pid import PIDController -from opendbc.car.body import bodycan -from opendbc.car.body.values import SPEED_FROM_RPM -from opendbc.car.interfaces import CarControllerBase +from iqdbc.can import CANPacker +from iqdbc.car import Bus, DT_CTRL +from iqdbc.car.common.pid import PIDController +from iqdbc.car.body import bodycan +from iqdbc.car.body.values import SPEED_FROM_RPM +from iqdbc.car.interfaces import CarControllerBase MAX_TORQUE = 500 MAX_TORQUE_RATE = 50 diff --git a/opendbc_repo/opendbc/car/body/carstate.py b/iqdbc_repo/iqdbc/car/body/carstate.py similarity index 87% rename from opendbc_repo/opendbc/car/body/carstate.py rename to iqdbc_repo/iqdbc/car/body/carstate.py index 82a4cfe..f929b22 100644 --- a/opendbc_repo/opendbc/car/body/carstate.py +++ b/iqdbc_repo/iqdbc/car/body/carstate.py @@ -1,7 +1,7 @@ -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import CarStateBase -from opendbc.car.body.values import DBC +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.body.values import DBC class CarState(CarStateBase): diff --git a/opendbc_repo/opendbc/car/body/fingerprints.py b/iqdbc_repo/iqdbc/car/body/fingerprints.py similarity index 68% rename from opendbc_repo/opendbc/car/body/fingerprints.py rename to iqdbc_repo/iqdbc/car/body/fingerprints.py index 5806112..a87cb7e 100644 --- a/opendbc_repo/opendbc/car/body/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/body/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.body.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.body.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/body/interface.py b/iqdbc_repo/iqdbc/car/body/interface.py similarity index 74% rename from opendbc_repo/opendbc/car/body/interface.py rename to iqdbc_repo/iqdbc/car/body/interface.py index 24e571e..1510bb0 100644 --- a/opendbc_repo/opendbc/car/body/interface.py +++ b/iqdbc_repo/iqdbc/car/body/interface.py @@ -1,9 +1,9 @@ import math -from opendbc.car import get_safety_config, structs -from opendbc.car.body.carcontroller import CarController -from opendbc.car.body.carstate import CarState -from opendbc.car.body.values import SPEED_FROM_RPM -from opendbc.car.interfaces import CarInterfaceBase +from iqdbc.car import get_safety_config, structs +from iqdbc.car.body.carcontroller import CarController +from iqdbc.car.body.carstate import CarState +from iqdbc.car.body.values import SPEED_FROM_RPM +from iqdbc.car.interfaces import CarInterfaceBase class CarInterface(CarInterfaceBase): diff --git a/opendbc_repo/opendbc/car/body/values.py b/iqdbc_repo/iqdbc/car/body/values.py similarity index 78% rename from opendbc_repo/opendbc/car/body/values.py rename to iqdbc_repo/iqdbc/car/body/values.py index 27490ab..2a410b9 100644 --- a/opendbc_repo/opendbc/car/body/values.py +++ b/iqdbc_repo/iqdbc/car/body/values.py @@ -1,7 +1,7 @@ -from opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarDocs -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car import Bus, CarSpecs, PlatformConfig, Platforms +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarDocs +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/can_definitions.py b/iqdbc_repo/iqdbc/car/can_definitions.py similarity index 100% rename from opendbc_repo/opendbc/car/can_definitions.py rename to iqdbc_repo/iqdbc/car/can_definitions.py diff --git a/opendbc_repo/opendbc/car/car.capnp b/iqdbc_repo/iqdbc/car/car.capnp similarity index 99% rename from opendbc_repo/opendbc/car/car.capnp rename to iqdbc_repo/iqdbc/car/car.capnp index 24d4d18..dce26c1 100644 --- a/opendbc_repo/opendbc/car/car.capnp +++ b/iqdbc_repo/iqdbc/car/car.capnp @@ -486,7 +486,7 @@ struct CarOutput { # ****** car param ****** struct CarParams { - brand @0 :Text; # Designates which group a platform falls under. Each folder in opendbc/car is assigned one brand string + brand @0 :Text; # Designates which group a platform falls under. Each folder in iqdbc/car is assigned one brand string carFingerprint @1 :Text; fuzzyFingerprint @55 :Bool; diff --git a/opendbc_repo/opendbc/car/car_helpers.py b/iqdbc_repo/iqdbc/car/car_helpers.py similarity index 90% rename from opendbc_repo/opendbc/car/car_helpers.py rename to iqdbc_repo/iqdbc/car/car_helpers.py index a51ab6a..4266927 100644 --- a/opendbc_repo/opendbc/car/car_helpers.py +++ b/iqdbc_repo/iqdbc/car/car_helpers.py @@ -1,17 +1,17 @@ import os import time -from opendbc.car import gen_empty_fingerprint -from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable -from opendbc.car.carlog import carlog -from opendbc.car.structs import CarParams, CarParamsT -from opendbc.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars -from opendbc.car.fw_versions import ObdCallback, get_fw_versions_ordered, get_present_ecus, match_fw_to_car -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.values import BRANDS -from opendbc.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN +from iqdbc.car import gen_empty_fingerprint +from iqdbc.car.can_definitions import CanRecvCallable, CanSendCallable +from iqdbc.car.carlog import carlog +from iqdbc.car.structs import CarParams, CarParamsT +from iqdbc.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars +from iqdbc.car.fw_versions import ObdCallback, get_fw_versions_ordered, get_present_ecus, match_fw_to_car +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.values import BRANDS +from iqdbc.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN -from opendbc.iqpilot.car.interfaces import setup_interfaces as iqpilot_interfaces +from iqdbc.iqpilot.car.interfaces import setup_interfaces as iqpilot_interfaces FRAME_FINGERPRINT = 100 # 1s @@ -19,7 +19,7 @@ FRAME_FINGERPRINT = 100 # 1s def load_interfaces(brand_names): ret = {} for brand_name in brand_names: - path = f'opendbc.car.{brand_name}' + path = f'iqdbc.car.{brand_name}' CarInterface = __import__(path + '.interface', fromlist=['CarInterface']).CarInterface for model_name in brand_names[brand_name]: ret[model_name] = CarInterface @@ -36,7 +36,7 @@ def _get_interface_names() -> dict[str, list[str]]: return brand_names -# imports from directory opendbc/car// +# imports from directory iqdbc/car// interface_names = _get_interface_names() interfaces = load_interfaces(interface_names) diff --git a/opendbc_repo/opendbc/car/carlog.py b/iqdbc_repo/iqdbc/car/carlog.py similarity index 100% rename from opendbc_repo/opendbc/car/carlog.py rename to iqdbc_repo/iqdbc/car/carlog.py diff --git a/opendbc_repo/opendbc/car/ccp.py b/iqdbc_repo/iqdbc/car/ccp.py similarity index 100% rename from opendbc_repo/opendbc/car/ccp.py rename to iqdbc_repo/iqdbc/car/ccp.py diff --git a/opendbc_repo/opendbc/car/chrysler/__init__.py b/iqdbc_repo/iqdbc/car/chrysler/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/chrysler/__init__.py rename to iqdbc_repo/iqdbc/car/chrysler/__init__.py diff --git a/opendbc_repo/opendbc/car/chrysler/carcontroller.py b/iqdbc_repo/iqdbc/car/chrysler/carcontroller.py similarity index 87% rename from opendbc_repo/opendbc/car/chrysler/carcontroller.py rename to iqdbc_repo/iqdbc/car/chrysler/carcontroller.py index ee0bfbd..1fcd239 100644 --- a/opendbc_repo/opendbc/car/chrysler/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/chrysler/carcontroller.py @@ -1,13 +1,13 @@ -from opendbc.can import CANPacker -from opendbc.car import Bus, DT_CTRL -from opendbc.car.lateral import apply_meas_steer_torque_limits -from opendbc.car.chrysler import chryslercan -from opendbc.car.chrysler.values import RAM_CARS, CarControllerParams, ChryslerFlags, RAM_DT -from opendbc.car.interfaces import CarControllerBase +from iqdbc.can import CANPacker +from iqdbc.car import Bus, DT_CTRL +from iqdbc.car.lateral import apply_meas_steer_torque_limits +from iqdbc.car.chrysler import chryslercan +from iqdbc.car.chrysler.values import RAM_CARS, CarControllerParams, ChryslerFlags, RAM_DT +from iqdbc.car.interfaces import CarControllerBase -from opendbc.iqpilot.car.chrysler.carcontroller_ext import CarControllerExt -from opendbc.iqpilot.car.chrysler.aol import AolCarController -from opendbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ +from iqdbc.iqpilot.car.chrysler.carcontroller_ext import CarControllerExt +from iqdbc.iqpilot.car.chrysler.aol import AolCarController +from iqdbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ class CarController(CarControllerBase, AolCarController, CarControllerExt): diff --git a/opendbc_repo/opendbc/car/chrysler/carstate.py b/iqdbc_repo/iqdbc/car/chrysler/carstate.py similarity index 91% rename from opendbc_repo/opendbc/car/chrysler/carstate.py rename to iqdbc_repo/iqdbc/car/chrysler/carstate.py index 3084e82..70d4448 100644 --- a/opendbc_repo/opendbc/car/chrysler/carstate.py +++ b/iqdbc_repo/iqdbc/car/chrysler/carstate.py @@ -1,11 +1,11 @@ -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.chrysler.values import DBC, STEER_THRESHOLD, RAM_CARS -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarStateBase +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.chrysler.values import DBC, STEER_THRESHOLD, RAM_CARS +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarStateBase -from opendbc.iqpilot.car.chrysler.carstate_ext import CarStateExt -from opendbc.iqpilot.car.chrysler.aol import AolCarState +from iqdbc.iqpilot.car.chrysler.carstate_ext import CarStateExt +from iqdbc.iqpilot.car.chrysler.aol import AolCarState ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/car/chrysler/chryslercan.py b/iqdbc_repo/iqdbc/car/chrysler/chryslercan.py similarity index 95% rename from opendbc_repo/opendbc/car/chrysler/chryslercan.py rename to iqdbc_repo/iqdbc/car/chrysler/chryslercan.py index d7b8ffc..c317c10 100644 --- a/opendbc_repo/opendbc/car/chrysler/chryslercan.py +++ b/iqdbc_repo/iqdbc/car/chrysler/chryslercan.py @@ -1,6 +1,6 @@ -from opendbc.car import structs -from opendbc.car.crc import CRC8J1850 -from opendbc.car.chrysler.values import RAM_CARS +from iqdbc.car import structs +from iqdbc.car.crc import CRC8J1850 +from iqdbc.car.chrysler.values import RAM_CARS GearShifter = structs.CarState.GearShifter VisualAlert = structs.CarControl.HUDControl.VisualAlert diff --git a/opendbc_repo/opendbc/car/chrysler/fingerprints.py b/iqdbc_repo/iqdbc/car/chrysler/fingerprints.py similarity index 98% rename from opendbc_repo/opendbc/car/chrysler/fingerprints.py rename to iqdbc_repo/iqdbc/car/chrysler/fingerprints.py index 427ad3e..ccfa863 100644 --- a/opendbc_repo/opendbc/car/chrysler/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/chrysler/fingerprints.py @@ -1,9 +1,9 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.chrysler.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.chrysler.values import CAR -from opendbc.iqpilot.car.fingerprints_ext import merge_fw_versions -from opendbc.iqpilot.car.chrysler.fingerprints_ext import FW_VERSIONS_EXT +from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions +from iqdbc.iqpilot.car.chrysler.fingerprints_ext import FW_VERSIONS_EXT Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/chrysler/interface.py b/iqdbc_repo/iqdbc/car/chrysler/interface.py similarity index 90% rename from opendbc_repo/opendbc/car/chrysler/interface.py rename to iqdbc_repo/iqdbc/car/chrysler/interface.py index 91e6624..cde33e3 100755 --- a/opendbc_repo/opendbc/car/chrysler/interface.py +++ b/iqdbc_repo/iqdbc/car/chrysler/interface.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 -from opendbc.car import get_safety_config, structs -from opendbc.car.chrysler.carcontroller import CarController -from opendbc.car.chrysler.carstate import CarState -from opendbc.car.chrysler.radar_interface import RadarInterface -from opendbc.car.chrysler.values import CAR, RAM_HD, RAM_DT, RAM_CARS, ChryslerFlags, ChryslerSafetyFlags -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ +from iqdbc.car import get_safety_config, structs +from iqdbc.car.chrysler.carcontroller import CarController +from iqdbc.car.chrysler.carstate import CarState +from iqdbc.car.chrysler.radar_interface import RadarInterface +from iqdbc.car.chrysler.values import CAR, RAM_HD, RAM_DT, RAM_CARS, ChryslerFlags, ChryslerSafetyFlags +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ class CarInterface(CarInterfaceBase): diff --git a/opendbc_repo/opendbc/car/chrysler/radar_interface.py b/iqdbc_repo/iqdbc/car/chrysler/radar_interface.py similarity index 94% rename from opendbc_repo/opendbc/car/chrysler/radar_interface.py rename to iqdbc_repo/iqdbc/car/chrysler/radar_interface.py index 4307974..b509e84 100755 --- a/opendbc_repo/opendbc/car/chrysler/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/chrysler/radar_interface.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.chrysler.values import DBC +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import RadarInterfaceBase +from iqdbc.car.chrysler.values import DBC RADAR_MSGS_C = list(range(0x2c2, 0x2d4+2, 2)) # c_ messages 706,...,724 RADAR_MSGS_D = list(range(0x2a2, 0x2b4+2, 2)) # d_ messages diff --git a/opendbc_repo/opendbc/car/chrysler/values.py b/iqdbc_repo/iqdbc/car/chrysler/values.py similarity index 94% rename from opendbc_repo/opendbc/car/chrysler/values.py rename to iqdbc_repo/iqdbc/car/chrysler/values.py index 4a9b6a9..2c54310 100644 --- a/opendbc_repo/opendbc/car/chrysler/values.py +++ b/iqdbc_repo/iqdbc/car/chrysler/values.py @@ -1,10 +1,10 @@ from enum import IntFlag from dataclasses import dataclass, field -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarHarness, CarDocs, CarParts -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, p16 +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarHarness, CarDocs, CarParts +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, p16 Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/common/__init__.py b/iqdbc_repo/iqdbc/car/common/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/common/__init__.py rename to iqdbc_repo/iqdbc/car/common/__init__.py diff --git a/opendbc_repo/opendbc/car/common/basedir.py b/iqdbc_repo/iqdbc/car/common/basedir.py similarity index 100% rename from opendbc_repo/opendbc/car/common/basedir.py rename to iqdbc_repo/iqdbc/car/common/basedir.py diff --git a/opendbc_repo/opendbc/car/common/conversions.py b/iqdbc_repo/iqdbc/car/common/conversions.py similarity index 100% rename from opendbc_repo/opendbc/car/common/conversions.py rename to iqdbc_repo/iqdbc/car/common/conversions.py diff --git a/opendbc_repo/opendbc/car/common/filter_simple.py b/iqdbc_repo/iqdbc/car/common/filter_simple.py similarity index 100% rename from opendbc_repo/opendbc/car/common/filter_simple.py rename to iqdbc_repo/iqdbc/car/common/filter_simple.py diff --git a/opendbc_repo/opendbc/car/common/numpy_fast.py b/iqdbc_repo/iqdbc/car/common/numpy_fast.py similarity index 100% rename from opendbc_repo/opendbc/car/common/numpy_fast.py rename to iqdbc_repo/iqdbc/car/common/numpy_fast.py diff --git a/opendbc_repo/opendbc/car/common/pid.py b/iqdbc_repo/iqdbc/car/common/pid.py similarity index 100% rename from opendbc_repo/opendbc/car/common/pid.py rename to iqdbc_repo/iqdbc/car/common/pid.py diff --git a/opendbc_repo/opendbc/car/common/simple_kalman.py b/iqdbc_repo/iqdbc/car/common/simple_kalman.py similarity index 100% rename from opendbc_repo/opendbc/car/common/simple_kalman.py rename to iqdbc_repo/iqdbc/car/common/simple_kalman.py diff --git a/opendbc_repo/opendbc/car/crc.py b/iqdbc_repo/iqdbc/car/crc.py similarity index 100% rename from opendbc_repo/opendbc/car/crc.py rename to iqdbc_repo/iqdbc/car/crc.py diff --git a/opendbc_repo/opendbc/car/debug/format_fingerprints.py b/iqdbc_repo/iqdbc/car/debug/format_fingerprints.py similarity index 87% rename from opendbc_repo/opendbc/car/debug/format_fingerprints.py rename to iqdbc_repo/iqdbc/car/debug/format_fingerprints.py index 43b59bf..5989f81 100755 --- a/opendbc_repo/opendbc/car/debug/format_fingerprints.py +++ b/iqdbc_repo/iqdbc/car/debug/format_fingerprints.py @@ -2,9 +2,9 @@ import jinja2 import os -from opendbc.car.common.basedir import BASEDIR -from opendbc.car.interfaces import get_interface_attr -from opendbc.car.structs import CarParams +from iqdbc.car.common.basedir import BASEDIR +from iqdbc.car.interfaces import get_interface_attr +from iqdbc.car.structs import CarParams Ecu = CarParams.Ecu @@ -17,11 +17,11 @@ FINGERPRINTS_PY_TEMPLATE = jinja2.Template(""" {%- if FINGERPRINTS[brand] and brand != 'body' %} # ruff: noqa: E501 {% endif %} -\"\"\" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.\"\"\" +\"\"\" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.\"\"\" {% if FW_VERSIONS[brand] %} -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams {% endif %} -from opendbc.car.{{brand}}.values import CAR +from iqdbc.car.{{brand}}.values import CAR {% if FW_VERSIONS[brand] %} Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/disable_ecu.py b/iqdbc_repo/iqdbc/car/disable_ecu.py similarity index 92% rename from opendbc_repo/opendbc/car/disable_ecu.py rename to iqdbc_repo/iqdbc/car/disable_ecu.py index 73c17b2..f5f325c 100644 --- a/opendbc_repo/opendbc/car/disable_ecu.py +++ b/iqdbc_repo/iqdbc/car/disable_ecu.py @@ -1,5 +1,5 @@ -from opendbc.car.carlog import carlog -from opendbc.car.isotp_parallel_query import IsoTpParallelQuery +from iqdbc.car.carlog import carlog +from iqdbc.car.isotp_parallel_query import IsoTpParallelQuery EXT_DIAG_REQUEST = b'\x10\x03' EXT_DIAG_RESPONSE = b'\x50\x03' diff --git a/opendbc_repo/opendbc/car/docs.py b/iqdbc_repo/iqdbc/car/docs.py similarity index 89% rename from opendbc_repo/opendbc/car/docs.py rename to iqdbc_repo/iqdbc/car/docs.py index 290028f..9e3d89d 100755 --- a/opendbc_repo/opendbc/car/docs.py +++ b/iqdbc_repo/iqdbc/car/docs.py @@ -9,15 +9,15 @@ from typing import get_args from enum import Enum from collections import defaultdict -from opendbc.car.common.basedir import BASEDIR -from opendbc.car import gen_empty_fingerprint -from opendbc.car.structs import CarParams, IQCarParams -from opendbc.car.docs_definitions import BaseCarHarness, CarDocs, Device, ExtraCarDocs, Column, ExtraCarsColumn, CommonFootnote, PartType, SupportType -from opendbc.car.car_helpers import interfaces -from opendbc.car.interfaces import get_interface_attr -from opendbc.car.values import Platform -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.extra_cars import CAR as EXTRA +from iqdbc.car.common.basedir import BASEDIR +from iqdbc.car import gen_empty_fingerprint +from iqdbc.car.structs import CarParams, IQCarParams +from iqdbc.car.docs_definitions import BaseCarHarness, CarDocs, Device, ExtraCarDocs, Column, ExtraCarsColumn, CommonFootnote, PartType, SupportType +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.interfaces import get_interface_attr +from iqdbc.car.values import Platform +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.extra_cars import CAR as EXTRA EXTRA_CARS_MD_OUT = os.path.join(BASEDIR, "../", "../", "docs", "CARS.md") diff --git a/opendbc_repo/opendbc/car/docs_definitions.py b/iqdbc_repo/iqdbc/car/docs_definitions.py similarity index 99% rename from opendbc_repo/opendbc/car/docs_definitions.py rename to iqdbc_repo/iqdbc/car/docs_definitions.py index e58cf56..8d0a3ad 100644 --- a/opendbc_repo/opendbc/car/docs_definitions.py +++ b/iqdbc_repo/iqdbc/car/docs_definitions.py @@ -4,8 +4,8 @@ import copy from dataclasses import dataclass, field from enum import Enum -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.structs import CarParams +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.structs import CarParams GOOD_TORQUE_THRESHOLD = 1.0 # m/s^2 MODEL_YEARS_RE = r"(?<= )((\d{4}-\d{2})|(\d{4}))(,|$)" diff --git a/opendbc_repo/opendbc/car/ecu_addrs.py b/iqdbc_repo/iqdbc/car/ecu_addrs.py similarity index 91% rename from opendbc_repo/opendbc/car/ecu_addrs.py rename to iqdbc_repo/iqdbc/car/ecu_addrs.py index 8c60f17..bfc5b34 100644 --- a/opendbc_repo/opendbc/car/ecu_addrs.py +++ b/iqdbc_repo/iqdbc/car/ecu_addrs.py @@ -1,9 +1,9 @@ import time -from opendbc.car import make_tester_present_msg, uds -from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable -from opendbc.car.carlog import carlog -from opendbc.car.fw_query_definitions import EcuAddrBusType +from iqdbc.car import make_tester_present_msg, uds +from iqdbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable +from iqdbc.car.carlog import carlog +from iqdbc.car.fw_query_definitions import EcuAddrBusType def _is_tester_present_response(msg: CanData, subaddr: int | None = None) -> bool: diff --git a/opendbc_repo/opendbc/car/extra_cars.py b/iqdbc_repo/iqdbc/car/extra_cars.py similarity index 95% rename from opendbc_repo/opendbc/car/extra_cars.py rename to iqdbc_repo/iqdbc/car/extra_cars.py index cbc2b33..1dff5f7 100644 --- a/opendbc_repo/opendbc/car/extra_cars.py +++ b/iqdbc_repo/iqdbc/car/extra_cars.py @@ -1,7 +1,7 @@ from dataclasses import dataclass -from opendbc.car import structs, Platforms, ExtraPlatformConfig -from opendbc.car.docs_definitions import ExtraCarDocs, SupportType +from iqdbc.car import structs, Platforms, ExtraPlatformConfig +from iqdbc.car.docs_definitions import ExtraCarDocs, SupportType @dataclass diff --git a/opendbc_repo/opendbc/car/fingerprints.py b/iqdbc_repo/iqdbc/car/fingerprints.py similarity index 95% rename from opendbc_repo/opendbc/car/fingerprints.py rename to iqdbc_repo/iqdbc/car/fingerprints.py index 9597e0e..507a045 100644 --- a/opendbc_repo/opendbc/car/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/fingerprints.py @@ -1,16 +1,16 @@ -from opendbc.car.interfaces import get_interface_attr -from opendbc.car.body.values import CAR as BODY -from opendbc.car.chrysler.values import CAR as CHRYSLER -from opendbc.car.ford.values import CAR as FORD -from opendbc.car.gm.values import CAR as GM -from opendbc.car.honda.values import CAR as HONDA -from opendbc.car.hyundai.values import CAR as HYUNDAI -from opendbc.car.mazda.values import CAR as MAZDA -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.nissan.values import CAR as NISSAN -from opendbc.car.subaru.values import CAR as SUBARU -from opendbc.car.toyota.values import CAR as TOYOTA -from opendbc.car.volkswagen.values import CAR as VW +from iqdbc.car.interfaces import get_interface_attr +from iqdbc.car.body.values import CAR as BODY +from iqdbc.car.chrysler.values import CAR as CHRYSLER +from iqdbc.car.ford.values import CAR as FORD +from iqdbc.car.gm.values import CAR as GM +from iqdbc.car.honda.values import CAR as HONDA +from iqdbc.car.hyundai.values import CAR as HYUNDAI +from iqdbc.car.mazda.values import CAR as MAZDA +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.nissan.values import CAR as NISSAN +from iqdbc.car.subaru.values import CAR as SUBARU +from iqdbc.car.toyota.values import CAR as TOYOTA +from iqdbc.car.volkswagen.values import CAR as VW FW_VERSIONS = get_interface_attr('FW_VERSIONS', combine_brands=True, ignore_none=True) _FINGERPRINTS = get_interface_attr('FINGERPRINTS', combine_brands=True, ignore_none=True) diff --git a/opendbc_repo/opendbc/car/ford/__init__.py b/iqdbc_repo/iqdbc/car/ford/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/ford/__init__.py rename to iqdbc_repo/iqdbc/car/ford/__init__.py diff --git a/opendbc_repo/opendbc/car/ford/carcontroller.py b/iqdbc_repo/iqdbc/car/ford/carcontroller.py similarity index 96% rename from opendbc_repo/opendbc/car/ford/carcontroller.py rename to iqdbc_repo/iqdbc/car/ford/carcontroller.py index d6e892c..6b6f58d 100644 --- a/opendbc_repo/opendbc/car/ford/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/ford/carcontroller.py @@ -1,11 +1,11 @@ import math import numpy as np -from opendbc.can import CANPacker -from opendbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, DT_CTRL, apply_hysteresis, structs -from opendbc.car.lateral import ISO_LATERAL_ACCEL, apply_std_steer_angle_limits -from opendbc.car.ford import fordcan -from opendbc.car.ford.values import CarControllerParams, FordFlags, CAR -from opendbc.car.interfaces import CarControllerBase, V_CRUISE_MAX +from iqdbc.can import CANPacker +from iqdbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, DT_CTRL, apply_hysteresis, structs +from iqdbc.car.lateral import ISO_LATERAL_ACCEL, apply_std_steer_angle_limits +from iqdbc.car.ford import fordcan +from iqdbc.car.ford.values import CarControllerParams, FordFlags, CAR +from iqdbc.car.interfaces import CarControllerBase, V_CRUISE_MAX LongCtrlState = structs.CarControl.Actuators.LongControlState VisualAlert = structs.CarControl.HUDControl.VisualAlert diff --git a/opendbc_repo/opendbc/car/ford/carstate.py b/iqdbc_repo/iqdbc/car/ford/carstate.py similarity index 93% rename from opendbc_repo/opendbc/car/ford/carstate.py rename to iqdbc_repo/iqdbc/car/ford/carstate.py index 0d6decc..ee4bdec 100644 --- a/opendbc_repo/opendbc/car/ford/carstate.py +++ b/iqdbc_repo/iqdbc/car/ford/carstate.py @@ -1,11 +1,11 @@ -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.ford.fordcan import CanBus -from opendbc.car.ford.values import DBC, CarControllerParams, FordFlags -from opendbc.car.interfaces import CarStateBase +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.ford.fordcan import CanBus +from iqdbc.car.ford.values import DBC, CarControllerParams, FordFlags +from iqdbc.car.interfaces import CarStateBase -from opendbc.iqpilot.car.ford.aol import AolCarState +from iqdbc.iqpilot.car.ford.aol import AolCarState ButtonType = structs.CarState.ButtonEvent.Type GearShifter = structs.CarState.GearShifter diff --git a/opendbc_repo/opendbc/car/ford/fingerprints.py b/iqdbc_repo/iqdbc/car/ford/fingerprints.py similarity index 98% rename from opendbc_repo/opendbc/car/ford/fingerprints.py rename to iqdbc_repo/iqdbc/car/ford/fingerprints.py index 6b3e337..422fe12 100644 --- a/opendbc_repo/opendbc/car/ford/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/ford/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.ford.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.ford.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/ford/fordcan.py b/iqdbc_repo/iqdbc/car/ford/fordcan.py similarity index 99% rename from opendbc_repo/opendbc/car/ford/fordcan.py rename to iqdbc_repo/iqdbc/car/ford/fordcan.py index 2ac68c4..c5ec73c 100644 --- a/opendbc_repo/opendbc/car/ford/fordcan.py +++ b/iqdbc_repo/iqdbc/car/ford/fordcan.py @@ -1,4 +1,4 @@ -from opendbc.car import CanBusBase, structs +from iqdbc.car import CanBusBase, structs HUDControl = structs.CarControl.HUDControl diff --git a/opendbc_repo/opendbc/car/ford/interface.py b/iqdbc_repo/iqdbc/car/ford/interface.py similarity index 88% rename from opendbc_repo/opendbc/car/ford/interface.py rename to iqdbc_repo/iqdbc/car/ford/interface.py index 9d29c35..468e7fa 100644 --- a/opendbc_repo/opendbc/car/ford/interface.py +++ b/iqdbc_repo/iqdbc/car/ford/interface.py @@ -1,13 +1,13 @@ import numpy as np -from opendbc.car import Bus, get_safety_config, structs -from opendbc.car.carlog import carlog -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.ford.carcontroller import CarController -from opendbc.car.ford.carstate import CarState -from opendbc.car.ford.fordcan import CanBus -from opendbc.car.ford.radar_interface import RadarInterface -from opendbc.car.ford.values import CarControllerParams, DBC, Ecu, FordFlags, RADAR, FordSafetyFlags -from opendbc.car.interfaces import CarInterfaceBase +from iqdbc.car import Bus, get_safety_config, structs +from iqdbc.car.carlog import carlog +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.ford.carcontroller import CarController +from iqdbc.car.ford.carstate import CarState +from iqdbc.car.ford.fordcan import CanBus +from iqdbc.car.ford.radar_interface import RadarInterface +from iqdbc.car.ford.values import CarControllerParams, DBC, Ecu, FordFlags, RADAR, FordSafetyFlags +from iqdbc.car.interfaces import CarInterfaceBase TransmissionType = structs.CarParams.TransmissionType diff --git a/opendbc_repo/opendbc/car/ford/radar_interface.py b/iqdbc_repo/iqdbc/car/ford/radar_interface.py similarity index 97% rename from opendbc_repo/opendbc/car/ford/radar_interface.py rename to iqdbc_repo/iqdbc/car/ford/radar_interface.py index f802103..ece3464 100644 --- a/opendbc_repo/opendbc/car/ford/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/ford/radar_interface.py @@ -3,12 +3,12 @@ from typing import cast from collections import defaultdict from math import cos, sin from dataclasses import dataclass -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.ford.fordcan import CanBus -from opendbc.car.ford.values import DBC, RADAR -from opendbc.car.interfaces import RadarInterfaceBase +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.ford.fordcan import CanBus +from iqdbc.car.ford.values import DBC, RADAR +from iqdbc.car.interfaces import RadarInterfaceBase DELPHI_ESR_RADAR_MSGS = list(range(0x500, 0x540)) diff --git a/opendbc_repo/opendbc/car/ford/tests/__init__.py b/iqdbc_repo/iqdbc/car/ford/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/ford/tests/__init__.py rename to iqdbc_repo/iqdbc/car/ford/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/ford/tests/print_platform_codes.py b/iqdbc_repo/iqdbc/car/ford/tests/print_platform_codes.py similarity index 83% rename from opendbc_repo/opendbc/car/ford/tests/print_platform_codes.py rename to iqdbc_repo/iqdbc/car/ford/tests/print_platform_codes.py index dfb93c0..65595fe 100755 --- a/opendbc_repo/opendbc/car/ford/tests/print_platform_codes.py +++ b/iqdbc_repo/iqdbc/car/ford/tests/print_platform_codes.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 from collections import defaultdict -from opendbc.car.structs import CarParams -from opendbc.car.ford.values import get_platform_codes -from opendbc.car.ford.fingerprints import FW_VERSIONS +from iqdbc.car.structs import CarParams +from iqdbc.car.ford.values import get_platform_codes +from iqdbc.car.ford.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/ford/tests/test_ford.py b/iqdbc_repo/iqdbc/car/ford/tests/test_ford.py similarity index 95% rename from opendbc_repo/opendbc/car/ford/tests/test_ford.py rename to iqdbc_repo/iqdbc/car/ford/tests/test_ford.py index 5e3cc42..0235c86 100644 --- a/opendbc_repo/opendbc/car/ford/tests/test_ford.py +++ b/iqdbc_repo/iqdbc/car/ford/tests/test_ford.py @@ -4,10 +4,10 @@ from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized -from opendbc.car.structs import CarParams -from opendbc.car.fw_versions import build_fw_dict -from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_platform_codes -from opendbc.car.ford.fingerprints import FW_VERSIONS +from iqdbc.car.structs import CarParams +from iqdbc.car.fw_versions import build_fw_dict +from iqdbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_platform_codes +from iqdbc.car.ford.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/ford/values.py b/iqdbc_repo/iqdbc/car/ford/values.py similarity index 96% rename from opendbc_repo/opendbc/car/ford/values.py rename to iqdbc_repo/iqdbc/car/ford/values.py index 6b8c1b3..7e608c5 100644 --- a/opendbc_repo/opendbc/car/ford/values.py +++ b/iqdbc_repo/iqdbc/car/ford/values.py @@ -3,11 +3,11 @@ import re from dataclasses import dataclass, field, replace from enum import Enum, IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds -from opendbc.car.lateral import AngleSteeringLimits -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column -from opendbc.car.fw_query_definitions import FwQueryConfig, LiveFwVersions, OfflineFwVersions, Request, StdQueries, p16 +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds +from iqdbc.car.lateral import AngleSteeringLimits +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column +from iqdbc.car.fw_query_definitions import FwQueryConfig, LiveFwVersions, OfflineFwVersions, Request, StdQueries, p16 Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/fw_query_definitions.py b/iqdbc_repo/iqdbc/car/fw_query_definitions.py similarity index 99% rename from opendbc_repo/opendbc/car/fw_query_definitions.py rename to iqdbc_repo/iqdbc/car/fw_query_definitions.py index 5c48fed..e983dec 100644 --- a/opendbc_repo/opendbc/car/fw_query_definitions.py +++ b/iqdbc_repo/iqdbc/car/fw_query_definitions.py @@ -3,8 +3,8 @@ from dataclasses import dataclass, field import struct from collections.abc import Callable -from opendbc.car import uds -from opendbc.car.structs import CarParams +from iqdbc.car import uds +from iqdbc.car.structs import CarParams Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/fw_versions.py b/iqdbc_repo/iqdbc/car/fw_versions.py similarity index 96% rename from opendbc_repo/opendbc/car/fw_versions.py rename to iqdbc_repo/iqdbc/car/fw_versions.py index 8b349b2..2065a24 100644 --- a/opendbc_repo/opendbc/car/fw_versions.py +++ b/iqdbc_repo/iqdbc/car/fw_versions.py @@ -4,15 +4,15 @@ from typing import Protocol, TypeVar from tqdm import tqdm -from opendbc.car import uds -from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable -from opendbc.car.carlog import carlog -from opendbc.car.structs import CarParams -from opendbc.car.ecu_addrs import get_ecu_addrs -from opendbc.car.fingerprints import FW_VERSIONS -from opendbc.car.fw_query_definitions import ESSENTIAL_ECUS, AddrType, EcuAddrBusType, FwQueryConfig, LiveFwVersions, OfflineFwVersions -from opendbc.car.interfaces import get_interface_attr -from opendbc.car.isotp_parallel_query import IsoTpParallelQuery +from iqdbc.car import uds +from iqdbc.car.can_definitions import CanRecvCallable, CanSendCallable +from iqdbc.car.carlog import carlog +from iqdbc.car.structs import CarParams +from iqdbc.car.ecu_addrs import get_ecu_addrs +from iqdbc.car.fingerprints import FW_VERSIONS +from iqdbc.car.fw_query_definitions import ESSENTIAL_ECUS, AddrType, EcuAddrBusType, FwQueryConfig, LiveFwVersions, OfflineFwVersions +from iqdbc.car.interfaces import get_interface_attr +from iqdbc.car.isotp_parallel_query import IsoTpParallelQuery Ecu = CarParams.Ecu FUZZY_EXCLUDE_ECUS = [Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps, Ecu.debug] diff --git a/opendbc_repo/opendbc/car/gm/__init__.py b/iqdbc_repo/iqdbc/car/gm/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/gm/__init__.py rename to iqdbc_repo/iqdbc/car/gm/__init__.py diff --git a/opendbc_repo/opendbc/car/gm/carcontroller.py b/iqdbc_repo/iqdbc/car/gm/carcontroller.py similarity index 95% rename from opendbc_repo/opendbc/car/gm/carcontroller.py rename to iqdbc_repo/iqdbc/car/gm/carcontroller.py index 0a008db..c9431d9 100644 --- a/opendbc_repo/opendbc/car/gm/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/gm/carcontroller.py @@ -1,11 +1,11 @@ import numpy as np -from opendbc.can import CANPacker -from opendbc.car import Bus, DT_CTRL, structs -from opendbc.car.lateral import apply_driver_steer_torque_limits -from opendbc.car.gm import gmcan -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons -from opendbc.car.interfaces import CarControllerBase +from iqdbc.can import CANPacker +from iqdbc.car import Bus, DT_CTRL, structs +from iqdbc.car.lateral import apply_driver_steer_torque_limits +from iqdbc.car.gm import gmcan +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons +from iqdbc.car.interfaces import CarControllerBase VisualAlert = structs.CarControl.HUDControl.VisualAlert NetworkLocation = structs.CarParams.NetworkLocation diff --git a/opendbc_repo/opendbc/car/gm/carstate.py b/iqdbc_repo/iqdbc/car/gm/carstate.py similarity index 95% rename from opendbc_repo/opendbc/car/gm/carstate.py rename to iqdbc_repo/iqdbc/car/gm/carstate.py index c669870..bd190d6 100644 --- a/opendbc_repo/opendbc/car/gm/carstate.py +++ b/iqdbc_repo/iqdbc/car/gm/carstate.py @@ -1,12 +1,12 @@ import copy -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarStateBase -from opendbc.car.gm.values import DBC, AccState, CruiseButtons, STEER_THRESHOLD, SDGM_CAR, ALT_ACCS +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.gm.values import DBC, AccState, CruiseButtons, STEER_THRESHOLD, SDGM_CAR, ALT_ACCS -from opendbc.iqpilot.car.gm.carstate_ext import CarStateExt -from opendbc.iqpilot.car.gm.values_ext import GMFlagsIQ +from iqdbc.iqpilot.car.gm.carstate_ext import CarStateExt +from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ ButtonType = structs.CarState.ButtonEvent.Type TransmissionType = structs.CarParams.TransmissionType diff --git a/opendbc_repo/opendbc/car/gm/fingerprints.py b/iqdbc_repo/iqdbc/car/gm/fingerprints.py similarity index 98% rename from opendbc_repo/opendbc/car/gm/fingerprints.py rename to iqdbc_repo/iqdbc/car/gm/fingerprints.py index 6b6f725..37d8c57 100644 --- a/opendbc_repo/opendbc/car/gm/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/gm/fingerprints.py @@ -1,9 +1,9 @@ # ruff: noqa: E501 -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.gm.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.gm.values import CAR -from opendbc.iqpilot.car.fingerprints_ext import merge_fingerprints -from opendbc.iqpilot.car.gm.fingerprints_ext import FINGERPRINTS_EXT +from iqdbc.iqpilot.car.fingerprints_ext import merge_fingerprints +from iqdbc.iqpilot.car.gm.fingerprints_ext import FINGERPRINTS_EXT # Trailblazer also matches as a SILVERADO, TODO: split with fw versions # FIXME: There are Equinox users with different message lengths, specifically 304 and 320 diff --git a/opendbc_repo/opendbc/car/gm/gmcan.py b/iqdbc_repo/iqdbc/car/gm/gmcan.py similarity index 98% rename from opendbc_repo/opendbc/car/gm/gmcan.py rename to iqdbc_repo/iqdbc/car/gm/gmcan.py index cb74b60..0ed1c66 100644 --- a/opendbc_repo/opendbc/car/gm/gmcan.py +++ b/iqdbc_repo/iqdbc/car/gm/gmcan.py @@ -1,5 +1,5 @@ -from opendbc.car.can_definitions import CanData -from opendbc.car.gm.values import CAR +from iqdbc.car.can_definitions import CanData +from iqdbc.car.gm.values import CAR def create_buttons(packer, bus, idx, button): diff --git a/opendbc_repo/opendbc/car/gm/interface.py b/iqdbc_repo/iqdbc/car/gm/interface.py similarity index 94% rename from opendbc_repo/opendbc/car/gm/interface.py rename to iqdbc_repo/iqdbc/car/gm/interface.py index 441fb75..4a682f6 100755 --- a/opendbc_repo/opendbc/car/gm/interface.py +++ b/iqdbc_repo/iqdbc/car/gm/interface.py @@ -2,16 +2,16 @@ from math import fabs, exp import numpy as np -from opendbc.car import get_safety_config, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.gm.carcontroller import CarController -from opendbc.car.gm.carstate import CarState -from opendbc.car.gm.radar_interface import RadarInterface, RADAR_HEADER_MSG, CAMERA_DATA_HEADER_MSG -from opendbc.car.gm.values import CAR, CarControllerParams, EV_CAR, CAMERA_ACC_CAR, SDGM_CAR, ALT_ACCS, CanBus, GMSafetyFlags -from opendbc.car.interfaces import CarInterfaceBase, TorqueFromLateralAccelCallbackType, LateralAccelFromTorqueCallbackType +from iqdbc.car import get_safety_config, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.gm.carcontroller import CarController +from iqdbc.car.gm.carstate import CarState +from iqdbc.car.gm.radar_interface import RadarInterface, RADAR_HEADER_MSG, CAMERA_DATA_HEADER_MSG +from iqdbc.car.gm.values import CAR, CarControllerParams, EV_CAR, CAMERA_ACC_CAR, SDGM_CAR, ALT_ACCS, CanBus, GMSafetyFlags +from iqdbc.car.interfaces import CarInterfaceBase, TorqueFromLateralAccelCallbackType, LateralAccelFromTorqueCallbackType -from opendbc.iqpilot.car.gm.interface_ext import CarInterfaceExt -from opendbc.iqpilot.car.gm.values_ext import GMFlagsIQ, GMSafetyFlagsIQ +from iqdbc.iqpilot.car.gm.interface_ext import CarInterfaceExt +from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ, GMSafetyFlagsIQ TransmissionType = structs.CarParams.TransmissionType NetworkLocation = structs.CarParams.NetworkLocation @@ -154,7 +154,7 @@ class CarInterface(CarInterfaceBase, CarInterfaceExt): # These cars have been put into dashcam only due to both a lack of users and test coverage. # These cars likely still work fine. Once a user confirms each car works and a test route is - # added to opendbc/car/tests/routes.py, we can remove it from this list. + # added to iqdbc/car/tests/routes.py, we can remove it from this list. ret.dashcamOnly = candidate in {CAR.CADILLAC_ATS, CAR.HOLDEN_ASTRA, CAR.CHEVROLET_MALIBU, CAR.BUICK_REGAL} or \ (ret.networkLocation == NetworkLocation.gateway and ret.radarUnavailable) diff --git a/opendbc_repo/opendbc/car/gm/radar_interface.py b/iqdbc_repo/iqdbc/car/gm/radar_interface.py similarity index 93% rename from opendbc_repo/opendbc/car/gm/radar_interface.py rename to iqdbc_repo/iqdbc/car/gm/radar_interface.py index 2c92676..b030dbe 100755 --- a/opendbc_repo/opendbc/car/gm/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/gm/radar_interface.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 import math -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.gm.values import DBC, CanBus -from opendbc.car.interfaces import RadarInterfaceBase +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.gm.values import DBC, CanBus +from iqdbc.car.interfaces import RadarInterfaceBase RADAR_HEADER_MSG = 1120 # F_LRR_Obj_Header CAMERA_DATA_HEADER_MSG = 1056 # F_Vision_Obj_Header diff --git a/opendbc_repo/opendbc/car/gm/tests/__init__.py b/iqdbc_repo/iqdbc/car/gm/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/gm/tests/__init__.py rename to iqdbc_repo/iqdbc/car/gm/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/gm/tests/test_gm.py b/iqdbc_repo/iqdbc/car/gm/tests/test_gm.py similarity index 83% rename from opendbc_repo/opendbc/car/gm/tests/test_gm.py rename to iqdbc_repo/iqdbc/car/gm/tests/test_gm.py index c14b9bd..41510ff 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_gm.py +++ b/iqdbc_repo/iqdbc/car/gm/tests/test_gm.py @@ -1,7 +1,7 @@ from parameterized import parameterized -from opendbc.car.gm.fingerprints import FINGERPRINTS -from opendbc.car.gm.values import CAMERA_ACC_CAR, GM_RX_OFFSET +from iqdbc.car.gm.fingerprints import FINGERPRINTS +from iqdbc.car.gm.values import CAMERA_ACC_CAR, GM_RX_OFFSET CAMERA_DIAGNOSTIC_ADDRESS = 0x24b diff --git a/opendbc_repo/opendbc/car/gm/values.py b/iqdbc_repo/iqdbc/car/gm/values.py similarity index 97% rename from opendbc_repo/opendbc/car/gm/values.py rename to iqdbc_repo/iqdbc/car/gm/values.py index 51c3cd3..369083b 100644 --- a/opendbc_repo/opendbc/car/gm/values.py +++ b/iqdbc_repo/iqdbc/car/gm/values.py @@ -1,12 +1,12 @@ from dataclasses import dataclass, field from enum import Enum, IntFlag -from opendbc.car import Bus, PlatformConfig, DbcDict, Platforms, CarSpecs -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column, SupportType -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car import Bus, PlatformConfig, DbcDict, Platforms, CarSpecs +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column, SupportType +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries -from opendbc.iqpilot.car.gm.values_ext import GMFlagsIQ +from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/honda/__init__.py b/iqdbc_repo/iqdbc/car/honda/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/honda/__init__.py rename to iqdbc_repo/iqdbc/car/honda/__init__.py diff --git a/opendbc_repo/opendbc/car/honda/carcontroller.py b/iqdbc_repo/iqdbc/car/honda/carcontroller.py similarity index 96% rename from opendbc_repo/opendbc/car/honda/carcontroller.py rename to iqdbc_repo/iqdbc/car/honda/carcontroller.py index ec79590..7325b3a 100644 --- a/opendbc_repo/opendbc/car/honda/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/honda/carcontroller.py @@ -1,15 +1,15 @@ import numpy as np import math -from opendbc.can import CANPacker -from opendbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs -from opendbc.car.honda import hondacan -from opendbc.car.honda.values import CAR, CruiseButtons, HONDA_BOSCH, HONDA_BOSCH_CANFD, HONDA_BOSCH_RADARLESS, \ +from iqdbc.can import CANPacker +from iqdbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs +from iqdbc.car.honda import hondacan +from iqdbc.car.honda.values import CAR, CruiseButtons, HONDA_BOSCH, HONDA_BOSCH_CANFD, HONDA_BOSCH_RADARLESS, \ HONDA_BOSCH_TJA_CONTROL, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams -from opendbc.car.interfaces import CarControllerBase +from iqdbc.car.interfaces import CarControllerBase -from opendbc.iqpilot.car.honda.aol import AolCarController -from opendbc.iqpilot.car.honda.gas_interceptor import GasInterceptorCarController +from iqdbc.iqpilot.car.honda.aol import AolCarController +from iqdbc.iqpilot.car.honda.gas_interceptor import GasInterceptorCarController VisualAlert = structs.CarControl.HUDControl.VisualAlert LongCtrlState = structs.CarControl.Actuators.LongControlState diff --git a/opendbc_repo/opendbc/car/honda/carstate.py b/iqdbc_repo/iqdbc/car/honda/carstate.py similarity index 96% rename from opendbc_repo/opendbc/car/honda/carstate.py rename to iqdbc_repo/iqdbc/car/honda/carstate.py index e016c60..790a170 100644 --- a/opendbc_repo/opendbc/car/honda/carstate.py +++ b/iqdbc_repo/iqdbc/car/honda/carstate.py @@ -1,16 +1,16 @@ import numpy as np from collections import defaultdict -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs, DT_CTRL -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.honda.hondacan import CanBus -from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA_BOSCH_ALT_RADAR, HONDA_BOSCH_CANFD, \ +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs, DT_CTRL +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.honda.hondacan import CanBus +from iqdbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA_BOSCH_ALT_RADAR, HONDA_BOSCH_CANFD, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, HONDA_BOSCH_TJA_CONTROL, \ HondaFlags, CruiseButtons, CruiseSettings, GearShifter, CarControllerParams -from opendbc.car.interfaces import CarStateBase +from iqdbc.car.interfaces import CarStateBase -from opendbc.iqpilot.car.honda.carstate_ext import CarStateExt +from iqdbc.iqpilot.car.honda.carstate_ext import CarStateExt TransmissionType = structs.CarParams.TransmissionType ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/car/honda/fingerprints.py b/iqdbc_repo/iqdbc/car/honda/fingerprints.py similarity index 99% rename from opendbc_repo/opendbc/car/honda/fingerprints.py rename to iqdbc_repo/iqdbc/car/honda/fingerprints.py index 630a3e1..de74ca8 100644 --- a/opendbc_repo/opendbc/car/honda/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/honda/fingerprints.py @@ -1,9 +1,9 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.honda.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.honda.values import CAR -from opendbc.iqpilot.car.fingerprints_ext import merge_fw_versions -from opendbc.iqpilot.car.honda.fingerprints_ext import FW_VERSIONS_EXT +from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions +from iqdbc.iqpilot.car.honda.fingerprints_ext import FW_VERSIONS_EXT Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/honda/hondacan.py b/iqdbc_repo/iqdbc/car/honda/hondacan.py similarity index 96% rename from opendbc_repo/opendbc/car/honda/hondacan.py rename to iqdbc_repo/iqdbc/car/honda/hondacan.py index 9df7a8c..8b8c4d2 100644 --- a/opendbc_repo/opendbc/car/honda/hondacan.py +++ b/iqdbc_repo/iqdbc/car/honda/hondacan.py @@ -1,8 +1,8 @@ -from opendbc.car import CanBusBase -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.honda.values import (HondaFlags, HONDA_BOSCH, HONDA_BOSCH_ALT_RADAR, HONDA_BOSCH_RADARLESS, +from iqdbc.car import CanBusBase +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.honda.values import (HondaFlags, HONDA_BOSCH, HONDA_BOSCH_ALT_RADAR, HONDA_BOSCH_RADARLESS, HONDA_BOSCH_CANFD, CarControllerParams) -from opendbc.iqpilot.car.honda.values_ext import HondaFlagsIQ +from iqdbc.iqpilot.car.honda.values_ext import HondaFlagsIQ # CAN bus layout with relay # 0 = ACC-CAN - radar side diff --git a/opendbc_repo/opendbc/car/honda/interface.py b/iqdbc_repo/iqdbc/car/honda/interface.py similarity index 96% rename from opendbc_repo/opendbc/car/honda/interface.py rename to iqdbc_repo/iqdbc/car/honda/interface.py index a99f57c..bb8a835 100755 --- a/opendbc_repo/opendbc/car/honda/interface.py +++ b/iqdbc_repo/iqdbc/car/honda/interface.py @@ -1,17 +1,17 @@ #!/usr/bin/env python3 import numpy as np -from opendbc.car import get_safety_config, structs, uds -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.disable_ecu import disable_ecu -from opendbc.car.honda.hondacan import CanBus -from opendbc.car.honda.values import CarControllerParams, HondaFlags, CAR, HONDA_BOSCH, HONDA_BOSCH_CANFD, \ +from iqdbc.car import get_safety_config, structs, uds +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.disable_ecu import disable_ecu +from iqdbc.car.honda.hondacan import CanBus +from iqdbc.car.honda.values import CarControllerParams, HondaFlags, CAR, HONDA_BOSCH, HONDA_BOSCH_CANFD, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, HondaSafetyFlags -from opendbc.car.honda.carcontroller import CarController -from opendbc.car.honda.carstate import CarState -from opendbc.car.honda.radar_interface import RadarInterface -from opendbc.car.interfaces import CarInterfaceBase +from iqdbc.car.honda.carcontroller import CarController +from iqdbc.car.honda.carstate import CarState +from iqdbc.car.honda.radar_interface import RadarInterface +from iqdbc.car.interfaces import CarInterfaceBase -from opendbc.iqpilot.car.honda.values_ext import HondaFlagsIQ, HondaSafetyFlagsIQ +from iqdbc.iqpilot.car.honda.values_ext import HondaFlagsIQ, HondaSafetyFlagsIQ TransmissionType = structs.CarParams.TransmissionType @@ -215,7 +215,7 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kpBP, ret.lateralTuning.pid.kpV = [[0, 10], [0.05, 0.5]] ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kiV = [[0, 10], [0.0125, 0.125]] - # TODO-IQ: remove when https://github.com/commaai/opendbc/pull/2687 is merged + # TODO-IQ: remove when https://github.com/commaai/iqdbc/pull/2687 is merged elif candidate == CAR.HONDA_CLARITY: pass diff --git a/opendbc_repo/opendbc/car/honda/radar_interface.py b/iqdbc_repo/iqdbc/car/honda/radar_interface.py similarity index 93% rename from opendbc_repo/opendbc/car/honda/radar_interface.py rename to iqdbc_repo/iqdbc/car/honda/radar_interface.py index e35e5f5..6eb4707 100755 --- a/opendbc_repo/opendbc/car/honda/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/honda/radar_interface.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.honda.values import DBC +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import RadarInterfaceBase +from iqdbc.car.honda.values import DBC def _create_nidec_can_parser(car_fingerprint): diff --git a/opendbc_repo/opendbc/car/honda/tests/__init__.py b/iqdbc_repo/iqdbc/car/honda/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/honda/tests/__init__.py rename to iqdbc_repo/iqdbc/car/honda/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/honda/tests/test_honda.py b/iqdbc_repo/iqdbc/car/honda/tests/test_honda.py similarity index 80% rename from opendbc_repo/opendbc/car/honda/tests/test_honda.py rename to iqdbc_repo/iqdbc/car/honda/tests/test_honda.py index def5a82..15b627a 100644 --- a/opendbc_repo/opendbc/car/honda/tests/test_honda.py +++ b/iqdbc_repo/iqdbc/car/honda/tests/test_honda.py @@ -1,7 +1,7 @@ import re -from opendbc.car.honda.fingerprints import FW_VERSIONS -from opendbc.car.honda.values import HONDA_BOSCH, HONDA_BOSCH_TJA_CONTROL +from iqdbc.car.honda.fingerprints import FW_VERSIONS +from iqdbc.car.honda.values import HONDA_BOSCH, HONDA_BOSCH_TJA_CONTROL HONDA_FW_VERSION_RE = br"[A-Z0-9]{5}(-|,)[A-Z0-9]{3}(-|,)[A-Z0-9]{4}(\x00){2}$" diff --git a/opendbc_repo/opendbc/car/honda/values.py b/iqdbc_repo/iqdbc/car/honda/values.py similarity index 98% rename from opendbc_repo/opendbc/car/honda/values.py rename to iqdbc_repo/iqdbc/car/honda/values.py index 17f6cb2..28f2d7e 100644 --- a/opendbc_repo/opendbc/car/honda/values.py +++ b/iqdbc_repo/iqdbc/car/honda/values.py @@ -1,10 +1,10 @@ from dataclasses import dataclass, field from enum import Enum, IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column, SupportType -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column, SupportType +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 Ecu = structs.CarParams.Ecu VisualAlert = structs.CarControl.HUDControl.VisualAlert diff --git a/opendbc_repo/opendbc/car/hyundai/__init__.py b/iqdbc_repo/iqdbc/car/hyundai/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/hyundai/__init__.py rename to iqdbc_repo/iqdbc/car/hyundai/__init__.py diff --git a/opendbc_repo/opendbc/car/hyundai/carcontroller.py b/iqdbc_repo/iqdbc/car/hyundai/carcontroller.py similarity index 93% rename from opendbc_repo/opendbc/car/hyundai/carcontroller.py rename to iqdbc_repo/iqdbc/car/hyundai/carcontroller.py index 7563fdc..98ee868 100644 --- a/opendbc_repo/opendbc/car/hyundai/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/hyundai/carcontroller.py @@ -1,17 +1,17 @@ import numpy as np -from opendbc.can import CANPacker -from opendbc.car import Bus, DT_CTRL, make_tester_present_msg, structs -from opendbc.car.lateral import apply_driver_steer_torque_limits, common_fault_avoidance -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.hyundai import hyundaicanfd, hyundaican -from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CAR -from opendbc.car.interfaces import CarControllerBase +from iqdbc.can import CANPacker +from iqdbc.car import Bus, DT_CTRL, make_tester_present_msg, structs +from iqdbc.car.lateral import apply_driver_steer_torque_limits, common_fault_avoidance +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.hyundai import hyundaicanfd, hyundaican +from iqdbc.car.hyundai.hyundaicanfd import CanBus +from iqdbc.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CAR +from iqdbc.car.interfaces import CarControllerBase -from opendbc.iqpilot.car.hyundai.escc import EsccCarController -from opendbc.iqpilot.car.hyundai.longitudinal.controller import LongitudinalController -from opendbc.iqpilot.car.hyundai.lead_data_ext import LeadDataCarController -from opendbc.iqpilot.car.hyundai.aol import AolCarController +from iqdbc.iqpilot.car.hyundai.escc import EsccCarController +from iqdbc.iqpilot.car.hyundai.longitudinal.controller import LongitudinalController +from iqdbc.iqpilot.car.hyundai.lead_data_ext import LeadDataCarController +from iqdbc.iqpilot.car.hyundai.aol import AolCarController VisualAlert = structs.CarControl.HUDControl.VisualAlert LongCtrlState = structs.CarControl.Actuators.LongControlState diff --git a/opendbc_repo/opendbc/car/hyundai/carstate.py b/iqdbc_repo/iqdbc/car/hyundai/carstate.py similarity index 96% rename from opendbc_repo/opendbc/car/hyundai/carstate.py rename to iqdbc_repo/iqdbc/car/hyundai/carstate.py index b4a2296..6b98f38 100644 --- a/opendbc_repo/opendbc/car/hyundai/carstate.py +++ b/iqdbc_repo/iqdbc/car/hyundai/carstate.py @@ -2,17 +2,17 @@ from collections import deque import copy import math -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.values import HyundaiFlags, CAR, DBC, Buttons, CarControllerParams -from opendbc.car.interfaces import CarStateBase +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.hyundai.hyundaicanfd import CanBus +from iqdbc.car.hyundai.values import HyundaiFlags, CAR, DBC, Buttons, CarControllerParams +from iqdbc.car.interfaces import CarStateBase -from opendbc.iqpilot.car.hyundai.carstate_ext import CarStateExt -from opendbc.iqpilot.car.hyundai.escc import EsccCarStateBase -from opendbc.iqpilot.car.hyundai.aol import AolCarState -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.iqpilot.car.hyundai.carstate_ext import CarStateExt +from iqdbc.iqpilot.car.hyundai.escc import EsccCarStateBase +from iqdbc.iqpilot.car.hyundai.aol import AolCarState +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/car/hyundai/fingerprints.py b/iqdbc_repo/iqdbc/car/hyundai/fingerprints.py similarity index 99% rename from opendbc_repo/opendbc/car/hyundai/fingerprints.py rename to iqdbc_repo/iqdbc/car/hyundai/fingerprints.py index a4266c5..b518a49 100644 --- a/opendbc_repo/opendbc/car/hyundai/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/hyundai/fingerprints.py @@ -1,9 +1,9 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.hyundai.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.hyundai.values import CAR -from opendbc.iqpilot.car.fingerprints_ext import merge_fw_versions -from opendbc.iqpilot.car.hyundai.fingerprints_ext import FW_VERSIONS_EXT +from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions +from iqdbc.iqpilot.car.hyundai.fingerprints_ext import FW_VERSIONS_EXT Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/hyundai/hyundaican.py b/iqdbc_repo/iqdbc/car/hyundai/hyundaican.py similarity index 97% rename from opendbc_repo/opendbc/car/hyundai/hyundaican.py rename to iqdbc_repo/iqdbc/car/hyundai/hyundaican.py index f233e02..b4ed091 100644 --- a/opendbc_repo/opendbc/car/hyundai/hyundaican.py +++ b/iqdbc_repo/iqdbc/car/hyundai/hyundaican.py @@ -1,8 +1,8 @@ import crcmod -from opendbc.car.hyundai.values import CAR, HyundaiFlags +from iqdbc.car.hyundai.values import CAR, HyundaiFlags -from opendbc.iqpilot.car.hyundai.escc import EnhancedSmartCruiseControl -from opendbc.iqpilot.car.hyundai.lead_data_ext import CanLeadData +from iqdbc.iqpilot.car.hyundai.escc import EnhancedSmartCruiseControl +from iqdbc.iqpilot.car.hyundai.lead_data_ext import CanLeadData hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf) @@ -214,7 +214,7 @@ def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_data: CanL # If we don't use ESCC since ESCC does not block FCA11 from stock radar if use_fca and not ((CP.flags & HyundaiFlags.CAMERA_SCC) or (ESCC and ESCC.enabled)): # note that some vehicles most likely have an alternate checksum/counter definition - # https://github.com/commaai/opendbc/commit/9ddcdb22c4929baf310295e832668e6e7fcfa602 + # https://github.com/commaai/iqdbc/commit/9ddcdb22c4929baf310295e832668e6e7fcfa602 fca11_values = get_fca11_values() fca11_values = calculate_fca11_checksum(fca11_values) commands.append(packer.make_can_msg("FCA11", 0, fca11_values)) diff --git a/opendbc_repo/opendbc/car/hyundai/hyundaicanfd.py b/iqdbc_repo/iqdbc/car/hyundai/hyundaicanfd.py similarity index 97% rename from opendbc_repo/opendbc/car/hyundai/hyundaicanfd.py rename to iqdbc_repo/iqdbc/car/hyundai/hyundaicanfd.py index e1c6a23..bc8c103 100644 --- a/opendbc_repo/opendbc/car/hyundai/hyundaicanfd.py +++ b/iqdbc_repo/iqdbc/car/hyundai/hyundaicanfd.py @@ -1,9 +1,9 @@ import copy import numpy as np -from opendbc.car import CanBusBase -from opendbc.car.crc import CRC16_XMODEM -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.iqpilot.car.hyundai.lead_data_ext import CanFdLeadData +from iqdbc.car import CanBusBase +from iqdbc.car.crc import CRC16_XMODEM +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.lead_data_ext import CanFdLeadData class CanBus(CanBusBase): diff --git a/opendbc_repo/opendbc/car/hyundai/interface.py b/iqdbc_repo/iqdbc/car/hyundai/interface.py similarity index 93% rename from opendbc_repo/opendbc/car/hyundai/interface.py rename to iqdbc_repo/iqdbc/car/hyundai/interface.py index 5dcf683..9282d9d 100644 --- a/opendbc_repo/opendbc/car/hyundai/interface.py +++ b/iqdbc_repo/iqdbc/car/hyundai/interface.py @@ -1,18 +1,18 @@ -from opendbc.car import Bus, get_safety_config, structs, uds -from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.values import HyundaiFlags, CAR, DBC, \ +from iqdbc.car import Bus, get_safety_config, structs, uds +from iqdbc.car.hyundai.hyundaicanfd import CanBus +from iqdbc.car.hyundai.values import HyundaiFlags, CAR, DBC, \ CANFD_UNSUPPORTED_LONGITUDINAL_CAR, \ UNSUPPORTED_LONGITUDINAL_CAR, HyundaiSafetyFlags -from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.disable_ecu import disable_ecu -from opendbc.car.hyundai.carcontroller import CarController -from opendbc.car.hyundai.carstate import CarState -from opendbc.car.hyundai.radar_interface import RadarInterface +from iqdbc.car.hyundai.radar_interface import RADAR_START_ADDR +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.disable_ecu import disable_ecu +from iqdbc.car.hyundai.carcontroller import CarController +from iqdbc.car.hyundai.carstate import CarState +from iqdbc.car.hyundai.radar_interface import RadarInterface -from opendbc.iqpilot.car.hyundai.escc import ESCC_MSG -from opendbc.iqpilot.car.hyundai.longitudinal.helpers import get_longitudinal_tune -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ, HyundaiSafetyFlagsIQ +from iqdbc.iqpilot.car.hyundai.escc import ESCC_MSG +from iqdbc.iqpilot.car.hyundai.longitudinal.helpers import get_longitudinal_tune +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ, HyundaiSafetyFlagsIQ ButtonType = structs.CarState.ButtonEvent.Type Ecu = structs.CarParams.Ecu @@ -126,7 +126,7 @@ class CarInterface(CarInterfaceBase): if ret.flags & HyundaiFlags.ALT_LIMITS_2: ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.ALT_LIMITS_2.value - # see https://github.com/commaai/opendbc/pull/1137/ + # see https://github.com/commaai/iqdbc/pull/1137/ ret.dashcamOnly = True # Common longitudinal control setup diff --git a/opendbc_repo/opendbc/car/hyundai/radar_interface.py b/iqdbc_repo/iqdbc/car/hyundai/radar_interface.py similarity index 90% rename from opendbc_repo/opendbc/car/hyundai/radar_interface.py rename to iqdbc_repo/iqdbc/car/hyundai/radar_interface.py index 2104e50..c2ed03c 100644 --- a/opendbc_repo/opendbc/car/hyundai/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/hyundai/radar_interface.py @@ -1,11 +1,11 @@ import math -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.hyundai.values import DBC +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import RadarInterfaceBase +from iqdbc.car.hyundai.values import DBC -from opendbc.iqpilot.car.hyundai.radar_interface_ext import RadarInterfaceExt +from iqdbc.iqpilot.car.hyundai.radar_interface_ext import RadarInterfaceExt RADAR_START_ADDR = 0x500 RADAR_MSG_COUNT = 32 diff --git a/opendbc_repo/opendbc/car/hyundai/tests/__init__.py b/iqdbc_repo/iqdbc/car/hyundai/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/hyundai/tests/__init__.py rename to iqdbc_repo/iqdbc/car/hyundai/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/hyundai/tests/print_platform_codes.py b/iqdbc_repo/iqdbc/car/hyundai/tests/print_platform_codes.py similarity index 75% rename from opendbc_repo/opendbc/car/hyundai/tests/print_platform_codes.py rename to iqdbc_repo/iqdbc/car/hyundai/tests/print_platform_codes.py index 325b020..c96e131 100755 --- a/opendbc_repo/opendbc/car/hyundai/tests/print_platform_codes.py +++ b/iqdbc_repo/iqdbc/car/hyundai/tests/print_platform_codes.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -from opendbc.car.structs import CarParams -from opendbc.car.hyundai.values import PLATFORM_CODE_ECUS, get_platform_codes -from opendbc.car.hyundai.fingerprints import FW_VERSIONS +from iqdbc.car.structs import CarParams +from iqdbc.car.hyundai.values import PLATFORM_CODE_ECUS, get_platform_codes +from iqdbc.car.hyundai.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py b/iqdbc_repo/iqdbc/car/hyundai/tests/test_hyundai.py similarity index 95% rename from opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py rename to iqdbc_repo/iqdbc/car/hyundai/tests/test_hyundai.py index cd9bf9a..fdbc357 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py +++ b/iqdbc_repo/iqdbc/car/hyundai/tests/test_hyundai.py @@ -2,18 +2,18 @@ from hypothesis import settings, given, strategies as st import pytest -from opendbc.car import gen_empty_fingerprint -from opendbc.car.structs import CarParams -from opendbc.car.fw_versions import build_fw_dict -from opendbc.car.hyundai.interface import CarInterface -from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR -from opendbc.car.hyundai.values import CAMERA_SCC_CAR, CANFD_CAR, CAN_GEARS, CAR, CHECKSUM, DATE_FW_ECUS, \ +from iqdbc.car import gen_empty_fingerprint +from iqdbc.car.structs import CarParams +from iqdbc.car.fw_versions import build_fw_dict +from iqdbc.car.hyundai.interface import CarInterface +from iqdbc.car.hyundai.hyundaicanfd import CanBus +from iqdbc.car.hyundai.radar_interface import RADAR_START_ADDR +from iqdbc.car.hyundai.values import CAMERA_SCC_CAR, CANFD_CAR, CAN_GEARS, CAR, CHECKSUM, DATE_FW_ECUS, \ HYBRID_CAR, EV_CAR, FW_QUERY_CONFIG, LEGACY_SAFETY_MODE_CAR, CANFD_FUZZY_WHITELIST, \ UNSUPPORTED_LONGITUDINAL_CAR, PLATFORM_CODE_ECUS, HYUNDAI_VERSION_REQUEST_LONG, \ HyundaiFlags, get_platform_codes, HyundaiSafetyFlags, \ NON_SCC_CAR -from opendbc.car.hyundai.fingerprints import FW_VERSIONS +from iqdbc.car.hyundai.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/hyundai/values.py b/iqdbc_repo/iqdbc/car/hyundai/values.py similarity index 99% rename from opendbc_repo/opendbc/car/hyundai/values.py rename to iqdbc_repo/iqdbc/car/hyundai/values.py index abea59b..a67aae5 100644 --- a/opendbc_repo/opendbc/car/hyundai/values.py +++ b/iqdbc_repo/iqdbc/car/hyundai/values.py @@ -2,13 +2,13 @@ import re from dataclasses import dataclass, field from enum import IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarHarness, CarDocs, CarParts, SupportType -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, p16 +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarHarness, CarDocs, CarParts, SupportType +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, p16 -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/include/c++.capnp b/iqdbc_repo/iqdbc/car/include/c++.capnp similarity index 100% rename from opendbc_repo/opendbc/car/include/c++.capnp rename to iqdbc_repo/iqdbc/car/include/c++.capnp diff --git a/opendbc_repo/opendbc/car/interfaces.py b/iqdbc_repo/iqdbc/car/interfaces.py similarity index 95% rename from opendbc_repo/opendbc/car/interfaces.py rename to iqdbc_repo/iqdbc/car/interfaces.py index 8cab701..1358aad 100644 --- a/opendbc_repo/opendbc/car/interfaces.py +++ b/iqdbc_repo/iqdbc/car/interfaces.py @@ -8,17 +8,17 @@ from typing import Any from collections.abc import Callable from functools import cache -from opendbc.car import DT_CTRL, apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG -from opendbc.car import structs -from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable -from opendbc.car.common.basedir import BASEDIR -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.common.simple_kalman import KF1D, get_kalman_gain -from opendbc.car.values import PLATFORMS -from opendbc.can import CANParser -from opendbc.car.carlog import carlog +from iqdbc.car import DT_CTRL, apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG +from iqdbc.car import structs +from iqdbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable +from iqdbc.car.common.basedir import BASEDIR +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.common.simple_kalman import KF1D, get_kalman_gain +from iqdbc.car.values import PLATFORMS +from iqdbc.can import CANParser +from iqdbc.car.carlog import carlog -from opendbc.iqpilot.car.interfaces import CarInterfaceBaseIQ +from iqdbc.iqpilot.car.interfaces import CarInterfaceBaseIQ GearShifter = structs.CarState.GearShifter ButtonType = structs.CarState.ButtonEvent.Type @@ -428,14 +428,14 @@ INTERFACE_ATTR_FILE = { def get_interface_attr(attr: str, combine_brands: bool = False, ignore_none: bool = False) -> dict[str | StrEnum, Any]: - # read all the folders in opendbc/car and return a dict where: + # read all the folders in iqdbc/car and return a dict where: # - keys are all the car models or brand names # - values are attr values from all car folders result = {} for car_folder in sorted([x[0] for x in os.walk(BASEDIR)]): try: brand_name = car_folder.split('/')[-1] - brand_values = __import__(f'opendbc.car.{brand_name}.{INTERFACE_ATTR_FILE.get(attr, "values")}', fromlist=[attr]) + brand_values = __import__(f'iqdbc.car.{brand_name}.{INTERFACE_ATTR_FILE.get(attr, "values")}', fromlist=[attr]) if hasattr(brand_values, attr) or not ignore_none: attr_data = getattr(brand_values, attr, None) else: diff --git a/opendbc_repo/opendbc/car/isotp.py b/iqdbc_repo/iqdbc/car/isotp.py similarity index 100% rename from opendbc_repo/opendbc/car/isotp.py rename to iqdbc_repo/iqdbc/car/isotp.py diff --git a/opendbc_repo/opendbc/car/isotp_parallel_query.py b/iqdbc_repo/iqdbc/car/isotp_parallel_query.py similarity index 97% rename from opendbc_repo/opendbc/car/isotp_parallel_query.py rename to iqdbc_repo/iqdbc/car/isotp_parallel_query.py index ffd6af0..0519a24 100644 --- a/opendbc_repo/opendbc/car/isotp_parallel_query.py +++ b/iqdbc_repo/iqdbc/car/isotp_parallel_query.py @@ -2,10 +2,10 @@ import time from collections import defaultdict from functools import partial -from opendbc.car import uds -from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable -from opendbc.car.carlog import carlog -from opendbc.car.fw_query_definitions import AddrType +from iqdbc.car import uds +from iqdbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable +from iqdbc.car.carlog import carlog +from iqdbc.car.fw_query_definitions import AddrType class IsoTpParallelQuery: diff --git a/opendbc_repo/opendbc/car/lateral.py b/iqdbc_repo/iqdbc/car/lateral.py similarity index 98% rename from opendbc_repo/opendbc/car/lateral.py rename to iqdbc_repo/iqdbc/car/lateral.py index f723adf..7801014 100644 --- a/opendbc_repo/opendbc/car/lateral.py +++ b/iqdbc_repo/iqdbc/car/lateral.py @@ -1,8 +1,8 @@ import math import numpy as np from dataclasses import dataclass -from opendbc.car import structs, rate_limit, DT_CTRL, ACCELERATION_DUE_TO_GRAVITY -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.car import structs, rate_limit, DT_CTRL, ACCELERATION_DUE_TO_GRAVITY +from iqdbc.car.vehicle_model import VehicleModel FRICTION_THRESHOLD = 0.2 diff --git a/opendbc_repo/opendbc/car/logreader.py b/iqdbc_repo/iqdbc/car/logreader.py similarity index 97% rename from opendbc_repo/opendbc/car/logreader.py rename to iqdbc_repo/iqdbc/car/logreader.py index 93b2359..36f2817 100644 --- a/opendbc_repo/opendbc/car/logreader.py +++ b/iqdbc_repo/iqdbc/car/logreader.py @@ -6,7 +6,7 @@ import warnings from urllib.request import urlopen import zstandard as zstd -from opendbc.car.common.basedir import BASEDIR +from iqdbc.car.common.basedir import BASEDIR capnp_log = capnp.load(os.path.join(BASEDIR, "rlog.capnp")) diff --git a/opendbc_repo/opendbc/car/mazda/__init__.py b/iqdbc_repo/iqdbc/car/mazda/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/mazda/__init__.py rename to iqdbc_repo/iqdbc/car/mazda/__init__.py diff --git a/opendbc_repo/opendbc/car/mazda/carcontroller.py b/iqdbc_repo/iqdbc/car/mazda/carcontroller.py similarity index 90% rename from opendbc_repo/opendbc/car/mazda/carcontroller.py rename to iqdbc_repo/iqdbc/car/mazda/carcontroller.py index 3e81b6d..f0ad356 100644 --- a/opendbc_repo/opendbc/car/mazda/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/mazda/carcontroller.py @@ -1,9 +1,9 @@ -from opendbc.can import CANPacker -from opendbc.car import Bus, structs -from opendbc.car.lateral import apply_driver_steer_torque_limits -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.mazda import mazdacan -from opendbc.car.mazda.values import CarControllerParams, Buttons +from iqdbc.can import CANPacker +from iqdbc.car import Bus, structs +from iqdbc.car.lateral import apply_driver_steer_torque_limits +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.mazda import mazdacan +from iqdbc.car.mazda.values import CarControllerParams, Buttons VisualAlert = structs.CarControl.HUDControl.VisualAlert diff --git a/opendbc_repo/opendbc/car/mazda/carstate.py b/iqdbc_repo/iqdbc/car/mazda/carstate.py similarity index 95% rename from opendbc_repo/opendbc/car/mazda/carstate.py rename to iqdbc_repo/iqdbc/car/mazda/carstate.py index db9e7ac..e29bc59 100644 --- a/opendbc_repo/opendbc/car/mazda/carstate.py +++ b/iqdbc_repo/iqdbc/car/mazda/carstate.py @@ -1,8 +1,8 @@ -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarStateBase -from opendbc.car.mazda.values import DBC, LKAS_LIMITS +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.mazda.values import DBC, LKAS_LIMITS ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/car/mazda/fingerprints.py b/iqdbc_repo/iqdbc/car/mazda/fingerprints.py similarity index 98% rename from opendbc_repo/opendbc/car/mazda/fingerprints.py rename to iqdbc_repo/iqdbc/car/mazda/fingerprints.py index 5569e28..5ec9352 100644 --- a/opendbc_repo/opendbc/car/mazda/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/mazda/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.mazda.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.mazda.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/mazda/interface.py b/iqdbc_repo/iqdbc/car/mazda/interface.py similarity index 77% rename from opendbc_repo/opendbc/car/mazda/interface.py rename to iqdbc_repo/iqdbc/car/mazda/interface.py index 2c559db..d833c3f 100755 --- a/opendbc_repo/opendbc/car/mazda/interface.py +++ b/iqdbc_repo/iqdbc/car/mazda/interface.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -from opendbc.car import get_safety_config, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.mazda.carcontroller import CarController -from opendbc.car.mazda.carstate import CarState -from opendbc.car.mazda.values import CAR, LKAS_LIMITS +from iqdbc.car import get_safety_config, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.mazda.carcontroller import CarController +from iqdbc.car.mazda.carstate import CarState +from iqdbc.car.mazda.values import CAR, LKAS_LIMITS class CarInterface(CarInterfaceBase): diff --git a/opendbc_repo/opendbc/car/mazda/mazdacan.py b/iqdbc_repo/iqdbc/car/mazda/mazdacan.py similarity index 98% rename from opendbc_repo/opendbc/car/mazda/mazdacan.py rename to iqdbc_repo/iqdbc/car/mazda/mazdacan.py index 2173633..78e2c6e 100644 --- a/opendbc_repo/opendbc/car/mazda/mazdacan.py +++ b/iqdbc_repo/iqdbc/car/mazda/mazdacan.py @@ -1,4 +1,4 @@ -from opendbc.car.mazda.values import Buttons, MazdaFlags +from iqdbc.car.mazda.values import Buttons, MazdaFlags def create_steering_control(packer, CP, frame, apply_torque, lkas): diff --git a/opendbc_repo/opendbc/car/mazda/values.py b/iqdbc_repo/iqdbc/car/mazda/values.py similarity index 88% rename from opendbc_repo/opendbc/car/mazda/values.py rename to iqdbc_repo/iqdbc/car/mazda/values.py index 80c3455..edbe679 100644 --- a/opendbc_repo/opendbc/car/mazda/values.py +++ b/iqdbc_repo/iqdbc/car/mazda/values.py @@ -1,11 +1,11 @@ from dataclasses import dataclass, field from enum import IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarHarness, CarDocs, CarParts -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarHarness, CarDocs, CarParts +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/mock/__init__.py b/iqdbc_repo/iqdbc/car/mock/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/mock/__init__.py rename to iqdbc_repo/iqdbc/car/mock/__init__.py diff --git a/opendbc_repo/opendbc/car/mock/carcontroller.py b/iqdbc_repo/iqdbc/car/mock/carcontroller.py similarity index 70% rename from opendbc_repo/opendbc/car/mock/carcontroller.py rename to iqdbc_repo/iqdbc/car/mock/carcontroller.py index 2fa7dcd..68407b2 100644 --- a/opendbc_repo/opendbc/car/mock/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/mock/carcontroller.py @@ -1,4 +1,4 @@ -from opendbc.car.interfaces import CarControllerBase +from iqdbc.car.interfaces import CarControllerBase class CarController(CarControllerBase): diff --git a/opendbc_repo/opendbc/car/mock/carstate.py b/iqdbc_repo/iqdbc/car/mock/carstate.py similarity index 65% rename from opendbc_repo/opendbc/car/mock/carstate.py rename to iqdbc_repo/iqdbc/car/mock/carstate.py index 61da454..9a8a6f4 100644 --- a/opendbc_repo/opendbc/car/mock/carstate.py +++ b/iqdbc_repo/iqdbc/car/mock/carstate.py @@ -1,5 +1,5 @@ -from opendbc.car import structs -from opendbc.car.interfaces import CarStateBase +from iqdbc.car import structs +from iqdbc.car.interfaces import CarStateBase class CarState(CarStateBase): diff --git a/opendbc_repo/opendbc/car/mock/interface.py b/iqdbc_repo/iqdbc/car/mock/interface.py similarity index 71% rename from opendbc_repo/opendbc/car/mock/interface.py rename to iqdbc_repo/iqdbc/car/mock/interface.py index 3bcc2f8..981323a 100755 --- a/opendbc_repo/opendbc/car/mock/interface.py +++ b/iqdbc_repo/iqdbc/car/mock/interface.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -from opendbc.car import structs -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.mock.carcontroller import CarController -from opendbc.car.mock.carstate import CarState +from iqdbc.car import structs +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.mock.carcontroller import CarController +from iqdbc.car.mock.carstate import CarState # mocked car interface for dashcam mode diff --git a/opendbc_repo/opendbc/car/mock/values.py b/iqdbc_repo/iqdbc/car/mock/values.py similarity index 67% rename from opendbc_repo/opendbc/car/mock/values.py rename to iqdbc_repo/iqdbc/car/mock/values.py index aa844de..473c9d0 100644 --- a/opendbc_repo/opendbc/car/mock/values.py +++ b/iqdbc_repo/iqdbc/car/mock/values.py @@ -1,4 +1,4 @@ -from opendbc.car import CarSpecs, PlatformConfig, Platforms +from iqdbc.car import CarSpecs, PlatformConfig, Platforms class CAR(Platforms): diff --git a/opendbc_repo/opendbc/car/nissan/__init__.py b/iqdbc_repo/iqdbc/car/nissan/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/nissan/__init__.py rename to iqdbc_repo/iqdbc/car/nissan/__init__.py diff --git a/opendbc_repo/opendbc/car/nissan/carcontroller.py b/iqdbc_repo/iqdbc/car/nissan/carcontroller.py similarity index 91% rename from opendbc_repo/opendbc/car/nissan/carcontroller.py rename to iqdbc_repo/iqdbc/car/nissan/carcontroller.py index 3ecfdcd..804e1c3 100644 --- a/opendbc_repo/opendbc/car/nissan/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/nissan/carcontroller.py @@ -1,9 +1,9 @@ -from opendbc.can import CANPacker -from opendbc.car import Bus, structs -from opendbc.car.lateral import apply_std_steer_angle_limits -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.nissan import nissancan -from opendbc.car.nissan.values import CAR, CarControllerParams +from iqdbc.can import CANPacker +from iqdbc.car import Bus, structs +from iqdbc.car.lateral import apply_std_steer_angle_limits +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.nissan import nissancan +from iqdbc.car.nissan.values import CAR, CarControllerParams VisualAlert = structs.CarControl.HUDControl.VisualAlert diff --git a/opendbc_repo/opendbc/car/nissan/carstate.py b/iqdbc_repo/iqdbc/car/nissan/carstate.py similarity index 94% rename from opendbc_repo/opendbc/car/nissan/carstate.py rename to iqdbc_repo/iqdbc/car/nissan/carstate.py index 7113910..517c314 100644 --- a/opendbc_repo/opendbc/car/nissan/carstate.py +++ b/iqdbc_repo/iqdbc/car/nissan/carstate.py @@ -1,11 +1,11 @@ import copy from collections import deque -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarStateBase -from opendbc.car.nissan.values import CAR, DBC, CarControllerParams -from opendbc.iqpilot.car.nissan.carstate_ext import CarStateExt +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.nissan.values import CAR, DBC, CarControllerParams +from iqdbc.iqpilot.car.nissan.carstate_ext import CarStateExt ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/car/nissan/fingerprints.py b/iqdbc_repo/iqdbc/car/nissan/fingerprints.py similarity index 95% rename from opendbc_repo/opendbc/car/nissan/fingerprints.py rename to iqdbc_repo/iqdbc/car/nissan/fingerprints.py index f60903d..3c639b3 100644 --- a/opendbc_repo/opendbc/car/nissan/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/nissan/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.nissan.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.nissan.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/nissan/interface.py b/iqdbc_repo/iqdbc/car/nissan/interface.py similarity index 78% rename from opendbc_repo/opendbc/car/nissan/interface.py rename to iqdbc_repo/iqdbc/car/nissan/interface.py index 108029a..d06218e 100644 --- a/opendbc_repo/opendbc/car/nissan/interface.py +++ b/iqdbc_repo/iqdbc/car/nissan/interface.py @@ -1,9 +1,9 @@ -from opendbc.car import get_safety_config, structs -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.nissan.carcontroller import CarController -from opendbc.car.nissan.carstate import CarState -from opendbc.car.nissan.values import CAR, NissanSafetyFlags -from opendbc.iqpilot.car.nissan.values import NissanSafetyFlagsIQ +from iqdbc.car import get_safety_config, structs +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.nissan.carcontroller import CarController +from iqdbc.car.nissan.carstate import CarState +from iqdbc.car.nissan.values import CAR, NissanSafetyFlags +from iqdbc.iqpilot.car.nissan.values import NissanSafetyFlagsIQ class CarInterface(CarInterfaceBase): CarState = CarState diff --git a/opendbc_repo/opendbc/car/nissan/nissancan.py b/iqdbc_repo/iqdbc/car/nissan/nissancan.py similarity index 98% rename from opendbc_repo/opendbc/car/nissan/nissancan.py rename to iqdbc_repo/iqdbc/car/nissan/nissancan.py index 0c95ad1..e5e312e 100644 --- a/opendbc_repo/opendbc/car/nissan/nissancan.py +++ b/iqdbc_repo/iqdbc/car/nissan/nissancan.py @@ -1,5 +1,5 @@ import crcmod -from opendbc.car.nissan.values import CAR +from iqdbc.car.nissan.values import CAR # TODO: add this checksum to the CANPacker nissan_checksum = crcmod.mkCrcFun(0x11d, initCrc=0x00, rev=False, xorOut=0xff) diff --git a/opendbc_repo/opendbc/car/nissan/values.py b/iqdbc_repo/iqdbc/car/nissan/values.py similarity index 91% rename from opendbc_repo/opendbc/car/nissan/values.py rename to iqdbc_repo/iqdbc/car/nissan/values.py index bcb74f8..aad48e2 100644 --- a/opendbc_repo/opendbc/car/nissan/values.py +++ b/iqdbc_repo/iqdbc/car/nissan/values.py @@ -1,11 +1,11 @@ from dataclasses import dataclass, field from enum import Enum, IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds -from opendbc.car.lateral import AngleSteeringLimits -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds +from iqdbc.car.lateral import AngleSteeringLimits +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/panda_runner.py b/iqdbc_repo/iqdbc/car/panda_runner.py similarity index 92% rename from opendbc_repo/opendbc/car/panda_runner.py rename to iqdbc_repo/iqdbc/car/panda_runner.py index 3c81175..83b75ae 100644 --- a/opendbc_repo/opendbc/car/panda_runner.py +++ b/iqdbc_repo/iqdbc/car/panda_runner.py @@ -2,9 +2,9 @@ import time from contextlib import AbstractContextManager from panda import Panda -from opendbc.car.car_helpers import get_car -from opendbc.car.can_definitions import CanData -from opendbc.car.structs import CarParams, CarControl +from iqdbc.car.car_helpers import get_car +from iqdbc.car.can_definitions import CanData +from iqdbc.car.structs import CarParams, CarControl class PandaRunner(AbstractContextManager): diff --git a/opendbc_repo/opendbc/car/psa/__init__.py b/iqdbc_repo/iqdbc/car/psa/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/psa/__init__.py rename to iqdbc_repo/iqdbc/car/psa/__init__.py diff --git a/opendbc_repo/opendbc/car/psa/carcontroller.py b/iqdbc_repo/iqdbc/car/psa/carcontroller.py similarity index 81% rename from opendbc_repo/opendbc/car/psa/carcontroller.py rename to iqdbc_repo/iqdbc/car/psa/carcontroller.py index 8690f8f..4a3e2d5 100644 --- a/opendbc_repo/opendbc/car/psa/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/psa/carcontroller.py @@ -1,9 +1,9 @@ -from opendbc.can.packer import CANPacker -from opendbc.car import Bus -from opendbc.car.lateral import apply_std_steer_angle_limits -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.psa.psacan import create_lka_steering -from opendbc.car.psa.values import CarControllerParams +from iqdbc.can.packer import CANPacker +from iqdbc.car import Bus +from iqdbc.car.lateral import apply_std_steer_angle_limits +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.psa.psacan import create_lka_steering +from iqdbc.car.psa.values import CarControllerParams class CarController(CarControllerBase): diff --git a/opendbc_repo/opendbc/car/psa/carstate.py b/iqdbc_repo/iqdbc/car/psa/carstate.py similarity index 92% rename from opendbc_repo/opendbc/car/psa/carstate.py rename to iqdbc_repo/iqdbc/car/psa/carstate.py index e95a015..aab4410 100644 --- a/opendbc_repo/opendbc/car/psa/carstate.py +++ b/iqdbc_repo/iqdbc/car/psa/carstate.py @@ -1,8 +1,8 @@ -from opendbc.car import structs, Bus -from opendbc.can.parser import CANParser -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.psa.values import DBC, CarControllerParams -from opendbc.car.interfaces import CarStateBase +from iqdbc.car import structs, Bus +from iqdbc.can.parser import CANParser +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.psa.values import DBC, CarControllerParams +from iqdbc.car.interfaces import CarStateBase GearShifter = structs.CarState.GearShifter TransmissionType = structs.CarParams.TransmissionType diff --git a/iqdbc_repo/iqdbc/car/psa/fingerprints.py b/iqdbc_repo/iqdbc/car/psa/fingerprints.py new file mode 100644 index 0000000..444a5c7 --- /dev/null +++ b/iqdbc_repo/iqdbc/car/psa/fingerprints.py @@ -0,0 +1,13 @@ +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.psa.values import CAR + +Ecu = CarParams.Ecu + +FW_VERSIONS = { + CAR.PSA_PEUGEOT_208: { + (Ecu.fwdRadar, 0x6b6, None): [ + b'212053276', + ], + }, +} diff --git a/opendbc_repo/opendbc/car/psa/interface.py b/iqdbc_repo/iqdbc/car/psa/interface.py similarity index 76% rename from opendbc_repo/opendbc/car/psa/interface.py rename to iqdbc_repo/iqdbc/car/psa/interface.py index f719a3d..d6fbc88 100644 --- a/opendbc_repo/opendbc/car/psa/interface.py +++ b/iqdbc_repo/iqdbc/car/psa/interface.py @@ -1,7 +1,7 @@ -from opendbc.car import structs, get_safety_config -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.psa.carcontroller import CarController -from opendbc.car.psa.carstate import CarState +from iqdbc.car import structs, get_safety_config +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.psa.carcontroller import CarController +from iqdbc.car.psa.carstate import CarState TransmissionType = structs.CarParams.TransmissionType diff --git a/opendbc_repo/opendbc/car/psa/psacan.py b/iqdbc_repo/iqdbc/car/psa/psacan.py similarity index 100% rename from opendbc_repo/opendbc/car/psa/psacan.py rename to iqdbc_repo/iqdbc/car/psa/psacan.py diff --git a/opendbc_repo/opendbc/car/psa/values.py b/iqdbc_repo/iqdbc/car/psa/values.py similarity index 78% rename from opendbc_repo/opendbc/car/psa/values.py rename to iqdbc_repo/iqdbc/car/psa/values.py index 5bd2a58..ffadfd0 100644 --- a/opendbc_repo/opendbc/car/psa/values.py +++ b/iqdbc_repo/iqdbc/car/psa/values.py @@ -1,10 +1,10 @@ from dataclasses import dataclass, field -from opendbc.car.structs import CarParams -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms -from opendbc.car.lateral import AngleSteeringLimits -from opendbc.car.docs_definitions import CarDocs, CarHarness, CarParts -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car.structs import CarParams +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms +from iqdbc.car.lateral import AngleSteeringLimits +from iqdbc.car.docs_definitions import CarDocs, CarHarness, CarParts +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/rivian/__init__.py b/iqdbc_repo/iqdbc/car/rivian/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/rivian/__init__.py rename to iqdbc_repo/iqdbc/car/rivian/__init__.py diff --git a/opendbc_repo/opendbc/car/rivian/carcontroller.py b/iqdbc_repo/iqdbc/car/rivian/carcontroller.py similarity index 84% rename from opendbc_repo/opendbc/car/rivian/carcontroller.py rename to iqdbc_repo/iqdbc/car/rivian/carcontroller.py index 9f5c147..81f3954 100644 --- a/opendbc_repo/opendbc/car/rivian/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/rivian/carcontroller.py @@ -1,12 +1,12 @@ import numpy as np -from opendbc.can import CANPacker -from opendbc.car import Bus -from opendbc.car.lateral import apply_driver_steer_torque_limits -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.rivian.riviancan import create_lka_steering, create_longitudinal, create_wheel_touch, create_adas_status -from opendbc.car.rivian.values import CarControllerParams +from iqdbc.can import CANPacker +from iqdbc.car import Bus +from iqdbc.car.lateral import apply_driver_steer_torque_limits +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.rivian.riviancan import create_lka_steering, create_longitudinal, create_wheel_touch, create_adas_status +from iqdbc.car.rivian.values import CarControllerParams -from opendbc.iqpilot.car.rivian.aol import AolCarController +from iqdbc.iqpilot.car.rivian.aol import AolCarController class CarController(CarControllerBase, AolCarController): diff --git a/opendbc_repo/opendbc/car/rivian/carstate.py b/iqdbc_repo/iqdbc/car/rivian/carstate.py similarity index 93% rename from opendbc_repo/opendbc/car/rivian/carstate.py rename to iqdbc_repo/iqdbc/car/rivian/carstate.py index 1fecc3e..d5c2471 100644 --- a/opendbc_repo/opendbc/car/rivian/carstate.py +++ b/iqdbc_repo/iqdbc/car/rivian/carstate.py @@ -1,10 +1,10 @@ import copy -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import CarStateBase -from opendbc.car.rivian.values import DBC, GEAR_MAP -from opendbc.car.common.conversions import Conversions as CV -from opendbc.iqpilot.car.rivian.carstate_ext import CarStateExt +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.rivian.values import DBC, GEAR_MAP +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.iqpilot.car.rivian.carstate_ext import CarStateExt GearShifter = structs.CarState.GearShifter diff --git a/opendbc_repo/opendbc/car/rivian/fingerprints.py b/iqdbc_repo/iqdbc/car/rivian/fingerprints.py similarity index 50% rename from opendbc_repo/opendbc/car/rivian/fingerprints.py rename to iqdbc_repo/iqdbc/car/rivian/fingerprints.py index bc58d97..46ebc02 100644 --- a/opendbc_repo/opendbc/car/rivian/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/rivian/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.rivian.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.rivian.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/rivian/interface.py b/iqdbc_repo/iqdbc/car/rivian/interface.py similarity index 81% rename from opendbc_repo/opendbc/car/rivian/interface.py rename to iqdbc_repo/iqdbc/car/rivian/interface.py index 8eabfad..36e70e8 100644 --- a/opendbc_repo/opendbc/car/rivian/interface.py +++ b/iqdbc_repo/iqdbc/car/rivian/interface.py @@ -1,10 +1,10 @@ -from opendbc.car import get_safety_config, structs -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.rivian.carcontroller import CarController -from opendbc.car.rivian.carstate import CarState -from opendbc.car.rivian.radar_interface import RadarInterface -from opendbc.car.rivian.values import RivianSafetyFlags -from opendbc.iqpilot.car.rivian.values import RivianFlagsIQ +from iqdbc.car import get_safety_config, structs +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.rivian.carcontroller import CarController +from iqdbc.car.rivian.carstate import CarState +from iqdbc.car.rivian.radar_interface import RadarInterface +from iqdbc.car.rivian.values import RivianSafetyFlags +from iqdbc.iqpilot.car.rivian.values import RivianFlagsIQ class CarInterface(CarInterfaceBase): diff --git a/opendbc_repo/opendbc/car/rivian/radar_interface.py b/iqdbc_repo/iqdbc/car/rivian/radar_interface.py similarity index 93% rename from opendbc_repo/opendbc/car/rivian/radar_interface.py rename to iqdbc_repo/iqdbc/car/rivian/radar_interface.py index a2b1914..f6016af 100644 --- a/opendbc_repo/opendbc/car/rivian/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/rivian/radar_interface.py @@ -1,9 +1,9 @@ import math -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.rivian.values import DBC +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import RadarInterfaceBase +from iqdbc.car.rivian.values import DBC RADAR_START_ADDR = 0x500 RADAR_MSG_COUNT = 32 diff --git a/opendbc_repo/opendbc/car/rivian/riviancan.py b/iqdbc_repo/iqdbc/car/rivian/riviancan.py similarity index 100% rename from opendbc_repo/opendbc/car/rivian/riviancan.py rename to iqdbc_repo/iqdbc/car/rivian/riviancan.py diff --git a/opendbc_repo/opendbc/car/rivian/tests/__init__.py b/iqdbc_repo/iqdbc/car/rivian/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/rivian/tests/__init__.py rename to iqdbc_repo/iqdbc/car/rivian/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/rivian/tests/test_rivian.py b/iqdbc_repo/iqdbc/car/rivian/tests/test_rivian.py similarity index 83% rename from opendbc_repo/opendbc/car/rivian/tests/test_rivian.py rename to iqdbc_repo/iqdbc/car/rivian/tests/test_rivian.py index 90dcfcd..ec795e9 100644 --- a/opendbc_repo/opendbc/car/rivian/tests/test_rivian.py +++ b/iqdbc_repo/iqdbc/car/rivian/tests/test_rivian.py @@ -1,5 +1,5 @@ -from opendbc.car.rivian.fingerprints import FW_VERSIONS -from opendbc.car.rivian.values import CAR, FW_QUERY_CONFIG, WMI, ModelLine, ModelYear +from iqdbc.car.rivian.fingerprints import FW_VERSIONS +from iqdbc.car.rivian.values import CAR, FW_QUERY_CONFIG, WMI, ModelLine, ModelYear class TestRivian: diff --git a/opendbc_repo/opendbc/car/rivian/values.py b/iqdbc_repo/iqdbc/car/rivian/values.py similarity index 93% rename from opendbc_repo/opendbc/car/rivian/values.py rename to iqdbc_repo/iqdbc/car/rivian/values.py index 7ddfb70..d21eae3 100644 --- a/opendbc_repo/opendbc/car/rivian/values.py +++ b/iqdbc_repo/iqdbc/car/rivian/values.py @@ -1,10 +1,10 @@ from dataclasses import dataclass, field from enum import StrEnum, IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds -from opendbc.car.docs_definitions import CarHarness, CarDocs, CarParts -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 -from opendbc.car.vin import Vin +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds +from iqdbc.car.docs_definitions import CarHarness, CarDocs, CarParts +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 +from iqdbc.car.vin import Vin class WMI(StrEnum): diff --git a/opendbc_repo/opendbc/car/rlog.capnp b/iqdbc_repo/iqdbc/car/rlog.capnp similarity index 100% rename from opendbc_repo/opendbc/car/rlog.capnp rename to iqdbc_repo/iqdbc/car/rlog.capnp diff --git a/opendbc_repo/opendbc/car/secoc.py b/iqdbc_repo/iqdbc/car/secoc.py similarity index 100% rename from opendbc_repo/opendbc/car/secoc.py rename to iqdbc_repo/iqdbc/car/secoc.py diff --git a/opendbc_repo/opendbc/car/structs.py b/iqdbc_repo/iqdbc/car/structs.py similarity index 98% rename from opendbc_repo/opendbc/car/structs.py rename to iqdbc_repo/iqdbc/car/structs.py index 8176c1e..e38cf60 100644 --- a/opendbc_repo/opendbc/car/structs.py +++ b/iqdbc_repo/iqdbc/car/structs.py @@ -3,7 +3,7 @@ from enum import Enum, StrEnum as _StrEnum, auto from typing import dataclass_transform, get_origin import os import capnp -from opendbc.car.common.basedir import BASEDIR +from iqdbc.car.common.basedir import BASEDIR try: from cereal import car except ImportError: diff --git a/opendbc_repo/opendbc/car/subaru/__init__.py b/iqdbc_repo/iqdbc/car/subaru/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/subaru/__init__.py rename to iqdbc_repo/iqdbc/car/subaru/__init__.py diff --git a/opendbc_repo/opendbc/car/subaru/carcontroller.py b/iqdbc_repo/iqdbc/car/subaru/carcontroller.py similarity index 93% rename from opendbc_repo/opendbc/car/subaru/carcontroller.py rename to iqdbc_repo/iqdbc/car/subaru/carcontroller.py index 99c778a..3a78a17 100644 --- a/opendbc_repo/opendbc/car/subaru/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/subaru/carcontroller.py @@ -1,12 +1,12 @@ import numpy as np -from opendbc.can import CANPacker -from opendbc.car import Bus, make_tester_present_msg -from opendbc.car.lateral import apply_driver_steer_torque_limits, common_fault_avoidance -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.subaru import subarucan -from opendbc.car.subaru.values import DBC, GLOBAL_ES_ADDR, CanBus, CarControllerParams, SubaruFlags +from iqdbc.can import CANPacker +from iqdbc.car import Bus, make_tester_present_msg +from iqdbc.car.lateral import apply_driver_steer_torque_limits, common_fault_avoidance +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.subaru import subarucan +from iqdbc.car.subaru.values import DBC, GLOBAL_ES_ADDR, CanBus, CarControllerParams, SubaruFlags -from opendbc.iqpilot.car.subaru.stop_and_go import SnGCarController +from iqdbc.iqpilot.car.subaru.stop_and_go import SnGCarController # FIXME: These limits aren't exact. The real limit is more than likely over a larger time period and # involves the total steering angle change rather than rate, but these limits work well for now diff --git a/opendbc_repo/opendbc/car/subaru/carstate.py b/iqdbc_repo/iqdbc/car/subaru/carstate.py similarity index 94% rename from opendbc_repo/opendbc/car/subaru/carstate.py rename to iqdbc_repo/iqdbc/car/subaru/carstate.py index 195768d..a69c05f 100644 --- a/opendbc_repo/opendbc/car/subaru/carstate.py +++ b/iqdbc_repo/iqdbc/car/subaru/carstate.py @@ -1,13 +1,13 @@ import copy -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarStateBase -from opendbc.car.subaru.values import DBC, CanBus, SubaruFlags -from opendbc.car import CanSignalRateCalculator +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.subaru.values import DBC, CanBus, SubaruFlags +from iqdbc.car import CanSignalRateCalculator -from opendbc.iqpilot.car.subaru.aol import AolCarState -from opendbc.iqpilot.car.subaru.stop_and_go import SnGCarState +from iqdbc.iqpilot.car.subaru.aol import AolCarState +from iqdbc.iqpilot.car.subaru.stop_and_go import SnGCarState class CarState(CarStateBase, AolCarState, SnGCarState): diff --git a/opendbc_repo/opendbc/car/subaru/fingerprints.py b/iqdbc_repo/iqdbc/car/subaru/fingerprints.py similarity index 98% rename from opendbc_repo/opendbc/car/subaru/fingerprints.py rename to iqdbc_repo/iqdbc/car/subaru/fingerprints.py index db73598..8cc65a1 100644 --- a/opendbc_repo/opendbc/car/subaru/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/subaru/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.subaru.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.subaru.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/subaru/interface.py b/iqdbc_repo/iqdbc/car/subaru/interface.py similarity index 93% rename from opendbc_repo/opendbc/car/subaru/interface.py rename to iqdbc_repo/iqdbc/car/subaru/interface.py index 8f5951c..9cf2f83 100644 --- a/opendbc_repo/opendbc/car/subaru/interface.py +++ b/iqdbc_repo/iqdbc/car/subaru/interface.py @@ -1,9 +1,9 @@ -from opendbc.car import get_safety_config, structs, uds -from opendbc.car.disable_ecu import disable_ecu -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.subaru.carcontroller import CarController -from opendbc.car.subaru.carstate import CarState -from opendbc.car.subaru.values import CAR, GLOBAL_ES_ADDR, SubaruFlags, SubaruSafetyFlags +from iqdbc.car import get_safety_config, structs, uds +from iqdbc.car.disable_ecu import disable_ecu +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.subaru.carcontroller import CarController +from iqdbc.car.subaru.carstate import CarState +from iqdbc.car.subaru.values import CAR, GLOBAL_ES_ADDR, SubaruFlags, SubaruSafetyFlags class CarInterface(CarInterfaceBase): diff --git a/opendbc_repo/opendbc/car/subaru/subarucan.py b/iqdbc_repo/iqdbc/car/subaru/subarucan.py similarity index 99% rename from opendbc_repo/opendbc/car/subaru/subarucan.py rename to iqdbc_repo/iqdbc/car/subaru/subarucan.py index 09b552a..932dff0 100644 --- a/opendbc_repo/opendbc/car/subaru/subarucan.py +++ b/iqdbc_repo/iqdbc/car/subaru/subarucan.py @@ -1,5 +1,5 @@ -from opendbc.car import structs -from opendbc.car.subaru.values import CanBus +from iqdbc.car import structs +from iqdbc.car.subaru.values import CanBus VisualAlert = structs.CarControl.HUDControl.VisualAlert diff --git a/opendbc_repo/opendbc/car/subaru/tests/__init__.py b/iqdbc_repo/iqdbc/car/subaru/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/subaru/tests/__init__.py rename to iqdbc_repo/iqdbc/car/subaru/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/subaru/tests/test_subaru.py b/iqdbc_repo/iqdbc/car/subaru/tests/test_subaru.py similarity index 84% rename from opendbc_repo/opendbc/car/subaru/tests/test_subaru.py rename to iqdbc_repo/iqdbc/car/subaru/tests/test_subaru.py index 7f3d9bb..142705b 100644 --- a/opendbc_repo/opendbc/car/subaru/tests/test_subaru.py +++ b/iqdbc_repo/iqdbc/car/subaru/tests/test_subaru.py @@ -1,4 +1,4 @@ -from opendbc.car.subaru.fingerprints import FW_VERSIONS +from iqdbc.car.subaru.fingerprints import FW_VERSIONS class TestSubaruFingerprint: diff --git a/opendbc_repo/opendbc/car/subaru/values.py b/iqdbc_repo/iqdbc/car/subaru/values.py similarity index 96% rename from opendbc_repo/opendbc/car/subaru/values.py rename to iqdbc_repo/iqdbc/car/subaru/values.py index 0d1ac87..88ef056 100644 --- a/opendbc_repo/opendbc/car/subaru/values.py +++ b/iqdbc_repo/iqdbc/car/subaru/values.py @@ -1,10 +1,10 @@ from dataclasses import dataclass, field from enum import Enum, IntFlag -from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 +from iqdbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/tesla/__init__.py b/iqdbc_repo/iqdbc/car/tesla/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/tesla/__init__.py rename to iqdbc_repo/iqdbc/car/tesla/__init__.py diff --git a/opendbc_repo/opendbc/car/tesla/carcontroller.py b/iqdbc_repo/iqdbc/car/tesla/carcontroller.py similarity index 87% rename from opendbc_repo/opendbc/car/tesla/carcontroller.py rename to iqdbc_repo/iqdbc/car/tesla/carcontroller.py index 6ec042e..df117c3 100644 --- a/opendbc_repo/opendbc/car/tesla/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/tesla/carcontroller.py @@ -1,19 +1,19 @@ import numpy as np -from opendbc.can import CANPacker -from opendbc.car import Bus -from opendbc.car.lateral import apply_steer_angle_limits_vm -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.tesla.teslacan import TeslaCAN -from opendbc.car.tesla.values import CarControllerParams -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.can import CANPacker +from iqdbc.car import Bus +from iqdbc.car.lateral import apply_steer_angle_limits_vm +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.tesla.teslacan import TeslaCAN +from iqdbc.car.tesla.values import CarControllerParams +from iqdbc.car.vehicle_model import VehicleModel from openpilot.iqpilot.selfdrive.car.enhanced_stock_longitudinal_control import get_set_speed_kph_from_params -from opendbc.iqpilot.car.tesla.coop_steering import CoopSteeringCarController +from iqdbc.iqpilot.car.tesla.coop_steering import CoopSteeringCarController def get_safety_CP(): # We use the TESLA_MODEL_Y platform for lateral limiting to match safety # A Model 3 at 40 m/s using the Model Y limits sees a <0.3% difference in max angle (from curvature factor) - from opendbc.car.tesla.interface import CarInterface + from iqdbc.car.tesla.interface import CarInterface return CarInterface.get_non_essential_params("TESLA_MODEL_Y") diff --git a/opendbc_repo/opendbc/car/tesla/carstate.py b/iqdbc_repo/iqdbc/car/tesla/carstate.py similarity index 95% rename from opendbc_repo/opendbc/car/tesla/carstate.py rename to iqdbc_repo/iqdbc/car/tesla/carstate.py index 6b17028..230a836 100644 --- a/opendbc_repo/opendbc/car/tesla/carstate.py +++ b/iqdbc_repo/iqdbc/car/tesla/carstate.py @@ -1,13 +1,13 @@ import copy -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs -from opendbc.car.carlog import carlog -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.interfaces import CarStateBase -from opendbc.car.tesla.teslacan import get_steer_ctrl_type -from opendbc.car.tesla.values import DBC, CANBUS, GEAR_MAP, STEER_THRESHOLD, TeslaFlags +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.car.carlog import carlog +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.tesla.teslacan import get_steer_ctrl_type +from iqdbc.car.tesla.values import DBC, CANBUS, GEAR_MAP, STEER_THRESHOLD, TeslaFlags -from opendbc.iqpilot.car.tesla.carstate_ext import CarStateExt +from iqdbc.iqpilot.car.tesla.carstate_ext import CarStateExt ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/car/tesla/fingerprints.py b/iqdbc_repo/iqdbc/car/tesla/fingerprints.py similarity index 91% rename from opendbc_repo/opendbc/car/tesla/fingerprints.py rename to iqdbc_repo/iqdbc/car/tesla/fingerprints.py index 39b6e67..21975ff 100644 --- a/opendbc_repo/opendbc/car/tesla/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/tesla/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.tesla.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.tesla.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/tesla/interface.py b/iqdbc_repo/iqdbc/car/tesla/interface.py similarity index 83% rename from opendbc_repo/opendbc/car/tesla/interface.py rename to iqdbc_repo/iqdbc/car/tesla/interface.py index 4a48996..9aac45b 100644 --- a/opendbc_repo/opendbc/car/tesla/interface.py +++ b/iqdbc_repo/iqdbc/car/tesla/interface.py @@ -1,11 +1,11 @@ -from opendbc.car import Bus, get_safety_config, structs -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.tesla.carcontroller import CarController -from opendbc.car.tesla.carstate import CarState -from opendbc.car.tesla.values import TeslaSafetyFlags, TeslaFlags, CANBUS, CAR, DBC, FSD_14_FW, Ecu -from opendbc.car.tesla.radar_interface import RadarInterface, RADAR_START_ADDR +from iqdbc.car import Bus, get_safety_config, structs +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.tesla.carcontroller import CarController +from iqdbc.car.tesla.carstate import CarState +from iqdbc.car.tesla.values import TeslaSafetyFlags, TeslaFlags, CANBUS, CAR, DBC, FSD_14_FW, Ecu +from iqdbc.car.tesla.radar_interface import RadarInterface, RADAR_START_ADDR -from opendbc.iqpilot.car.tesla.values import TeslaFlagsIQ, TeslaSafetyFlagsIQ +from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ, TeslaSafetyFlagsIQ class CarInterface(CarInterfaceBase): diff --git a/opendbc_repo/opendbc/car/tesla/radar_interface.py b/iqdbc_repo/iqdbc/car/tesla/radar_interface.py similarity index 93% rename from opendbc_repo/opendbc/car/tesla/radar_interface.py rename to iqdbc_repo/iqdbc/car/tesla/radar_interface.py index 8799a28..d21d022 100644 --- a/opendbc_repo/opendbc/car/tesla/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/tesla/radar_interface.py @@ -1,7 +1,7 @@ -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.tesla.values import DBC +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import RadarInterfaceBase +from iqdbc.car.tesla.values import DBC RADAR_START_ADDR = 0x410 RADAR_MSG_COUNT = 80 # 40 points * 2 messages each diff --git a/opendbc_repo/opendbc/car/tesla/teslacan.py b/iqdbc_repo/iqdbc/car/tesla/teslacan.py similarity index 91% rename from opendbc_repo/opendbc/car/tesla/teslacan.py rename to iqdbc_repo/iqdbc/car/tesla/teslacan.py index d973a72..68e4734 100644 --- a/opendbc_repo/opendbc/car/tesla/teslacan.py +++ b/iqdbc_repo/iqdbc/car/tesla/teslacan.py @@ -1,6 +1,6 @@ -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.tesla.values import CANBUS, CarControllerParams, TeslaFlags -from opendbc.car import DT_CTRL +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.tesla.values import CANBUS, CarControllerParams, TeslaFlags +from iqdbc.car import DT_CTRL def get_steer_ctrl_type(flags: int, ctrl_type: int) -> int: @@ -31,7 +31,7 @@ class TeslaCAN: return self.packer.make_can_msg("DAS_steeringControl", CANBUS.party, values) def create_longitudinal_command(self, acc_state, accel, counter, v_ego, active, cruise_override, set_speed_kph=None): - from opendbc.car.interfaces import V_CRUISE_MAX + from iqdbc.car.interfaces import V_CRUISE_MAX set_speed = max(v_ego * CV.MS_TO_KPH, 0) self.l_jerk = 0.0 diff --git a/opendbc_repo/opendbc/car/tesla/tests/__init__.py b/iqdbc_repo/iqdbc/car/tesla/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/tesla/tests/__init__.py rename to iqdbc_repo/iqdbc/car/tesla/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/tesla/tests/test_tesla.py b/iqdbc_repo/iqdbc/car/tesla/tests/test_tesla.py similarity index 92% rename from opendbc_repo/opendbc/car/tesla/tests/test_tesla.py rename to iqdbc_repo/iqdbc/car/tesla/tests/test_tesla.py index 2d9610e..b36db0d 100644 --- a/opendbc_repo/opendbc/car/tesla/tests/test_tesla.py +++ b/iqdbc_repo/iqdbc/car/tesla/tests/test_tesla.py @@ -1,9 +1,9 @@ -from opendbc.car import gen_empty_fingerprint, structs -from opendbc.car.tesla.interface import CarInterface -from opendbc.car.tesla.teslacan import TeslaCAN -from opendbc.car.tesla.radar_interface import RADAR_START_ADDR -from opendbc.car.tesla.carcontroller import CarController -from opendbc.car.tesla.values import CAR +from iqdbc.car import gen_empty_fingerprint, structs +from iqdbc.car.tesla.interface import CarInterface +from iqdbc.car.tesla.teslacan import TeslaCAN +from iqdbc.car.tesla.radar_interface import RADAR_START_ADDR +from iqdbc.car.tesla.carcontroller import CarController +from iqdbc.car.tesla.values import CAR class TestTeslaFingerprint: diff --git a/opendbc_repo/opendbc/car/tesla/values.py b/iqdbc_repo/iqdbc/car/tesla/values.py similarity index 92% rename from opendbc_repo/opendbc/car/tesla/values.py rename to iqdbc_repo/iqdbc/car/tesla/values.py index d6310c7..641b744 100644 --- a/opendbc_repo/opendbc/car/tesla/values.py +++ b/iqdbc_repo/iqdbc/car/tesla/values.py @@ -1,10 +1,10 @@ from dataclasses import dataclass, field from enum import Enum, IntFlag -from opendbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, CarSpecs, DbcDict, PlatformConfig, Platforms -from opendbc.car.lateral import AngleSteeringLimits, ISO_LATERAL_ACCEL -from opendbc.car.structs import CarParams, CarState -from opendbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column, SupportType -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, CarSpecs, DbcDict, PlatformConfig, Platforms +from iqdbc.car.lateral import AngleSteeringLimits, ISO_LATERAL_ACCEL +from iqdbc.car.structs import CarParams, CarState +from iqdbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column, SupportType +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/tests/__init__.py b/iqdbc_repo/iqdbc/car/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/tests/__init__.py rename to iqdbc_repo/iqdbc/car/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/tests/car_diff.py b/iqdbc_repo/iqdbc/car/tests/car_diff.py similarity index 97% rename from opendbc_repo/opendbc/car/tests/car_diff.py rename to iqdbc_repo/iqdbc/car/tests/car_diff.py index deea788..dd16eba 100755 --- a/opendbc_repo/opendbc/car/tests/car_diff.py +++ b/iqdbc_repo/iqdbc/car/tests/car_diff.py @@ -16,10 +16,10 @@ from pathlib import Path from typing import Any -from opendbc.car import structs -from opendbc.car.can_definitions import CanData -from opendbc.car.car_helpers import can_fingerprint, interfaces -from opendbc.car.logreader import LogReader, decompress_stream +from iqdbc.car import structs +from iqdbc.car.can_definitions import CanData +from iqdbc.car.car_helpers import can_fingerprint, interfaces +from iqdbc.car.logreader import LogReader, decompress_stream TOLERANCE = 1e-4 @@ -114,7 +114,7 @@ def get_changed_platforms(cwd: Path, database: dict[str, Any], interfaces: dict[ git_ref = os.environ.get("GIT_REF", "origin/master") changed = subprocess.check_output(["git", "diff", "--name-only", f"{git_ref}...HEAD"], cwd=cwd, encoding='utf8').strip() brands = set() - patterns = [r"opendbc/car/(\w+)/", r"opendbc/dbc/(\w+?)_", r"opendbc/dbc/generator/(\w+)", r"opendbc/safety/modes/(\w+?)[_.]"] + patterns = [r"iqdbc/car/(\w+)/", r"iqdbc/dbc/(\w+?)_", r"iqdbc/dbc/generator/(\w+)", r"iqdbc/safety/modes/(\w+?)[_.]"] for line in changed.splitlines(): for pattern in patterns: m = re.search(pattern, line) diff --git a/opendbc_repo/opendbc/car/tests/routes.py b/iqdbc_repo/iqdbc/car/tests/routes.py similarity index 97% rename from opendbc_repo/opendbc/car/tests/routes.py rename to iqdbc_repo/iqdbc/car/tests/routes.py index 66ce7b8..398d0e6 100644 --- a/opendbc_repo/opendbc/car/tests/routes.py +++ b/iqdbc_repo/iqdbc/car/tests/routes.py @@ -1,21 +1,21 @@ from typing import NamedTuple -from opendbc.car.chrysler.values import CAR as CHRYSLER -from opendbc.car.gm.values import CAR as GM -from opendbc.car.ford.values import CAR as FORD -from opendbc.car.honda.values import CAR as HONDA -from opendbc.car.hyundai.values import CAR as HYUNDAI -from opendbc.car.nissan.values import CAR as NISSAN -from opendbc.car.mazda.values import CAR as MAZDA -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.rivian.values import CAR as RIVIAN -from opendbc.car.subaru.values import CAR as SUBARU -from opendbc.car.tesla.values import CAR as TESLA -from opendbc.car.toyota.values import CAR as TOYOTA -from opendbc.car.values import Platform -from opendbc.car.volkswagen.values import CAR as VOLKSWAGEN -from opendbc.car.body.values import CAR as COMMA -from opendbc.car.psa.values import CAR as PSA +from iqdbc.car.chrysler.values import CAR as CHRYSLER +from iqdbc.car.gm.values import CAR as GM +from iqdbc.car.ford.values import CAR as FORD +from iqdbc.car.honda.values import CAR as HONDA +from iqdbc.car.hyundai.values import CAR as HYUNDAI +from iqdbc.car.nissan.values import CAR as NISSAN +from iqdbc.car.mazda.values import CAR as MAZDA +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.rivian.values import CAR as RIVIAN +from iqdbc.car.subaru.values import CAR as SUBARU +from iqdbc.car.tesla.values import CAR as TESLA +from iqdbc.car.toyota.values import CAR as TOYOTA +from iqdbc.car.values import Platform +from iqdbc.car.volkswagen.values import CAR as VOLKSWAGEN +from iqdbc.car.body.values import CAR as COMMA +from iqdbc.car.psa.values import CAR as PSA # FIXME: add routes for these cars non_tested_cars = [ diff --git a/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py b/iqdbc_repo/iqdbc/car/tests/test_can_fingerprint.py similarity index 91% rename from opendbc_repo/opendbc/car/tests/test_can_fingerprint.py rename to iqdbc_repo/iqdbc/car/tests/test_can_fingerprint.py index 30dba60..77ffcdf 100644 --- a/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py +++ b/iqdbc_repo/iqdbc/car/tests/test_can_fingerprint.py @@ -1,7 +1,7 @@ import pytest -from opendbc.car.can_definitions import CanData -from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint -from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS +from iqdbc.car.can_definitions import CanData +from iqdbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint +from iqdbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS class TestCanFingerprint: diff --git a/opendbc_repo/opendbc/car/tests/test_car_interfaces.py b/iqdbc_repo/iqdbc/car/tests/test_car_interfaces.py similarity index 94% rename from opendbc_repo/opendbc/car/tests/test_car_interfaces.py rename to iqdbc_repo/iqdbc/car/tests/test_car_interfaces.py index a1a87ff..7825cc2 100644 --- a/opendbc_repo/opendbc/car/tests/test_car_interfaces.py +++ b/iqdbc_repo/iqdbc/car/tests/test_car_interfaces.py @@ -7,13 +7,13 @@ from hypothesis import Phase, given, settings from collections.abc import Callable from typing import Any -from opendbc.car import DT_CTRL, CanData, structs -from opendbc.car.car_helpers import interfaces -from opendbc.car.fingerprints import FW_VERSIONS -from opendbc.car.fw_versions import FW_QUERY_CONFIGS -from opendbc.car.interfaces import CarInterfaceBase, get_interface_attr -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.values import PLATFORMS +from iqdbc.car import DT_CTRL, CanData, structs +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.fingerprints import FW_VERSIONS +from iqdbc.car.fw_versions import FW_QUERY_CONFIGS +from iqdbc.car.interfaces import CarInterfaceBase, get_interface_attr +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.values import PLATFORMS DrawType = Callable[[st.SearchStrategy], Any] diff --git a/opendbc_repo/opendbc/car/tests/test_docs.py b/iqdbc_repo/iqdbc/car/tests/test_docs.py similarity index 92% rename from opendbc_repo/opendbc/car/tests/test_docs.py rename to iqdbc_repo/iqdbc/car/tests/test_docs.py index 940f117..f4f91d2 100644 --- a/opendbc_repo/opendbc/car/tests/test_docs.py +++ b/iqdbc_repo/iqdbc/car/tests/test_docs.py @@ -1,11 +1,11 @@ from collections import defaultdict import pytest -from opendbc.car.car_helpers import interfaces -from opendbc.car.docs import get_all_car_docs -from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType -from opendbc.car.honda.values import CAR as HONDA -from opendbc.car.values import PLATFORMS +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.docs import get_all_car_docs +from iqdbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType +from iqdbc.car.honda.values import CAR as HONDA +from iqdbc.car.values import PLATFORMS class TestCarDocs: diff --git a/opendbc_repo/opendbc/car/tests/test_fw_fingerprint.py b/iqdbc_repo/iqdbc/car/tests/test_fw_fingerprint.py similarity index 95% rename from opendbc_repo/opendbc/car/tests/test_fw_fingerprint.py rename to iqdbc_repo/iqdbc/car/tests/test_fw_fingerprint.py index 08e8cf8..cd84fae 100644 --- a/opendbc_repo/opendbc/car/tests/test_fw_fingerprint.py +++ b/iqdbc_repo/iqdbc/car/tests/test_fw_fingerprint.py @@ -3,13 +3,13 @@ import random import time from collections import defaultdict -from opendbc.car.can_definitions import CanData -from opendbc.car.car_helpers import interfaces -from opendbc.car.structs import CarParams -from opendbc.car.fingerprints import FW_VERSIONS -from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZZY_EXCLUDE_ECUS, VERSIONS, build_fw_dict, \ +from iqdbc.car.can_definitions import CanData +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.structs import CarParams +from iqdbc.car.fingerprints import FW_VERSIONS +from iqdbc.car.fw_versions import FW_QUERY_CONFIGS, FUZZY_EXCLUDE_ECUS, VERSIONS, build_fw_dict, \ match_fw_to_car, get_brand_ecu_matches, get_fw_versions, get_present_ecus -from opendbc.car.vin import get_vin +from iqdbc.car.vin import get_vin CarFw = CarParams.CarFw Ecu = CarParams.Ecu @@ -218,7 +218,7 @@ class TestFwFingerprintTiming: def _benchmark_brand(self, brand, num_pandas, mocker): self.total_time = 0 - mocker.patch("opendbc.car.isotp_parallel_query.IsoTpParallelQuery.get_data", self.fake_get_data) + mocker.patch("iqdbc.car.isotp_parallel_query.IsoTpParallelQuery.get_data", self.fake_get_data) for _ in range(self.N): # Treat each brand as the most likely (aka, the first) brand with OBD multiplexing initially on self.current_obd_multiplexing = True @@ -243,7 +243,7 @@ class TestFwFingerprintTiming: return set() self.total_time = 0.0 - mocker.patch("opendbc.car.fw_versions.get_ecu_addrs", fake_get_ecu_addrs) + mocker.patch("iqdbc.car.fw_versions.get_ecu_addrs", fake_get_ecu_addrs) for _ in range(self.N): self.current_obd_multiplexing = True get_present_ecus(self.fake_can_recv, self.fake_can_send, self.fake_set_obd_multiplexing, num_pandas=2) @@ -253,7 +253,7 @@ class TestFwFingerprintTiming: for name, args in (('worst', {}), ('best', {'retry': 1})): with subtests.test(name=name): self.total_time = 0.0 - mocker.patch("opendbc.car.isotp_parallel_query.IsoTpParallelQuery.get_data", self.fake_get_data) + mocker.patch("iqdbc.car.isotp_parallel_query.IsoTpParallelQuery.get_data", self.fake_get_data) for _ in range(self.N): get_vin(self.fake_can_recv, self.fake_can_send, (0, 1), **args) self._assert_timing(self.total_time / self.N, vin_ref_times[name]) @@ -321,7 +321,7 @@ class TestFwFingerprintTiming: t += 0.0001 return t - mocker.patch("opendbc.car.carlog.carlog.exception", fake_carlog_exception) + mocker.patch("iqdbc.car.carlog.carlog.exception", fake_carlog_exception) mocker.patch("time.monotonic", fake_monotonic) for brand in FW_QUERY_CONFIGS.keys(): with subtests.test(brand=brand): diff --git a/opendbc_repo/opendbc/car/tests/test_lateral_limits.py b/iqdbc_repo/iqdbc/car/tests/test_lateral_limits.py similarity index 91% rename from opendbc_repo/opendbc/car/tests/test_lateral_limits.py rename to iqdbc_repo/iqdbc/car/tests/test_lateral_limits.py index 42195dd..36a5d11 100755 --- a/opendbc_repo/opendbc/car/tests/test_lateral_limits.py +++ b/iqdbc_repo/iqdbc/car/tests/test_lateral_limits.py @@ -5,11 +5,11 @@ from parameterized import parameterized_class import pytest import sys -from opendbc.car import DT_CTRL -from opendbc.car.car_helpers import interfaces -from opendbc.car.interfaces import get_torque_params -from opendbc.car.lateral import ISO_LATERAL_ACCEL -from opendbc.car.values import PLATFORMS +from iqdbc.car import DT_CTRL +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.interfaces import get_torque_params +from iqdbc.car.lateral import ISO_LATERAL_ACCEL +from iqdbc.car.values import PLATFORMS # ISO 11270 - allowed up jerk is strictly lower than recommended limits MAX_LAT_JERK_UP = 2.5 # m/s^3 @@ -40,7 +40,7 @@ class TestLateralLimits: if CP.notCar: pytest.skip() - CarControllerParams = importlib.import_module(f'opendbc.car.{CP.brand}.values').CarControllerParams + CarControllerParams = importlib.import_module(f'iqdbc.car.{CP.brand}.values').CarControllerParams cls.control_params = CarControllerParams(CP) cls.torque_params = get_torque_params()[cls.car_model] diff --git a/opendbc_repo/opendbc/car/tests/test_platform_configs.py b/iqdbc_repo/iqdbc/car/tests/test_platform_configs.py similarity index 91% rename from opendbc_repo/opendbc/car/tests/test_platform_configs.py rename to iqdbc_repo/iqdbc/car/tests/test_platform_configs.py index 1704621..7c3fc7f 100644 --- a/opendbc_repo/opendbc/car/tests/test_platform_configs.py +++ b/iqdbc_repo/iqdbc/car/tests/test_platform_configs.py @@ -1,4 +1,4 @@ -from opendbc.car.values import PLATFORMS +from iqdbc.car.values import PLATFORMS class TestPlatformConfigs: diff --git a/opendbc_repo/opendbc/car/tests/test_routes.py b/iqdbc_repo/iqdbc/car/tests/test_routes.py similarity index 55% rename from opendbc_repo/opendbc/car/tests/test_routes.py rename to iqdbc_repo/iqdbc/car/tests/test_routes.py index 9217690..e3619d5 100644 --- a/opendbc_repo/opendbc/car/tests/test_routes.py +++ b/iqdbc_repo/iqdbc/car/tests/test_routes.py @@ -1,11 +1,11 @@ import pytest -from opendbc.car.values import PLATFORMS -from opendbc.car.tests.routes import non_tested_cars, routes +from iqdbc.car.values import PLATFORMS +from iqdbc.car.tests.routes import non_tested_cars, routes @pytest.mark.parametrize("platform", PLATFORMS.keys()) def test_test_route_present(platform): tested_platforms = [r.car_model for r in routes] assert platform in set(tested_platforms) | set(non_tested_cars), \ - f"Missing test route for {platform}. Add a route to opendbc/car/tests/routes.py" + f"Missing test route for {platform}. Add a route to iqdbc/car/tests/routes.py" diff --git a/opendbc_repo/opendbc/car/tests/test_vehicle_model.py b/iqdbc_repo/iqdbc/car/tests/test_vehicle_model.py similarity index 92% rename from opendbc_repo/opendbc/car/tests/test_vehicle_model.py rename to iqdbc_repo/iqdbc/car/tests/test_vehicle_model.py index b88a8da..a35463a 100644 --- a/opendbc_repo/opendbc/car/tests/test_vehicle_model.py +++ b/iqdbc_repo/iqdbc/car/tests/test_vehicle_model.py @@ -3,9 +3,9 @@ import math import numpy as np -from opendbc.car.honda.interface import CarInterface -from opendbc.car.honda.values import CAR -from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices +from iqdbc.car.honda.interface import CarInterface +from iqdbc.car.honda.values import CAR +from iqdbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices class TestVehicleModel: diff --git a/opendbc_repo/opendbc/car/torque_data/override.toml b/iqdbc_repo/iqdbc/car/torque_data/override.toml similarity index 100% rename from opendbc_repo/opendbc/car/torque_data/override.toml rename to iqdbc_repo/iqdbc/car/torque_data/override.toml diff --git a/opendbc_repo/opendbc/car/torque_data/params.toml b/iqdbc_repo/iqdbc/car/torque_data/params.toml similarity index 100% rename from opendbc_repo/opendbc/car/torque_data/params.toml rename to iqdbc_repo/iqdbc/car/torque_data/params.toml diff --git a/opendbc_repo/opendbc/car/torque_data/substitute.toml b/iqdbc_repo/iqdbc/car/torque_data/substitute.toml similarity index 100% rename from opendbc_repo/opendbc/car/torque_data/substitute.toml rename to iqdbc_repo/iqdbc/car/torque_data/substitute.toml diff --git a/opendbc_repo/opendbc/car/toyota/__init__.py b/iqdbc_repo/iqdbc/car/toyota/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/toyota/__init__.py rename to iqdbc_repo/iqdbc/car/toyota/__init__.py diff --git a/opendbc_repo/opendbc/car/toyota/carcontroller.py b/iqdbc_repo/iqdbc/car/toyota/carcontroller.py similarity index 95% rename from opendbc_repo/opendbc/car/toyota/carcontroller.py rename to iqdbc_repo/iqdbc/car/toyota/carcontroller.py index 30ea0fd..fa5c9f6 100644 --- a/opendbc_repo/opendbc/car/toyota/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/toyota/carcontroller.py @@ -1,20 +1,20 @@ import math import numpy as np -from opendbc.car import Bus, make_tester_present_msg, rate_limit, structs, ACCELERATION_DUE_TO_GRAVITY, DT_CTRL -from opendbc.car.lateral import apply_meas_steer_torque_limits, apply_std_steer_angle_limits, common_fault_avoidance -from opendbc.car.carlog import carlog -from opendbc.car.common.filter_simple import FirstOrderFilter, HighPassFilter -from opendbc.car.common.pid import PIDController -from opendbc.car.secoc import add_mac, build_sync_mac -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.toyota import toyotacan -from opendbc.car.toyota.values import CAR, NO_STOP_TIMER_CAR, TSS2_CAR, \ +from iqdbc.car import Bus, make_tester_present_msg, rate_limit, structs, ACCELERATION_DUE_TO_GRAVITY, DT_CTRL +from iqdbc.car.lateral import apply_meas_steer_torque_limits, apply_std_steer_angle_limits, common_fault_avoidance +from iqdbc.car.carlog import carlog +from iqdbc.car.common.filter_simple import FirstOrderFilter, HighPassFilter +from iqdbc.car.common.pid import PIDController +from iqdbc.car.secoc import add_mac, build_sync_mac +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.toyota import toyotacan +from iqdbc.car.toyota.values import CAR, NO_STOP_TIMER_CAR, TSS2_CAR, \ CarControllerParams, ToyotaFlags, \ UNSUPPORTED_DSU_CAR -from opendbc.can import CANPacker +from iqdbc.can import CANPacker -from opendbc.iqpilot.car.toyota.gas_interceptor import GasInterceptorCarController -from opendbc.iqpilot.car.toyota.values import ToyotaFlagsIQ +from iqdbc.iqpilot.car.toyota.gas_interceptor import GasInterceptorCarController +from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ Ecu = structs.CarParams.Ecu LongCtrlState = structs.CarControl.Actuators.LongControlState diff --git a/opendbc_repo/opendbc/car/toyota/carstate.py b/iqdbc_repo/iqdbc/car/toyota/carstate.py similarity index 95% rename from opendbc_repo/opendbc/car/toyota/carstate.py rename to iqdbc_repo/iqdbc/car/toyota/carstate.py index d67513e..fc95f41 100644 --- a/opendbc_repo/opendbc/car/toyota/carstate.py +++ b/iqdbc_repo/iqdbc/car/toyota/carstate.py @@ -1,15 +1,15 @@ import copy -from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, DT_CTRL, create_button_events, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.common.filter_simple import FirstOrderFilter -from opendbc.car.interfaces import CarStateBase -from opendbc.car.toyota.values import ToyotaFlags, CAR, DBC, STEER_THRESHOLD, NO_STOP_TIMER_CAR, \ +from iqdbc.can import CANDefine, CANParser +from iqdbc.car import Bus, DT_CTRL, create_button_events, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.common.filter_simple import FirstOrderFilter +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.toyota.values import ToyotaFlags, CAR, DBC, STEER_THRESHOLD, NO_STOP_TIMER_CAR, \ TSS2_CAR, RADAR_ACC_CAR, EPS_SCALE, UNSUPPORTED_DSU_CAR, \ SECOC_CAR -from opendbc.iqpilot.car.toyota.carstate_ext import CarStateExt -from opendbc.iqpilot.car.toyota.values import ToyotaFlagsIQ +from iqdbc.iqpilot.car.toyota.carstate_ext import CarStateExt +from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ ButtonType = structs.CarState.ButtonEvent.Type SteerControlType = structs.CarParams.SteerControlType diff --git a/opendbc_repo/opendbc/car/toyota/fingerprints.py b/iqdbc_repo/iqdbc/car/toyota/fingerprints.py similarity index 99% rename from opendbc_repo/opendbc/car/toyota/fingerprints.py rename to iqdbc_repo/iqdbc/car/toyota/fingerprints.py index 81ef985..3f1348a 100644 --- a/opendbc_repo/opendbc/car/toyota/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/toyota/fingerprints.py @@ -1,9 +1,9 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.toyota.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.toyota.values import CAR -from opendbc.iqpilot.car.fingerprints_ext import merge_fw_versions -from opendbc.iqpilot.car.toyota.fingerprints_ext import FW_VERSIONS_EXT +from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions +from iqdbc.iqpilot.car.toyota.fingerprints_ext import FW_VERSIONS_EXT Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/toyota/interface.py b/iqdbc_repo/iqdbc/car/toyota/interface.py similarity index 94% rename from opendbc_repo/opendbc/car/toyota/interface.py rename to iqdbc_repo/iqdbc/car/toyota/interface.py index 73fdec2..c1f4e96 100644 --- a/opendbc_repo/opendbc/car/toyota/interface.py +++ b/iqdbc_repo/iqdbc/car/toyota/interface.py @@ -1,13 +1,13 @@ -from opendbc.car import Bus, structs, get_safety_config, uds -from opendbc.car.toyota.carstate import CarState -from opendbc.car.toyota.carcontroller import CarController -from opendbc.car.toyota.radar_interface import RadarInterface -from opendbc.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, NO_DSU_CAR, \ +from iqdbc.car import Bus, structs, get_safety_config, uds +from iqdbc.car.toyota.carstate import CarState +from iqdbc.car.toyota.carcontroller import CarController +from iqdbc.car.toyota.radar_interface import RadarInterface +from iqdbc.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, NO_DSU_CAR, \ MIN_ACC_SPEED, EPS_SCALE, NO_STOP_TIMER_CAR, ANGLE_CONTROL_CAR, \ ToyotaSafetyFlags, UNSUPPORTED_DSU_CAR -from opendbc.car.disable_ecu import disable_ecu -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.iqpilot.car.toyota.values import ToyotaFlagsIQ, ToyotaSafetyFlagsIQ +from iqdbc.car.disable_ecu import disable_ecu +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ, ToyotaSafetyFlagsIQ SteerControlType = structs.CarParams.SteerControlType diff --git a/opendbc_repo/opendbc/car/toyota/radar_interface.py b/iqdbc_repo/iqdbc/car/toyota/radar_interface.py similarity index 93% rename from opendbc_repo/opendbc/car/toyota/radar_interface.py rename to iqdbc_repo/iqdbc/car/toyota/radar_interface.py index 59795ca..1b63c40 100755 --- a/opendbc_repo/opendbc/car/toyota/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/toyota/radar_interface.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -from opendbc.can import CANParser -from opendbc.car import Bus -from opendbc.car.structs import RadarData -from opendbc.car.toyota.values import DBC, TSS2_CAR -from opendbc.car.interfaces import RadarInterfaceBase +from iqdbc.can import CANParser +from iqdbc.car import Bus +from iqdbc.car.structs import RadarData +from iqdbc.car.toyota.values import DBC, TSS2_CAR +from iqdbc.car.interfaces import RadarInterfaceBase def _create_radar_can_parser(car_fingerprint): diff --git a/opendbc_repo/opendbc/car/toyota/tests/__init__.py b/iqdbc_repo/iqdbc/car/toyota/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/toyota/tests/__init__.py rename to iqdbc_repo/iqdbc/car/toyota/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/toyota/tests/print_platform_codes.py b/iqdbc_repo/iqdbc/car/toyota/tests/print_platform_codes.py similarity index 89% rename from opendbc_repo/opendbc/car/toyota/tests/print_platform_codes.py rename to iqdbc_repo/iqdbc/car/toyota/tests/print_platform_codes.py index 333e7dc..3e86ca0 100755 --- a/opendbc_repo/opendbc/car/toyota/tests/print_platform_codes.py +++ b/iqdbc_repo/iqdbc/car/toyota/tests/print_platform_codes.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from collections import defaultdict -from opendbc.car.toyota.values import PLATFORM_CODE_ECUS, get_platform_codes -from opendbc.car.toyota.fingerprints import FW_VERSIONS +from iqdbc.car.toyota.values import PLATFORM_CODE_ECUS, get_platform_codes +from iqdbc.car.toyota.fingerprints import FW_VERSIONS if __name__ == "__main__": parts_for_ecu: dict = defaultdict(set) diff --git a/opendbc_repo/opendbc/car/toyota/tests/test_toyota.py b/iqdbc_repo/iqdbc/car/toyota/tests/test_toyota.py similarity index 96% rename from opendbc_repo/opendbc/car/toyota/tests/test_toyota.py rename to iqdbc_repo/iqdbc/car/toyota/tests/test_toyota.py index 5ab47f3..571ed78 100644 --- a/opendbc_repo/opendbc/car/toyota/tests/test_toyota.py +++ b/iqdbc_repo/iqdbc/car/toyota/tests/test_toyota.py @@ -1,10 +1,10 @@ from hypothesis import given, settings, strategies as st -from opendbc.car import Bus -from opendbc.car.structs import CarParams -from opendbc.car.fw_versions import build_fw_dict -from opendbc.car.toyota.fingerprints import FW_VERSIONS -from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC_CAR, SECOC_CAR, \ +from iqdbc.car import Bus +from iqdbc.car.structs import CarParams +from iqdbc.car.fw_versions import build_fw_dict +from iqdbc.car.toyota.fingerprints import FW_VERSIONS +from iqdbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC_CAR, SECOC_CAR, \ FW_QUERY_CONFIG, PLATFORM_CODE_ECUS, FUZZY_EXCLUDED_PLATFORMS, \ get_platform_codes diff --git a/opendbc_repo/opendbc/car/toyota/tests/test_toyota_iq.py b/iqdbc_repo/iqdbc/car/toyota/tests/test_toyota_iq.py similarity index 86% rename from opendbc_repo/opendbc/car/toyota/tests/test_toyota_iq.py rename to iqdbc_repo/iqdbc/car/toyota/tests/test_toyota_iq.py index e62c519..2a9daa2 100644 --- a/opendbc_repo/opendbc/car/toyota/tests/test_toyota_iq.py +++ b/iqdbc_repo/iqdbc/car/toyota/tests/test_toyota_iq.py @@ -1,7 +1,7 @@ -from opendbc.car import gen_empty_fingerprint, structs -from opendbc.car.toyota.interface import CarInterface -from opendbc.car.toyota.values import CAR, ToyotaFlags -from opendbc.iqpilot.car.toyota.values import ToyotaFlagsIQ +from iqdbc.car import gen_empty_fingerprint, structs +from iqdbc.car.toyota.interface import CarInterface +from iqdbc.car.toyota.values import CAR, ToyotaFlags +from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ def test_forced_secoc_toyota_clears_dashcam_mode(): diff --git a/opendbc_repo/opendbc/car/toyota/toyotacan.py b/iqdbc_repo/iqdbc/car/toyota/toyotacan.py similarity index 99% rename from opendbc_repo/opendbc/car/toyota/toyotacan.py rename to iqdbc_repo/iqdbc/car/toyota/toyotacan.py index b887851..e55af5c 100644 --- a/opendbc_repo/opendbc/car/toyota/toyotacan.py +++ b/iqdbc_repo/iqdbc/car/toyota/toyotacan.py @@ -1,4 +1,4 @@ -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams SteerControlType = CarParams.SteerControlType diff --git a/opendbc_repo/opendbc/car/toyota/values.py b/iqdbc_repo/iqdbc/car/toyota/values.py similarity index 98% rename from opendbc_repo/opendbc/car/toyota/values.py rename to iqdbc_repo/iqdbc/car/toyota/values.py index 229dfba..5662fcc 100644 --- a/opendbc_repo/opendbc/car/toyota/values.py +++ b/iqdbc_repo/iqdbc/car/toyota/values.py @@ -3,12 +3,12 @@ from collections import defaultdict from dataclasses import dataclass, field from enum import Enum, IntFlag -from opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms -from opendbc.car.lateral import AngleSteeringLimits -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.structs import CarParams -from opendbc.car.docs_definitions import CarFootnote, CarDocs, Column, CarParts, CarHarness, SupportType -from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from iqdbc.car import Bus, CarSpecs, PlatformConfig, Platforms +from iqdbc.car.lateral import AngleSteeringLimits +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.structs import CarParams +from iqdbc.car.docs_definitions import CarFootnote, CarDocs, Column, CarParts, CarHarness, SupportType +from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = CarParams.Ecu MIN_ACC_SPEED = 19. * CV.MPH_TO_MS diff --git a/opendbc_repo/opendbc/car/uds.py b/iqdbc_repo/iqdbc/car/uds.py similarity index 99% rename from opendbc_repo/opendbc/car/uds.py rename to iqdbc_repo/iqdbc/car/uds.py index 0ae06be..8f52203 100644 --- a/opendbc_repo/opendbc/car/uds.py +++ b/iqdbc_repo/iqdbc/car/uds.py @@ -6,7 +6,7 @@ from collections.abc import Callable, Generator from enum import IntEnum from functools import partial -from opendbc.car.carlog import carlog +from iqdbc.car.carlog import carlog class SERVICE_TYPE(IntEnum): diff --git a/iqdbc_repo/iqdbc/car/values.py b/iqdbc_repo/iqdbc/car/values.py new file mode 100644 index 0000000..82c8835 --- /dev/null +++ b/iqdbc_repo/iqdbc/car/values.py @@ -0,0 +1,21 @@ +from typing import get_args +from iqdbc.car.body.values import CAR as BODY +from iqdbc.car.chrysler.values import CAR as CHRYSLER +from iqdbc.car.ford.values import CAR as FORD +from iqdbc.car.gm.values import CAR as GM +from iqdbc.car.honda.values import CAR as HONDA +from iqdbc.car.hyundai.values import CAR as HYUNDAI +from iqdbc.car.mazda.values import CAR as MAZDA +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.nissan.values import CAR as NISSAN +from iqdbc.car.psa.values import CAR as PSA +from iqdbc.car.rivian.values import CAR as RIVIAN +from iqdbc.car.subaru.values import CAR as SUBARU +from iqdbc.car.tesla.values import CAR as TESLA +from iqdbc.car.toyota.values import CAR as TOYOTA +from iqdbc.car.volkswagen.values import CAR as VOLKSWAGEN + +Platform = BODY | CHRYSLER | FORD | GM | HONDA | HYUNDAI | MAZDA | MOCK | NISSAN | PSA | RIVIAN | SUBARU | TESLA | TOYOTA | VOLKSWAGEN +BRANDS = get_args(Platform) + +PLATFORMS: dict[str, Platform] = {str(platform): platform for brand in BRANDS for platform in brand} diff --git a/opendbc_repo/opendbc/car/vehicle_model.py b/iqdbc_repo/iqdbc/car/vehicle_model.py similarity index 98% rename from opendbc_repo/opendbc/car/vehicle_model.py rename to iqdbc_repo/iqdbc/car/vehicle_model.py index c7d0494..57ff7ad 100755 --- a/opendbc_repo/opendbc/car/vehicle_model.py +++ b/iqdbc_repo/iqdbc/car/vehicle_model.py @@ -16,8 +16,8 @@ A depends on longitudinal speed, u [m/s], and vehicle parameters CP import numpy as np from numpy.linalg import solve -from opendbc.car.structs import CarParams -from opendbc.car import ACCELERATION_DUE_TO_GRAVITY +from iqdbc.car.structs import CarParams +from iqdbc.car import ACCELERATION_DUE_TO_GRAVITY class VehicleModel: diff --git a/opendbc_repo/opendbc/car/vin.py b/iqdbc_repo/iqdbc/car/vin.py similarity index 93% rename from opendbc_repo/opendbc/car/vin.py rename to iqdbc_repo/iqdbc/car/vin.py index e373c76..bb63147 100644 --- a/opendbc_repo/opendbc/car/vin.py +++ b/iqdbc_repo/iqdbc/car/vin.py @@ -1,10 +1,10 @@ import re from dataclasses import dataclass, field -from opendbc.car import uds -from opendbc.car.carlog import carlog -from opendbc.car.isotp_parallel_query import IsoTpParallelQuery -from opendbc.car.fw_query_definitions import STANDARD_VIN_ADDRS, StdQueries +from iqdbc.car import uds +from iqdbc.car.carlog import carlog +from iqdbc.car.isotp_parallel_query import IsoTpParallelQuery +from iqdbc.car.fw_query_definitions import STANDARD_VIN_ADDRS, StdQueries VIN_UNKNOWN = "0" * 17 VIN_RE = "[A-HJ-NPR-Z0-9]{17}" diff --git a/opendbc_repo/opendbc/car/volkswagen/__init__.py b/iqdbc_repo/iqdbc/car/volkswagen/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/volkswagen/__init__.py rename to iqdbc_repo/iqdbc/car/volkswagen/__init__.py diff --git a/opendbc_repo/opendbc/car/volkswagen/carcontroller.py b/iqdbc_repo/iqdbc/car/volkswagen/carcontroller.py similarity index 97% rename from opendbc_repo/opendbc/car/volkswagen/carcontroller.py rename to iqdbc_repo/iqdbc/car/volkswagen/carcontroller.py index b28dbb2..ff9c42a 100644 --- a/opendbc_repo/opendbc/car/volkswagen/carcontroller.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/carcontroller.py @@ -6,17 +6,17 @@ import os import math import numpy as np import random -from opendbc.can import CANPacker -from opendbc.car import Bus, DT_CTRL, make_tester_present_msg, structs -from opendbc.car.lateral import apply_driver_steer_torque_limits, apply_steer_angle_limits_simple -from opendbc.car.lateral import apply_std_curvature_limits -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.common.numpy_fast import clip, interp -from opendbc.car.interfaces import CarControllerBase -from opendbc.car.volkswagen import mlbcan, mqbcan, pqcan, mebcan -from opendbc.car.volkswagen.values import CanBus, CarControllerParams, VolkswagenFlags, VolkswagenFlagsIQ -from opendbc.car.volkswagen.mebutils import LongControlJerk, LongControlLimit, LatControlCurvature -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.can import CANPacker +from iqdbc.car import Bus, DT_CTRL, make_tester_present_msg, structs +from iqdbc.car.lateral import apply_driver_steer_torque_limits, apply_steer_angle_limits_simple +from iqdbc.car.lateral import apply_std_curvature_limits +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.common.numpy_fast import clip, interp +from iqdbc.car.interfaces import CarControllerBase +from iqdbc.car.volkswagen import mlbcan, mqbcan, pqcan, mebcan +from iqdbc.car.volkswagen.values import CanBus, CarControllerParams, VolkswagenFlags, VolkswagenFlagsIQ +from iqdbc.car.volkswagen.mebutils import LongControlJerk, LongControlLimit, LatControlCurvature +from iqdbc.car.vehicle_model import VehicleModel from openpilot.iqpilot.konn3kt.iqlvbs import alc as iq_lvbs_alc iqpilot_path = os.path.join(os.path.dirname(__file__), '..', '..', '..') diff --git a/opendbc_repo/opendbc/car/volkswagen/carstate.py b/iqdbc_repo/iqdbc/car/volkswagen/carstate.py similarity index 99% rename from opendbc_repo/opendbc/car/volkswagen/carstate.py rename to iqdbc_repo/iqdbc/car/volkswagen/carstate.py index c656c5b..198c829 100644 --- a/opendbc_repo/opendbc/car/volkswagen/carstate.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/carstate.py @@ -5,13 +5,13 @@ import sys import os import math import time -from opendbc.can import CANParser -from opendbc.car import Bus, structs -from opendbc.car.interfaces import CarStateBase -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.volkswagen.values import CAR, DBC, CanBus, NetworkLocation, RADAR_DISABLE_STATE, TransmissionType, GearShifter, \ +from iqdbc.can import CANParser +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.volkswagen.values import CAR, DBC, CanBus, NetworkLocation, RADAR_DISABLE_STATE, TransmissionType, GearShifter, \ CarControllerParams, VolkswagenFlags, VolkswagenFlagsIQ -from opendbc.car.volkswagen.speed_limit_manager import SpeedLimitManager +from iqdbc.car.volkswagen.speed_limit_manager import SpeedLimitManager from openpilot.iqpilot.konn3kt.iqlvbs import alc as iq_lvbs_alc iqpilot_path = os.path.join(os.path.dirname(__file__), '..', '..', '..') diff --git a/opendbc_repo/opendbc/car/volkswagen/fingerprints.py b/iqdbc_repo/iqdbc/car/volkswagen/fingerprints.py similarity index 99% rename from opendbc_repo/opendbc/car/volkswagen/fingerprints.py rename to iqdbc_repo/iqdbc/car/volkswagen/fingerprints.py index 1f8c181..afa1286 100644 --- a/opendbc_repo/opendbc/car/volkswagen/fingerprints.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/fingerprints.py @@ -1,6 +1,6 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.volkswagen.values import CAR +""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" +from iqdbc.car.structs import CarParams +from iqdbc.car.volkswagen.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/volkswagen/interface.py b/iqdbc_repo/iqdbc/car/volkswagen/interface.py similarity index 95% rename from opendbc_repo/opendbc/car/volkswagen/interface.py rename to iqdbc_repo/iqdbc/car/volkswagen/interface.py index eae604a..4e9418c 100644 --- a/opendbc_repo/opendbc/car/volkswagen/interface.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/interface.py @@ -1,15 +1,15 @@ import time -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car import get_safety_config, structs, uds -from opendbc.car.carlog import carlog -from opendbc.car.interfaces import CarInterfaceBase -from opendbc.car.isotp_parallel_query import IsoTpParallelQuery -from opendbc.car.volkswagen.carcontroller import CarController -from opendbc.car.volkswagen.carstate import CarState -from opendbc.car.volkswagen.values import CanBus, CAR, DashcamOnlyReason, NetworkLocation, RADAR_DISABLE_STATE, TransmissionType, VolkswagenFlags, VolkswagenSafetyFlags, VolkswagenFlagsIQ -from opendbc.car.volkswagen.radar_interface import RadarInterface -from opendbc.car.common.conversions import Conversions as CV +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car import get_safety_config, structs, uds +from iqdbc.car.carlog import carlog +from iqdbc.car.interfaces import CarInterfaceBase +from iqdbc.car.isotp_parallel_query import IsoTpParallelQuery +from iqdbc.car.volkswagen.carcontroller import CarController +from iqdbc.car.volkswagen.carstate import CarState +from iqdbc.car.volkswagen.values import CanBus, CAR, DashcamOnlyReason, NetworkLocation, RADAR_DISABLE_STATE, TransmissionType, VolkswagenFlags, VolkswagenSafetyFlags, VolkswagenFlagsIQ +from iqdbc.car.volkswagen.radar_interface import RadarInterface +from iqdbc.car.common.conversions import Conversions as CV import sys import os iqpilot_path = os.path.join(os.path.dirname(__file__), '..', '..', '..') diff --git a/opendbc_repo/opendbc/car/volkswagen/mebcan.py b/iqdbc_repo/iqdbc/car/volkswagen/mebcan.py similarity index 98% rename from opendbc_repo/opendbc/car/volkswagen/mebcan.py rename to iqdbc_repo/iqdbc/car/volkswagen/mebcan.py index 9957350..2740b17 100644 --- a/opendbc_repo/opendbc/car/volkswagen/mebcan.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/mebcan.py @@ -1,7 +1,7 @@ -from opendbc.car.volkswagen.mebutils import map_speed_to_acc_tempolimit -from opendbc.car.volkswagen.values import VolkswagenFlags -from opendbc.car.volkswagen.speed_limit_manager import PSD_TYPE_CURV_SPEED -from opendbc.car.common.conversions import Conversions as CV +from iqdbc.car.volkswagen.mebutils import map_speed_to_acc_tempolimit +from iqdbc.car.volkswagen.values import VolkswagenFlags +from iqdbc.car.volkswagen.speed_limit_manager import PSD_TYPE_CURV_SPEED +from iqdbc.car.common.conversions import Conversions as CV ACCEL_INACTIVE = 3.01 ACCEL_OVERRIDE = 0.00 diff --git a/opendbc_repo/opendbc/car/volkswagen/mebutils.py b/iqdbc_repo/iqdbc/car/volkswagen/mebutils.py similarity index 98% rename from opendbc_repo/opendbc/car/volkswagen/mebutils.py rename to iqdbc_repo/iqdbc/car/volkswagen/mebutils.py index 49a84bf..13edc7d 100644 --- a/opendbc_repo/opendbc/car/volkswagen/mebutils.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/mebutils.py @@ -1,9 +1,9 @@ import numpy as np -from opendbc.car.common.filter_simple import FirstOrderFilter -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.common.pid import PIDController -from opendbc.car import DT_CTRL +from iqdbc.car.common.filter_simple import FirstOrderFilter +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.common.pid import PIDController +from iqdbc.car import DT_CTRL class LongControlJerk(): diff --git a/opendbc_repo/opendbc/car/volkswagen/mlbcan.py b/iqdbc_repo/iqdbc/car/volkswagen/mlbcan.py similarity index 94% rename from opendbc_repo/opendbc/car/volkswagen/mlbcan.py rename to iqdbc_repo/iqdbc/car/volkswagen/mlbcan.py index c0bbc87..a2d5f42 100644 --- a/opendbc_repo/opendbc/car/volkswagen/mlbcan.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/mlbcan.py @@ -1,4 +1,4 @@ -from opendbc.car.volkswagen.mqbcan import (volkswagen_mqb_meb_checksum, xor_checksum, create_lka_hud_control as mqb_create_lka_hud_control) +from iqdbc.car.volkswagen.mqbcan import (volkswagen_mqb_meb_checksum, xor_checksum, create_lka_hud_control as mqb_create_lka_hud_control) def create_hca_steering_control(packer, bus, apply_steer, HCA_Status): values = { diff --git a/opendbc_repo/opendbc/car/volkswagen/mqbcan.py b/iqdbc_repo/iqdbc/car/volkswagen/mqbcan.py similarity index 99% rename from opendbc_repo/opendbc/car/volkswagen/mqbcan.py rename to iqdbc_repo/iqdbc/car/volkswagen/mqbcan.py index 704c9c6..317ca94 100644 --- a/opendbc_repo/opendbc/car/volkswagen/mqbcan.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/mqbcan.py @@ -1,4 +1,4 @@ -from opendbc.car.crc import CRC8H2F +from iqdbc.car.crc import CRC8H2F def create_hca_steering_control(packer, bus, apply_torque, HCA_Status): diff --git a/opendbc_repo/opendbc/car/volkswagen/pqcan.py b/iqdbc_repo/iqdbc/car/volkswagen/pqcan.py similarity index 100% rename from opendbc_repo/opendbc/car/volkswagen/pqcan.py rename to iqdbc_repo/iqdbc/car/volkswagen/pqcan.py diff --git a/opendbc_repo/opendbc/car/volkswagen/radar_interface.py b/iqdbc_repo/iqdbc/car/volkswagen/radar_interface.py similarity index 91% rename from opendbc_repo/opendbc/car/volkswagen/radar_interface.py rename to iqdbc_repo/iqdbc/car/volkswagen/radar_interface.py index 8cb3d99..7d7aab1 100644 --- a/opendbc_repo/opendbc/car/volkswagen/radar_interface.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/radar_interface.py @@ -1,11 +1,11 @@ import math -from opendbc.can import CANParser -from opendbc.can.dbc import DBC as DBCLoader -from opendbc.car import Bus, structs -from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.volkswagen.values import DBC, VolkswagenFlags +from iqdbc.can import CANParser +from iqdbc.can.dbc import DBC as DBCLoader +from iqdbc.car import Bus, structs +from iqdbc.car.interfaces import RadarInterfaceBase +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.volkswagen.values import DBC, VolkswagenFlags RADAR_ADDR = 0x24F NO_OBJECT = 0 diff --git a/opendbc_repo/opendbc/car/volkswagen/speed_limit_manager.py b/iqdbc_repo/iqdbc/car/volkswagen/speed_limit_manager.py similarity index 99% rename from opendbc_repo/opendbc/car/volkswagen/speed_limit_manager.py rename to iqdbc_repo/iqdbc/car/volkswagen/speed_limit_manager.py index 2d7bebb..05b32db 100644 --- a/opendbc_repo/opendbc/car/volkswagen/speed_limit_manager.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/speed_limit_manager.py @@ -1,9 +1,9 @@ import time import math -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.volkswagen.values import VolkswagenFlags -from opendbc.car.lateral import ISO_LATERAL_ACCEL +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.volkswagen.values import VolkswagenFlags +from iqdbc.car.lateral import ISO_LATERAL_ACCEL NOT_SET = 0 SPEED_SUGGESTED_MAX_HIGHWAY_GER_KPH = 130 # 130 kph in germany diff --git a/opendbc_repo/opendbc/car/volkswagen/tests/__init__.py b/iqdbc_repo/iqdbc/car/volkswagen/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/car/volkswagen/tests/__init__.py rename to iqdbc_repo/iqdbc/car/volkswagen/tests/__init__.py diff --git a/opendbc_repo/opendbc/car/volkswagen/tests/test_mqb_extended_standstill.py b/iqdbc_repo/iqdbc/car/volkswagen/tests/test_mqb_extended_standstill.py similarity index 99% rename from opendbc_repo/opendbc/car/volkswagen/tests/test_mqb_extended_standstill.py rename to iqdbc_repo/iqdbc/car/volkswagen/tests/test_mqb_extended_standstill.py index ffa64db..ab79339 100644 --- a/opendbc_repo/opendbc/car/volkswagen/tests/test_mqb_extended_standstill.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/tests/test_mqb_extended_standstill.py @@ -4,7 +4,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import math from types import SimpleNamespace -from opendbc.car.volkswagen.carcontroller import MQBStandstillManager +from iqdbc.car.volkswagen.carcontroller import MQBStandstillManager def _pitch(grade_pct): diff --git a/opendbc_repo/opendbc/car/volkswagen/tests/test_volkswagen.py b/iqdbc_repo/iqdbc/car/volkswagen/tests/test_volkswagen.py similarity index 94% rename from opendbc_repo/opendbc/car/volkswagen/tests/test_volkswagen.py rename to iqdbc_repo/iqdbc/car/volkswagen/tests/test_volkswagen.py index 35b3097..f180743 100644 --- a/opendbc_repo/opendbc/car/volkswagen/tests/test_volkswagen.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/tests/test_volkswagen.py @@ -4,11 +4,11 @@ from types import SimpleNamespace import pytest -from opendbc.car import structs -from opendbc.car.volkswagen.carstate import CarState -from opendbc.car.structs import CarParams -from opendbc.car.volkswagen.values import CAR, FW_QUERY_CONFIG, WMI -from opendbc.car.volkswagen.fingerprints import FW_VERSIONS +from iqdbc.car import structs +from iqdbc.car.volkswagen.carstate import CarState +from iqdbc.car.structs import CarParams +from iqdbc.car.volkswagen.values import CAR, FW_QUERY_CONFIG, WMI +from iqdbc.car.volkswagen.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/car/volkswagen/values.py b/iqdbc_repo/iqdbc/car/volkswagen/values.py similarity index 98% rename from opendbc_repo/opendbc/car/volkswagen/values.py rename to iqdbc_repo/iqdbc/car/volkswagen/values.py index 62c4a50..9885559 100644 --- a/opendbc_repo/opendbc/car/volkswagen/values.py +++ b/iqdbc_repo/iqdbc/car/volkswagen/values.py @@ -2,14 +2,14 @@ from collections import defaultdict, namedtuple from dataclasses import dataclass, field from enum import Enum, IntFlag, StrEnum -from opendbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, CanBusBase, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds -from opendbc.car.lateral import CurvatureSteeringLimits -from opendbc.can import CANDefine -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column -from opendbc.car.lateral import AngleSteeringLimits, ISO_LATERAL_ACCEL, ISO_LATERAL_JERK -from opendbc.car.fw_query_definitions import EcuAddrSubAddr, FwQueryConfig, Request, p16 -from opendbc.car.vin import Vin +from iqdbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, CanBusBase, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds +from iqdbc.car.lateral import CurvatureSteeringLimits +from iqdbc.can import CANDefine +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column +from iqdbc.car.lateral import AngleSteeringLimits, ISO_LATERAL_ACCEL, ISO_LATERAL_JERK +from iqdbc.car.fw_query_definitions import EcuAddrSubAddr, FwQueryConfig, Request, p16 +from iqdbc.car.vin import Vin Ecu = structs.CarParams.Ecu NetworkLocation = structs.CarParams.NetworkLocation diff --git a/opendbc_repo/opendbc/car/xcp.py b/iqdbc_repo/iqdbc/car/xcp.py similarity index 100% rename from opendbc_repo/opendbc/car/xcp.py rename to iqdbc_repo/iqdbc/car/xcp.py diff --git a/opendbc_repo/opendbc/dbc/ESR.dbc b/iqdbc_repo/iqdbc/dbc/ESR.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/ESR.dbc rename to iqdbc_repo/iqdbc/dbc/ESR.dbc diff --git a/opendbc_repo/opendbc/dbc/FORD_CADS.dbc b/iqdbc_repo/iqdbc/dbc/FORD_CADS.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/FORD_CADS.dbc rename to iqdbc_repo/iqdbc/dbc/FORD_CADS.dbc diff --git a/opendbc_repo/opendbc/dbc/FORD_CADS_64.dbc b/iqdbc_repo/iqdbc/dbc/FORD_CADS_64.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/FORD_CADS_64.dbc rename to iqdbc_repo/iqdbc/dbc/FORD_CADS_64.dbc diff --git a/opendbc_repo/opendbc/dbc/README.md b/iqdbc_repo/iqdbc/dbc/README.md similarity index 92% rename from opendbc_repo/opendbc/dbc/README.md rename to iqdbc_repo/iqdbc/dbc/README.md index 20e31a9..39e71e9 100644 --- a/opendbc_repo/opendbc/dbc/README.md +++ b/iqdbc_repo/iqdbc/dbc/README.md @@ -5,7 +5,7 @@ Wondering what's the DBC file format? [Here](http://www.socialledge.com/sjsu/ind ## How to start reverse engineering cars -[opendbc](https://github.com/commaai/opendbc) is integrated with [cabana](https://github.com/commaai/openpilot/tree/master/tools/cabana). +[iqdbc](https://github.com/commaai/iqdbc) is integrated with [cabana](https://github.com/commaai/openpilot/tree/master/tools/cabana). Use [panda](https://github.com/commaai/panda) to connect your car to a computer. @@ -14,9 +14,9 @@ To create custom CAN simulations or send reverse engineered signals back to the ## DBC file preprocessor -DBC files for different models of the same brand have a lot of overlap. Therefore, we wrote a preprocessor to create DBC files from a brand DBC file and a model specific DBC file. The source DBC files can be found in the generator folder. After changing one of the files run the generator.py script to regenerate the output files. These output files will be placed in the root of the opendbc repository and are suffixed by _generated. +DBC files for different models of the same brand have a lot of overlap. Therefore, we wrote a preprocessor to create DBC files from a brand DBC file and a model specific DBC file. The source DBC files can be found in the generator folder. After changing one of the files run the generator.py script to regenerate the output files. These output files will be placed in the root of the iqdbc repository and are suffixed by _generated. -## Good practices for contributing to opendbc +## Good practices for contributing to iqdbc - Comments: the best way to store comments is to add them directly to the DBC files. For example: ``` diff --git a/opendbc_repo/opendbc/dbc/SConscript b/iqdbc_repo/iqdbc/dbc/SConscript similarity index 100% rename from opendbc_repo/opendbc/dbc/SConscript rename to iqdbc_repo/iqdbc/dbc/SConscript diff --git a/opendbc_repo/opendbc/dbc/__init__.py b/iqdbc_repo/iqdbc/dbc/__init__.py similarity index 100% rename from opendbc_repo/opendbc/dbc/__init__.py rename to iqdbc_repo/iqdbc/dbc/__init__.py diff --git a/opendbc_repo/opendbc/dbc/acura_ilx_2016_nidec.dbc b/iqdbc_repo/iqdbc/dbc/acura_ilx_2016_nidec.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/acura_ilx_2016_nidec.dbc rename to iqdbc_repo/iqdbc/dbc/acura_ilx_2016_nidec.dbc diff --git a/opendbc_repo/opendbc/dbc/bmw_e9x_e8x.dbc b/iqdbc_repo/iqdbc/dbc/bmw_e9x_e8x.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/bmw_e9x_e8x.dbc rename to iqdbc_repo/iqdbc/dbc/bmw_e9x_e8x.dbc diff --git a/opendbc_repo/opendbc/dbc/cadillac_ct6_chassis.dbc b/iqdbc_repo/iqdbc/dbc/cadillac_ct6_chassis.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/cadillac_ct6_chassis.dbc rename to iqdbc_repo/iqdbc/dbc/cadillac_ct6_chassis.dbc diff --git a/opendbc_repo/opendbc/dbc/cadillac_ct6_object.dbc b/iqdbc_repo/iqdbc/dbc/cadillac_ct6_object.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/cadillac_ct6_object.dbc rename to iqdbc_repo/iqdbc/dbc/cadillac_ct6_object.dbc diff --git a/opendbc_repo/opendbc/dbc/cadillac_ct6_powertrain.dbc b/iqdbc_repo/iqdbc/dbc/cadillac_ct6_powertrain.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/cadillac_ct6_powertrain.dbc rename to iqdbc_repo/iqdbc/dbc/cadillac_ct6_powertrain.dbc diff --git a/opendbc_repo/opendbc/dbc/chrysler_cusw.dbc b/iqdbc_repo/iqdbc/dbc/chrysler_cusw.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/chrysler_cusw.dbc rename to iqdbc_repo/iqdbc/dbc/chrysler_cusw.dbc diff --git a/opendbc_repo/opendbc/dbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc b/iqdbc_repo/iqdbc/dbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc rename to iqdbc_repo/iqdbc/dbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc diff --git a/opendbc_repo/opendbc/dbc/comma_body.dbc b/iqdbc_repo/iqdbc/dbc/comma_body.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/comma_body.dbc rename to iqdbc_repo/iqdbc/dbc/comma_body.dbc diff --git a/opendbc_repo/opendbc/dbc/fca_giorgio.dbc b/iqdbc_repo/iqdbc/dbc/fca_giorgio.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/fca_giorgio.dbc rename to iqdbc_repo/iqdbc/dbc/fca_giorgio.dbc diff --git a/opendbc_repo/opendbc/dbc/ford_cgea1_2_bodycan_2011.dbc b/iqdbc_repo/iqdbc/dbc/ford_cgea1_2_bodycan_2011.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/ford_cgea1_2_bodycan_2011.dbc rename to iqdbc_repo/iqdbc/dbc/ford_cgea1_2_bodycan_2011.dbc diff --git a/opendbc_repo/opendbc/dbc/ford_cgea1_2_ptcan_2011.dbc b/iqdbc_repo/iqdbc/dbc/ford_cgea1_2_ptcan_2011.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/ford_cgea1_2_ptcan_2011.dbc rename to iqdbc_repo/iqdbc/dbc/ford_cgea1_2_ptcan_2011.dbc diff --git a/opendbc_repo/opendbc/dbc/ford_fusion_2018_adas.dbc b/iqdbc_repo/iqdbc/dbc/ford_fusion_2018_adas.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/ford_fusion_2018_adas.dbc rename to iqdbc_repo/iqdbc/dbc/ford_fusion_2018_adas.dbc diff --git a/opendbc_repo/opendbc/dbc/ford_fusion_2018_pt.dbc b/iqdbc_repo/iqdbc/dbc/ford_fusion_2018_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/ford_fusion_2018_pt.dbc rename to iqdbc_repo/iqdbc/dbc/ford_fusion_2018_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/ford_lincoln_base_pt.dbc b/iqdbc_repo/iqdbc/dbc/ford_lincoln_base_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/ford_lincoln_base_pt.dbc rename to iqdbc_repo/iqdbc/dbc/ford_lincoln_base_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/chrysler/.gitignore b/iqdbc_repo/iqdbc/dbc/generator/chrysler/.gitignore similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/chrysler/.gitignore rename to iqdbc_repo/iqdbc/dbc/generator/chrysler/.gitignore diff --git a/opendbc_repo/opendbc/dbc/generator/chrysler/_stellantis_common.dbc b/iqdbc_repo/iqdbc/dbc/generator/chrysler/_stellantis_common.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/chrysler/_stellantis_common.dbc rename to iqdbc_repo/iqdbc/dbc/generator/chrysler/_stellantis_common.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/chrysler/_stellantis_common_ram.py b/iqdbc_repo/iqdbc/dbc/generator/chrysler/_stellantis_common_ram.py similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/chrysler/_stellantis_common_ram.py rename to iqdbc_repo/iqdbc/dbc/generator/chrysler/_stellantis_common_ram.py diff --git a/opendbc_repo/opendbc/dbc/generator/chrysler/chrysler_pacifica_2017_hybrid.dbc b/iqdbc_repo/iqdbc/dbc/generator/chrysler/chrysler_pacifica_2017_hybrid.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/chrysler/chrysler_pacifica_2017_hybrid.dbc rename to iqdbc_repo/iqdbc/dbc/generator/chrysler/chrysler_pacifica_2017_hybrid.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/chrysler/chrysler_ram_dt.dbc b/iqdbc_repo/iqdbc/dbc/generator/chrysler/chrysler_ram_dt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/chrysler/chrysler_ram_dt.dbc rename to iqdbc_repo/iqdbc/dbc/generator/chrysler/chrysler_ram_dt.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/chrysler/chrysler_ram_hd.dbc b/iqdbc_repo/iqdbc/dbc/generator/chrysler/chrysler_ram_hd.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/chrysler/chrysler_ram_hd.dbc rename to iqdbc_repo/iqdbc/dbc/generator/chrysler/chrysler_ram_hd.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/ford/FORD_CADS_64.sh b/iqdbc_repo/iqdbc/dbc/generator/ford/FORD_CADS_64.sh similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/ford/FORD_CADS_64.sh rename to iqdbc_repo/iqdbc/dbc/generator/ford/FORD_CADS_64.sh diff --git a/opendbc_repo/opendbc/dbc/generator/generator.py b/iqdbc_repo/iqdbc/dbc/generator/generator.py similarity index 95% rename from opendbc_repo/opendbc/dbc/generator/generator.py rename to iqdbc_repo/iqdbc/dbc/generator/generator.py index 187eabf..af05f00 100755 --- a/opendbc_repo/opendbc/dbc/generator/generator.py +++ b/iqdbc_repo/iqdbc/dbc/generator/generator.py @@ -5,7 +5,7 @@ import glob import subprocess generator_path = os.path.dirname(os.path.realpath(__file__)) -opendbc_root = os.path.join(generator_path, '../') +iqdbc_root = os.path.join(generator_path, '../') include_pattern = re.compile(r'CM_ "IMPORT (.*?)";\n') generated_suffix = '_generated.dbc' @@ -62,4 +62,4 @@ def create_all(output_path: str): if __name__ == "__main__": - create_all(opendbc_root) + create_all(iqdbc_root) diff --git a/opendbc_repo/opendbc/dbc/generator/gm/_community.dbc b/iqdbc_repo/iqdbc/dbc/generator/gm/_community.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/gm/_community.dbc rename to iqdbc_repo/iqdbc/dbc/generator/gm/_community.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/gm/gm_global_a_powertrain.dbc b/iqdbc_repo/iqdbc/dbc/generator/gm/gm_global_a_powertrain.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/gm/gm_global_a_powertrain.dbc rename to iqdbc_repo/iqdbc/dbc/generator/gm/gm_global_a_powertrain.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_bosch_2018.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_bosch_2018.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_bosch_2018.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_bosch_2018.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_bosch_radar_acc.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_bosch_radar_acc.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_bosch_radar_acc.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_bosch_radar_acc.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_bosch_standstill.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_bosch_standstill.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_bosch_standstill.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_bosch_standstill.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_community.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_community.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_community.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_community.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_gearbox_common.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_gearbox_common.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_gearbox_common.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_gearbox_common.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_honda_common.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_honda_common.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_honda_common.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_honda_common.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_lkas_hud_5byte.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_lkas_hud_5byte.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_lkas_hud_5byte.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_lkas_hud_5byte.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_lkas_hud_8byte.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_lkas_hud_8byte.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_lkas_hud_8byte.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_lkas_hud_8byte.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_nidec_common.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_nidec_common.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_nidec_common.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_nidec_common.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_nidec_scm_group_a.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_nidec_scm_group_a.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_nidec_scm_group_a.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_nidec_scm_group_a.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_nidec_scm_group_b.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_nidec_scm_group_b.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_nidec_scm_group_b.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_nidec_scm_group_b.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_control_a.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_a.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_control_a.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_a.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_control_b.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_b.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_control_b.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_b.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_control_c.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_c.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_control_c.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_c.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_control_d_ext.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_d_ext.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_control_d_ext.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_control_d_ext.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_sensors_a.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_sensors_a.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_sensors_a.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_sensors_a.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_sensors_b.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_sensors_b.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_sensors_b.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_sensors_b.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/_steering_sensors_c.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/_steering_sensors_c.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/_steering_sensors_c.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/_steering_sensors_c.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/acura_ilx_2016_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/acura_ilx_2016_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/acura_ilx_2016_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/acura_ilx_2016_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/acura_rdx_2018_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/acura_rdx_2018_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/acura_rdx_2018_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/acura_rdx_2018_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/acura_rdx_2020_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/acura_rdx_2020_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/acura_rdx_2020_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/acura_rdx_2020_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_accord_2017_can_ext.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_accord_2017_can_ext.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_accord_2017_can_ext.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_accord_2017_can_ext.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_bosch_radarless.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_bosch_radarless.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_bosch_radarless.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_bosch_radarless.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_civic_hatchback_ex_2017_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_civic_hatchback_ex_2017_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_civic_hatchback_ex_2017_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_civic_hatchback_ex_2017_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_civic_touring_2016_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_civic_touring_2016_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_civic_touring_2016_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_civic_touring_2016_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_clarity_hybrid_2018_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_clarity_hybrid_2018_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_clarity_hybrid_2018_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_clarity_hybrid_2018_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_common_canfd.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_common_canfd.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_common_canfd.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_common_canfd.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_crv_ex_2017_body.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_crv_ex_2017_body.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_crv_ex_2017_body.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_crv_ex_2017_body.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_crv_touring_2016_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_crv_touring_2016_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_crv_touring_2016_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_crv_touring_2016_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_insight_ex_2019_can.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_insight_ex_2019_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_insight_ex_2019_can.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_insight_ex_2019_can.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_odyssey_exl_2018.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_odyssey_exl_2018.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_odyssey_exl_2018.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_odyssey_exl_2018.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/honda/honda_odyssey_twn_2018.dbc b/iqdbc_repo/iqdbc/dbc/generator/honda/honda_odyssey_twn_2018.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/honda/honda_odyssey_twn_2018.dbc rename to iqdbc_repo/iqdbc/dbc/generator/honda/honda_odyssey_twn_2018.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/hyundai/.gitignore b/iqdbc_repo/iqdbc/dbc/generator/hyundai/.gitignore similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/hyundai/.gitignore rename to iqdbc_repo/iqdbc/dbc/generator/hyundai/.gitignore diff --git a/opendbc_repo/opendbc/dbc/generator/hyundai/_hyundai_canfd_common.dbc b/iqdbc_repo/iqdbc/dbc/generator/hyundai/_hyundai_canfd_common.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/hyundai/_hyundai_canfd_common.dbc rename to iqdbc_repo/iqdbc/dbc/generator/hyundai/_hyundai_canfd_common.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_canfd.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc rename to iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_canfd.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_kia_mando_corner_radar.py b/iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_kia_mando_corner_radar.py similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_kia_mando_corner_radar.py rename to iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_kia_mando_corner_radar.py diff --git a/opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_kia_mando_front_radar.py b/iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_kia_mando_front_radar.py similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_kia_mando_front_radar.py rename to iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_kia_mando_front_radar.py diff --git a/opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_palisade_2023.dbc b/iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_palisade_2023.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/hyundai/hyundai_palisade_2023.dbc rename to iqdbc_repo/iqdbc/dbc/generator/hyundai/hyundai_palisade_2023.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/nissan/_nissan_common.dbc b/iqdbc_repo/iqdbc/dbc/generator/nissan/_nissan_common.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/nissan/_nissan_common.dbc rename to iqdbc_repo/iqdbc/dbc/generator/nissan/_nissan_common.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/nissan/nissan_leaf_2018.dbc b/iqdbc_repo/iqdbc/dbc/generator/nissan/nissan_leaf_2018.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/nissan/nissan_leaf_2018.dbc rename to iqdbc_repo/iqdbc/dbc/generator/nissan/nissan_leaf_2018.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/nissan/nissan_x_trail_2017.dbc b/iqdbc_repo/iqdbc/dbc/generator/nissan/nissan_x_trail_2017.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/nissan/nissan_x_trail_2017.dbc rename to iqdbc_repo/iqdbc/dbc/generator/nissan/nissan_x_trail_2017.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/rivian/.gitignore b/iqdbc_repo/iqdbc/dbc/generator/rivian/.gitignore similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/rivian/.gitignore rename to iqdbc_repo/iqdbc/dbc/generator/rivian/.gitignore diff --git a/opendbc_repo/opendbc/dbc/generator/rivian/rivian_mando_front_radar.py b/iqdbc_repo/iqdbc/dbc/generator/rivian/rivian_mando_front_radar.py similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/rivian/rivian_mando_front_radar.py rename to iqdbc_repo/iqdbc/dbc/generator/rivian/rivian_mando_front_radar.py diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/_subaru_global.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/_subaru_global.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/_subaru_global.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/_subaru_global.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/_subaru_preglobal_2015.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/_subaru_preglobal_2015.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/_subaru_preglobal_2015.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/_subaru_preglobal_2015.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/subaru_forester_2017.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_forester_2017.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/subaru_forester_2017.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_forester_2017.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/subaru_global_2017.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_global_2017.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/subaru_global_2017.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_global_2017.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/subaru_global_2020_hybrid.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_global_2020_hybrid.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/subaru_global_2020_hybrid.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_global_2020_hybrid.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/subaru_outback_2015.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_outback_2015.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/subaru_outback_2015.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_outback_2015.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/subaru/subaru_outback_2019.dbc b/iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_outback_2019.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/subaru/subaru_outback_2019.dbc rename to iqdbc_repo/iqdbc/dbc/generator/subaru/subaru_outback_2019.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/tesla/.gitignore b/iqdbc_repo/iqdbc/dbc/generator/tesla/.gitignore similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/tesla/.gitignore rename to iqdbc_repo/iqdbc/dbc/generator/tesla/.gitignore diff --git a/opendbc_repo/opendbc/dbc/generator/tesla/_radar_common.py b/iqdbc_repo/iqdbc/dbc/generator/tesla/_radar_common.py similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/tesla/_radar_common.py rename to iqdbc_repo/iqdbc/dbc/generator/tesla/_radar_common.py diff --git a/opendbc_repo/opendbc/dbc/generator/tesla/tesla_radar_bosch.py b/iqdbc_repo/iqdbc/dbc/generator/tesla/tesla_radar_bosch.py similarity index 99% rename from opendbc_repo/opendbc/dbc/generator/tesla/tesla_radar_bosch.py rename to iqdbc_repo/iqdbc/dbc/generator/tesla/tesla_radar_bosch.py index 6586655..adfd2d8 100755 --- a/opendbc_repo/opendbc/dbc/generator/tesla/tesla_radar_bosch.py +++ b/iqdbc_repo/iqdbc/dbc/generator/tesla/tesla_radar_bosch.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os -from opendbc.dbc.generator.tesla._radar_common import get_radar_point_definition, get_val_definition +from iqdbc.dbc.generator.tesla._radar_common import get_radar_point_definition, get_val_definition if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") diff --git a/opendbc_repo/opendbc/dbc/generator/tesla/tesla_radar_continental.py b/iqdbc_repo/iqdbc/dbc/generator/tesla/tesla_radar_continental.py similarity index 95% rename from opendbc_repo/opendbc/dbc/generator/tesla/tesla_radar_continental.py rename to iqdbc_repo/iqdbc/dbc/generator/tesla/tesla_radar_continental.py index 36355d4..c3e325c 100755 --- a/opendbc_repo/opendbc/dbc/generator/tesla/tesla_radar_continental.py +++ b/iqdbc_repo/iqdbc/dbc/generator/tesla/tesla_radar_continental.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os -from opendbc.dbc.generator.tesla._radar_common import get_radar_point_definition, get_val_definition +from iqdbc.dbc.generator.tesla._radar_common import get_radar_point_definition, get_val_definition if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/_community.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/_community.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/_community.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/_community.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/_toyota_2017.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/_toyota_2017.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/_toyota_2017.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/_toyota_2017.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/_toyota_adas_standard.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/_toyota_adas_standard.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/_toyota_adas_standard.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/_toyota_adas_standard.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/toyota_new_mc_pt.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_new_mc_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/toyota_new_mc_pt.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_new_mc_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/toyota_nodsu_pt.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_nodsu_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/toyota_nodsu_pt.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_nodsu_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/toyota_secoc_pt.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_secoc_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/toyota_secoc_pt.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_secoc_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/generator/toyota/toyota_tnga_k_pt.dbc b/iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_tnga_k_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/generator/toyota/toyota_tnga_k_pt.dbc rename to iqdbc_repo/iqdbc/dbc/generator/toyota/toyota_tnga_k_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/gm_global_a_chassis.dbc b/iqdbc_repo/iqdbc/dbc/gm_global_a_chassis.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gm_global_a_chassis.dbc rename to iqdbc_repo/iqdbc/dbc/gm_global_a_chassis.dbc diff --git a/opendbc_repo/opendbc/dbc/gm_global_a_high_voltage_management.dbc b/iqdbc_repo/iqdbc/dbc/gm_global_a_high_voltage_management.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gm_global_a_high_voltage_management.dbc rename to iqdbc_repo/iqdbc/dbc/gm_global_a_high_voltage_management.dbc diff --git a/opendbc_repo/opendbc/dbc/gm_global_a_lowspeed.dbc b/iqdbc_repo/iqdbc/dbc/gm_global_a_lowspeed.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gm_global_a_lowspeed.dbc rename to iqdbc_repo/iqdbc/dbc/gm_global_a_lowspeed.dbc diff --git a/opendbc_repo/opendbc/dbc/gm_global_a_lowspeed_1818125.dbc b/iqdbc_repo/iqdbc/dbc/gm_global_a_lowspeed_1818125.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gm_global_a_lowspeed_1818125.dbc rename to iqdbc_repo/iqdbc/dbc/gm_global_a_lowspeed_1818125.dbc diff --git a/opendbc_repo/opendbc/dbc/gm_global_a_object.dbc b/iqdbc_repo/iqdbc/dbc/gm_global_a_object.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gm_global_a_object.dbc rename to iqdbc_repo/iqdbc/dbc/gm_global_a_object.dbc diff --git a/opendbc_repo/opendbc/dbc/gm_global_a_powertrain_expansion.dbc b/iqdbc_repo/iqdbc/dbc/gm_global_a_powertrain_expansion.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gm_global_a_powertrain_expansion.dbc rename to iqdbc_repo/iqdbc/dbc/gm_global_a_powertrain_expansion.dbc diff --git a/opendbc_repo/opendbc/dbc/gwm_haval_h6_phev_2024.dbc b/iqdbc_repo/iqdbc/dbc/gwm_haval_h6_phev_2024.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/gwm_haval_h6_phev_2024.dbc rename to iqdbc_repo/iqdbc/dbc/gwm_haval_h6_phev_2024.dbc diff --git a/opendbc_repo/opendbc/dbc/hongqi_hs5.dbc b/iqdbc_repo/iqdbc/dbc/hongqi_hs5.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/hongqi_hs5.dbc rename to iqdbc_repo/iqdbc/dbc/hongqi_hs5.dbc diff --git a/opendbc_repo/opendbc/dbc/hyundai_2015_ccan.dbc b/iqdbc_repo/iqdbc/dbc/hyundai_2015_ccan.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/hyundai_2015_ccan.dbc rename to iqdbc_repo/iqdbc/dbc/hyundai_2015_ccan.dbc diff --git a/opendbc_repo/opendbc/dbc/hyundai_2015_mcan.dbc b/iqdbc_repo/iqdbc/dbc/hyundai_2015_mcan.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/hyundai_2015_mcan.dbc rename to iqdbc_repo/iqdbc/dbc/hyundai_2015_mcan.dbc diff --git a/opendbc_repo/opendbc/dbc/hyundai_i30_2014.dbc b/iqdbc_repo/iqdbc/dbc/hyundai_i30_2014.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/hyundai_i30_2014.dbc rename to iqdbc_repo/iqdbc/dbc/hyundai_i30_2014.dbc diff --git a/opendbc_repo/opendbc/dbc/hyundai_kia_generic.dbc b/iqdbc_repo/iqdbc/dbc/hyundai_kia_generic.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/hyundai_kia_generic.dbc rename to iqdbc_repo/iqdbc/dbc/hyundai_kia_generic.dbc diff --git a/opendbc_repo/opendbc/dbc/hyundai_santafe_2007.dbc b/iqdbc_repo/iqdbc/dbc/hyundai_santafe_2007.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/hyundai_santafe_2007.dbc rename to iqdbc_repo/iqdbc/dbc/hyundai_santafe_2007.dbc diff --git a/opendbc_repo/opendbc/dbc/luxgen_s5_2015.dbc b/iqdbc_repo/iqdbc/dbc/luxgen_s5_2015.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/luxgen_s5_2015.dbc rename to iqdbc_repo/iqdbc/dbc/luxgen_s5_2015.dbc diff --git a/opendbc_repo/opendbc/dbc/mazda_2017.dbc b/iqdbc_repo/iqdbc/dbc/mazda_2017.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/mazda_2017.dbc rename to iqdbc_repo/iqdbc/dbc/mazda_2017.dbc diff --git a/opendbc_repo/opendbc/dbc/mazda_3_2019.dbc b/iqdbc_repo/iqdbc/dbc/mazda_3_2019.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/mazda_3_2019.dbc rename to iqdbc_repo/iqdbc/dbc/mazda_3_2019.dbc diff --git a/opendbc_repo/opendbc/dbc/mazda_radar.dbc b/iqdbc_repo/iqdbc/dbc/mazda_radar.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/mazda_radar.dbc rename to iqdbc_repo/iqdbc/dbc/mazda_radar.dbc diff --git a/opendbc_repo/opendbc/dbc/mazda_rx8.dbc b/iqdbc_repo/iqdbc/dbc/mazda_rx8.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/mazda_rx8.dbc rename to iqdbc_repo/iqdbc/dbc/mazda_rx8.dbc diff --git a/opendbc_repo/opendbc/dbc/mercedes_benz_e350_2010.dbc b/iqdbc_repo/iqdbc/dbc/mercedes_benz_e350_2010.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/mercedes_benz_e350_2010.dbc rename to iqdbc_repo/iqdbc/dbc/mercedes_benz_e350_2010.dbc diff --git a/opendbc_repo/opendbc/dbc/nissan_xterra_2011.dbc b/iqdbc_repo/iqdbc/dbc/nissan_xterra_2011.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/nissan_xterra_2011.dbc rename to iqdbc_repo/iqdbc/dbc/nissan_xterra_2011.dbc diff --git a/opendbc_repo/opendbc/dbc/opel_omega_2001.dbc b/iqdbc_repo/iqdbc/dbc/opel_omega_2001.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/opel_omega_2001.dbc rename to iqdbc_repo/iqdbc/dbc/opel_omega_2001.dbc diff --git a/opendbc_repo/opendbc/dbc/psa_aee2010_r3.dbc b/iqdbc_repo/iqdbc/dbc/psa_aee2010_r3.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/psa_aee2010_r3.dbc rename to iqdbc_repo/iqdbc/dbc/psa_aee2010_r3.dbc diff --git a/opendbc_repo/opendbc/dbc/rivian_park_assist_can.dbc b/iqdbc_repo/iqdbc/dbc/rivian_park_assist_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/rivian_park_assist_can.dbc rename to iqdbc_repo/iqdbc/dbc/rivian_park_assist_can.dbc diff --git a/opendbc_repo/opendbc/dbc/rivian_primary_actuator.dbc b/iqdbc_repo/iqdbc/dbc/rivian_primary_actuator.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/rivian_primary_actuator.dbc rename to iqdbc_repo/iqdbc/dbc/rivian_primary_actuator.dbc diff --git a/opendbc_repo/opendbc/dbc/tesla_can.dbc b/iqdbc_repo/iqdbc/dbc/tesla_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/tesla_can.dbc rename to iqdbc_repo/iqdbc/dbc/tesla_can.dbc diff --git a/opendbc_repo/opendbc/dbc/tesla_model3_party.dbc b/iqdbc_repo/iqdbc/dbc/tesla_model3_party.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/tesla_model3_party.dbc rename to iqdbc_repo/iqdbc/dbc/tesla_model3_party.dbc diff --git a/opendbc_repo/opendbc/dbc/tesla_model3_vehicle.dbc b/iqdbc_repo/iqdbc/dbc/tesla_model3_vehicle.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/tesla_model3_vehicle.dbc rename to iqdbc_repo/iqdbc/dbc/tesla_model3_vehicle.dbc diff --git a/opendbc_repo/opendbc/dbc/tesla_powertrain.dbc b/iqdbc_repo/iqdbc/dbc/tesla_powertrain.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/tesla_powertrain.dbc rename to iqdbc_repo/iqdbc/dbc/tesla_powertrain.dbc diff --git a/opendbc_repo/opendbc/dbc/toyota_2017_ref_pt.dbc b/iqdbc_repo/iqdbc/dbc/toyota_2017_ref_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/toyota_2017_ref_pt.dbc rename to iqdbc_repo/iqdbc/dbc/toyota_2017_ref_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/toyota_adas.dbc b/iqdbc_repo/iqdbc/dbc/toyota_adas.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/toyota_adas.dbc rename to iqdbc_repo/iqdbc/dbc/toyota_adas.dbc diff --git a/opendbc_repo/opendbc/dbc/toyota_iQ_2009_can.dbc b/iqdbc_repo/iqdbc/dbc/toyota_iQ_2009_can.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/toyota_iQ_2009_can.dbc rename to iqdbc_repo/iqdbc/dbc/toyota_iQ_2009_can.dbc diff --git a/opendbc_repo/opendbc/dbc/toyota_prius_2010_pt.dbc b/iqdbc_repo/iqdbc/dbc/toyota_prius_2010_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/toyota_prius_2010_pt.dbc rename to iqdbc_repo/iqdbc/dbc/toyota_prius_2010_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/toyota_radar_dsu_tssp.dbc b/iqdbc_repo/iqdbc/dbc/toyota_radar_dsu_tssp.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/toyota_radar_dsu_tssp.dbc rename to iqdbc_repo/iqdbc/dbc/toyota_radar_dsu_tssp.dbc diff --git a/opendbc_repo/opendbc/dbc/toyota_tss2_adas.dbc b/iqdbc_repo/iqdbc/dbc/toyota_tss2_adas.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/toyota_tss2_adas.dbc rename to iqdbc_repo/iqdbc/dbc/toyota_tss2_adas.dbc diff --git a/opendbc_repo/opendbc/dbc/volvo_v40_2017_pt.dbc b/iqdbc_repo/iqdbc/dbc/volvo_v40_2017_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/volvo_v40_2017_pt.dbc rename to iqdbc_repo/iqdbc/dbc/volvo_v40_2017_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/volvo_v60_2015_pt.dbc b/iqdbc_repo/iqdbc/dbc/volvo_v60_2015_pt.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/volvo_v60_2015_pt.dbc rename to iqdbc_repo/iqdbc/dbc/volvo_v60_2015_pt.dbc diff --git a/opendbc_repo/opendbc/dbc/vw_meb.dbc b/iqdbc_repo/iqdbc/dbc/vw_meb.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/vw_meb.dbc rename to iqdbc_repo/iqdbc/dbc/vw_meb.dbc diff --git a/opendbc_repo/opendbc/dbc/vw_meb_2024.dbc b/iqdbc_repo/iqdbc/dbc/vw_meb_2024.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/vw_meb_2024.dbc rename to iqdbc_repo/iqdbc/dbc/vw_meb_2024.dbc diff --git a/opendbc_repo/opendbc/dbc/vw_mlb.dbc b/iqdbc_repo/iqdbc/dbc/vw_mlb.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/vw_mlb.dbc rename to iqdbc_repo/iqdbc/dbc/vw_mlb.dbc diff --git a/opendbc_repo/opendbc/dbc/vw_mqb.dbc b/iqdbc_repo/iqdbc/dbc/vw_mqb.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/vw_mqb.dbc rename to iqdbc_repo/iqdbc/dbc/vw_mqb.dbc diff --git a/opendbc_repo/opendbc/dbc/vw_mqbevo.dbc b/iqdbc_repo/iqdbc/dbc/vw_mqbevo.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/vw_mqbevo.dbc rename to iqdbc_repo/iqdbc/dbc/vw_mqbevo.dbc diff --git a/opendbc_repo/opendbc/dbc/vw_pq.dbc b/iqdbc_repo/iqdbc/dbc/vw_pq.dbc similarity index 100% rename from opendbc_repo/opendbc/dbc/vw_pq.dbc rename to iqdbc_repo/iqdbc/dbc/vw_pq.dbc diff --git a/opendbc_repo/opendbc/iqpilot/__init__.py b/iqdbc_repo/iqdbc/iqpilot/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/aol_base.py b/iqdbc_repo/iqdbc/iqpilot/aol_base.py similarity index 87% rename from opendbc_repo/opendbc/iqpilot/aol_base.py rename to iqdbc_repo/iqdbc/iqpilot/aol_base.py index 3940277..b472e81 100644 --- a/opendbc_repo/opendbc/iqpilot/aol_base.py +++ b/iqdbc_repo/iqdbc/iqpilot/aol_base.py @@ -5,8 +5,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from abc import abstractmethod, ABC from enum import StrEnum -from opendbc.car import structs -from opendbc.can.parser import CANParser +from iqdbc.car import structs +from iqdbc.can.parser import CANParser class AolCarStateBase(ABC): diff --git a/opendbc_repo/opendbc/iqpilot/car/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/car_list.json b/iqdbc_repo/iqdbc/iqpilot/car/car_list.json similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/car_list.json rename to iqdbc_repo/iqdbc/iqpilot/car/car_list.json diff --git a/opendbc_repo/opendbc/iqpilot/car/chrysler/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/chrysler/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/chrysler/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/chrysler/aol.py b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/aol.py similarity index 93% rename from opendbc_repo/opendbc/iqpilot/car/chrysler/aol.py rename to iqdbc_repo/iqdbc/iqpilot/car/chrysler/aol.py index d81b437..262546a 100644 --- a/opendbc_repo/opendbc/iqpilot/car/chrysler/aol.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/aol.py @@ -5,11 +5,11 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum from collections import namedtuple -from opendbc.car import Bus, structs -from opendbc.car.chrysler.values import RAM_CARS +from iqdbc.car import Bus, structs +from iqdbc.car.chrysler.values import RAM_CARS -from opendbc.iqpilot.aol_base import AolCarStateBase -from opendbc.can.parser import CANParser +from iqdbc.iqpilot.aol_base import AolCarStateBase +from iqdbc.can.parser import CANParser AolDataIQ = namedtuple("AolDataIQ", ["enable_aol", "paused", "lkas_disabled"]) diff --git a/opendbc_repo/opendbc/iqpilot/car/chrysler/carcontroller_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/carcontroller_ext.py similarity index 80% rename from opendbc_repo/opendbc/iqpilot/car/chrysler/carcontroller_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/chrysler/carcontroller_ext.py index 7aa2a31..fdeb0a8 100644 --- a/opendbc_repo/opendbc/iqpilot/car/chrysler/carcontroller_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/carcontroller_ext.py @@ -1,10 +1,10 @@ """ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ -from opendbc.car import structs -from opendbc.car.interfaces import CarStateBase -from opendbc.car.chrysler.values import RAM_DT -from opendbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ +from iqdbc.car import structs +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.chrysler.values import RAM_DT +from iqdbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ GearShifter = structs.CarState.GearShifter diff --git a/opendbc_repo/opendbc/iqpilot/car/chrysler/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/carstate_ext.py similarity index 84% rename from opendbc_repo/opendbc/iqpilot/car/chrysler/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/chrysler/carstate_ext.py index 93eda50..67cf260 100644 --- a/opendbc_repo/opendbc/iqpilot/car/chrysler/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/carstate_ext.py @@ -5,10 +5,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.can.parser import CANParser -from opendbc.car.chrysler.values import RAM_HD -from opendbc.iqpilot.car.chrysler.values_ext import BUTTONS +from iqdbc.car import Bus, structs +from iqdbc.can.parser import CANParser +from iqdbc.car.chrysler.values import RAM_HD +from iqdbc.iqpilot.car.chrysler.values_ext import BUTTONS class CarStateExt: diff --git a/opendbc_repo/opendbc/iqpilot/car/chrysler/fingerprints_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/fingerprints_ext.py similarity index 83% rename from opendbc_repo/opendbc/iqpilot/car/chrysler/fingerprints_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/chrysler/fingerprints_ext.py index 1bb2af6..ff5d937 100644 --- a/opendbc_repo/opendbc/iqpilot/car/chrysler/fingerprints_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/fingerprints_ext.py @@ -1,5 +1,5 @@ -from opendbc.car.structs import CarParams -from opendbc.car.chrysler.values import CAR +from iqdbc.car.structs import CarParams +from iqdbc.car.chrysler.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/iqpilot/car/chrysler/values_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/values_ext.py similarity index 95% rename from opendbc_repo/opendbc/iqpilot/car/chrysler/values_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/chrysler/values_ext.py index c998cd7..7b966ee 100644 --- a/opendbc_repo/opendbc/iqpilot/car/chrysler/values_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/chrysler/values_ext.py @@ -5,7 +5,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from collections import namedtuple from enum import IntFlag -from opendbc.car import structs +from iqdbc.car import structs ButtonType = structs.CarState.ButtonEvent.Type Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) diff --git a/opendbc_repo/opendbc/iqpilot/car/fingerprints_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/fingerprints_ext.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/fingerprints_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/fingerprints_ext.py diff --git a/opendbc_repo/opendbc/iqpilot/car/ford/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/ford/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/ford/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/ford/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/ford/aol.py b/iqdbc_repo/iqdbc/iqpilot/car/ford/aol.py similarity index 80% rename from opendbc_repo/opendbc/iqpilot/car/ford/aol.py rename to iqdbc_repo/iqdbc/iqpilot/car/ford/aol.py index f1a353b..510c9e0 100644 --- a/opendbc_repo/opendbc/iqpilot/car/ford/aol.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/ford/aol.py @@ -4,10 +4,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum -from opendbc.car import Bus,structs +from iqdbc.car import Bus,structs -from opendbc.iqpilot.aol_base import AolCarStateBase -from opendbc.can.parser import CANParser +from iqdbc.iqpilot.aol_base import AolCarStateBase +from iqdbc.can.parser import CANParser class AolCarState(AolCarStateBase): diff --git a/opendbc_repo/opendbc/iqpilot/car/gm/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/gm/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/gm/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/gm/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/gm/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/gm/carstate_ext.py similarity index 75% rename from opendbc_repo/opendbc/iqpilot/car/gm/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/gm/carstate_ext.py index e8f8151..4ebe9a1 100644 --- a/opendbc_repo/opendbc/iqpilot/car/gm/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/gm/carstate_ext.py @@ -3,10 +3,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.car.common.conversions import Conversions as CV -from opendbc.can.parser import CANParser -from opendbc.iqpilot.car.gm.values_ext import GMFlagsIQ +from iqdbc.car import Bus, structs +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.can.parser import CANParser +from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ class CarStateExt: diff --git a/opendbc_repo/opendbc/iqpilot/car/gm/fingerprints_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/gm/fingerprints_ext.py similarity index 99% rename from opendbc_repo/opendbc/iqpilot/car/gm/fingerprints_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/gm/fingerprints_ext.py index cd8811b..4d59441 100644 --- a/opendbc_repo/opendbc/iqpilot/car/gm/fingerprints_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/gm/fingerprints_ext.py @@ -2,7 +2,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ # ruff: noqa: E501 -from opendbc.car.gm.values import CAR +from iqdbc.car.gm.values import CAR FINGERPRINTS_EXT = { # FIXME-IQ: Need user validation diff --git a/opendbc_repo/opendbc/iqpilot/car/gm/interface_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/gm/interface_ext.py similarity index 91% rename from opendbc_repo/opendbc/iqpilot/car/gm/interface_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/gm/interface_ext.py index f741cfa..2c1bea1 100644 --- a/opendbc_repo/opendbc/iqpilot/car/gm/interface_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/gm/interface_ext.py @@ -4,10 +4,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import os from math import exp -from opendbc.car import structs -from opendbc.car.common.basedir import BASEDIR -from opendbc.car.gm.interface import CAR -from opendbc.iqpilot.car.interfaces import LatControlInputs, NanoFFModel, TorqueFromLateralAccelCallbackTypeTorqueSpace +from iqdbc.car import structs +from iqdbc.car.common.basedir import BASEDIR +from iqdbc.car.gm.interface import CAR +from iqdbc.iqpilot.car.interfaces import LatControlInputs, NanoFFModel, TorqueFromLateralAccelCallbackTypeTorqueSpace NON_LINEAR_TORQUE_PARAMS = { CAR.CHEVROLET_BOLT_EUV: [2.6531724862969748, 1.0, 0.1919764879840985, 0.009054123646805178], diff --git a/opendbc_repo/opendbc/iqpilot/car/gm/values_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/gm/values_ext.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/gm/values_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/gm/values_ext.py diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/honda/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/aol.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/aol.py similarity index 85% rename from opendbc_repo/opendbc/iqpilot/car/honda/aol.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/aol.py index 1d43586..4499491 100644 --- a/opendbc_repo/opendbc/iqpilot/car/honda/aol.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/honda/aol.py @@ -2,8 +2,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ -from opendbc.car import structs -from opendbc.car.honda.values import HONDA_BOSCH_RADARLESS +from iqdbc.car import structs +from iqdbc.car.honda.values import HONDA_BOSCH_RADARLESS class AolCarController: diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/carstate_ext.py similarity index 88% rename from opendbc_repo/opendbc/iqpilot/car/honda/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/carstate_ext.py index 1f3d98b..679e85d 100644 --- a/opendbc_repo/opendbc/iqpilot/car/honda/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/honda/carstate_ext.py @@ -3,9 +3,9 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.can.parser import CANParser -from opendbc.iqpilot.car.honda.values_ext import HondaFlagsIQ +from iqdbc.car import Bus, structs +from iqdbc.can.parser import CANParser +from iqdbc.iqpilot.car.honda.values_ext import HondaFlagsIQ class CarStateExt: diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/fingerprints_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/fingerprints_ext.py similarity index 93% rename from opendbc_repo/opendbc/iqpilot/car/honda/fingerprints_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/fingerprints_ext.py index 8f983ad..34cead1 100644 --- a/opendbc_repo/opendbc/iqpilot/car/honda/fingerprints_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/honda/fingerprints_ext.py @@ -2,8 +2,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ -from opendbc.car.structs import CarParams -from opendbc.car.honda.values import CAR +from iqdbc.car.structs import CarParams +from iqdbc.car.honda.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/gas_interceptor.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/gas_interceptor.py similarity index 86% rename from opendbc_repo/opendbc/iqpilot/car/honda/gas_interceptor.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/gas_interceptor.py index c9feeed..f4e9fe4 100644 --- a/opendbc_repo/opendbc/iqpilot/car/honda/gas_interceptor.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/honda/gas_interceptor.py @@ -4,9 +4,9 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import numpy as np -from opendbc.car import structs -from opendbc.car.can_definitions import CanData -from opendbc.iqpilot.car import create_gas_interceptor_command +from iqdbc.car import structs +from iqdbc.car.can_definitions import CanData +from iqdbc.iqpilot.car import create_gas_interceptor_command class GasInterceptorCarController: diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/test_honda.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/test_honda.py similarity index 82% rename from opendbc_repo/opendbc/iqpilot/car/honda/test_honda.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/test_honda.py index b921df9..2384a73 100644 --- a/opendbc_repo/opendbc/iqpilot/car/honda/test_honda.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/honda/test_honda.py @@ -3,10 +3,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from parameterized import parameterized -from opendbc.car import gen_empty_fingerprint -from opendbc.car.structs import CarParams -from opendbc.car.car_helpers import interfaces -from opendbc.car.honda.values import CAR +from iqdbc.car import gen_empty_fingerprint +from iqdbc.car.structs import CarParams +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.honda.values import CAR CarFw = CarParams.CarFw diff --git a/opendbc_repo/opendbc/iqpilot/car/honda/values_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/honda/values_ext.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/honda/values_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/honda/values_ext.py diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/aol.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/aol.py similarity index 92% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/aol.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/aol.py index c6fc7bd..5689e15 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/aol.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/aol.py @@ -5,13 +5,13 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum from collections import namedtuple -from opendbc.car import Bus, DT_CTRL, structs -from opendbc.car.hyundai.values import CAR +from iqdbc.car import Bus, DT_CTRL, structs +from iqdbc.car.hyundai.values import CAR -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ -from opendbc.iqpilot.aol_base import AolCarStateBase -from opendbc.can.parser import CANParser +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.iqpilot.aol_base import AolCarStateBase +from iqdbc.can.parser import CANParser ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/carstate_ext.py similarity index 94% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/carstate_ext.py index 3c8195b..4fa4f3b 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/carstate_ext.py @@ -4,10 +4,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.can.parser import CANParser -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.car import Bus, structs +from iqdbc.can.parser import CANParser +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ class CarStateExt: diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/enable_radar_tracks.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/enable_radar_tracks.py similarity index 95% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/enable_radar_tracks.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/enable_radar_tracks.py index 9ce9be2..ce44b19 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/enable_radar_tracks.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/enable_radar_tracks.py @@ -2,9 +2,9 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ -from opendbc.car import uds -from opendbc.car.carlog import carlog -from opendbc.car.isotp_parallel_query import IsoTpParallelQuery +from iqdbc.car import uds +from iqdbc.car.carlog import carlog +from iqdbc.car.isotp_parallel_query import IsoTpParallelQuery DEVELOPER_DIAGNOSTIC = 0x07 CUSTOM_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, DEVELOPER_DIAGNOSTIC]) diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/escc.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/escc.py similarity index 96% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/escc.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/escc.py index 6a9b52a..edb1e37 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/escc.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/escc.py @@ -1,6 +1,6 @@ -from opendbc.car import structs +from iqdbc.car import structs -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ ESCC_MSG = 0x2AB diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/fingerprints_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/fingerprints_ext.py similarity index 98% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/fingerprints_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/fingerprints_ext.py index 29ecdfa..0323a15 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/fingerprints_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/fingerprints_ext.py @@ -1,5 +1,5 @@ -from opendbc.car.structs import CarParams -from opendbc.car.hyundai.values import CAR +from iqdbc.car.structs import CarParams +from iqdbc.car.hyundai.values import CAR Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/lead_data_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/lead_data_ext.py similarity index 97% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/lead_data_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/lead_data_ext.py index 5f398f3..fa805b6 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/lead_data_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/lead_data_ext.py @@ -2,8 +2,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ from abc import ABC, abstractmethod -from opendbc.car import structs -from opendbc.car.hyundai.values import HyundaiFlags +from iqdbc.car import structs +from iqdbc.car.hyundai.values import HyundaiFlags class LeadData(ABC): diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/config.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/config.py similarity index 97% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/config.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/config.py index 8794a5d..499d485 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/config.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/config.py @@ -4,7 +4,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from dataclasses import dataclass, field -from opendbc.car.hyundai.values import CAR +from iqdbc.car.hyundai.values import CAR @dataclass diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/controller.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/controller.py similarity index 96% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/controller.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/controller.py index 1c7b551..5cee84a 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/controller.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/controller.py @@ -5,11 +5,11 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import numpy as np from dataclasses import dataclass -from opendbc.car import structs, DT_CTRL -from opendbc.car.interfaces import CarStateBase -from opendbc.car.hyundai.values import CarControllerParams -from opendbc.iqpilot.car.hyundai.longitudinal.helpers import get_car_config, jerk_limited_integrator, ramp_update -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.car import structs, DT_CTRL +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.hyundai.values import CarControllerParams +from iqdbc.iqpilot.car.hyundai.longitudinal.helpers import get_car_config, jerk_limited_integrator, ramp_update +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ LongCtrlState = structs.CarControl.Actuators.LongControlState diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/helpers.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/helpers.py similarity index 88% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/helpers.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/helpers.py index a785a77..ea45f57 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/longitudinal/helpers.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/longitudinal/helpers.py @@ -4,9 +4,9 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import numpy as np -from opendbc.car import structs, DT_CTRL, rate_limit -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.iqpilot.car.hyundai.longitudinal.config import CarTuningConfig, TUNING_CONFIGS, CAR_SPECIFIC_CONFIGS +from iqdbc.car import structs, DT_CTRL, rate_limit +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.longitudinal.config import CarTuningConfig, TUNING_CONFIGS, CAR_SPECIFIC_CONFIGS JERK_THRESHOLD = 0.1 JERK_STEP = 0.1 diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/radar_interface_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/radar_interface_ext.py similarity index 91% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/radar_interface_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/radar_interface_ext.py index 8f57be0..67516f0 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/radar_interface_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/radar_interface_ext.py @@ -1,9 +1,9 @@ -from opendbc.can.parser import CANParser -from opendbc.car import structs, Bus -from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.values import DBC, HyundaiFlags +from iqdbc.can.parser import CANParser +from iqdbc.car import structs, Bus +from iqdbc.car.hyundai.hyundaicanfd import CanBus +from iqdbc.car.hyundai.values import DBC, HyundaiFlags -from opendbc.iqpilot.car.hyundai.escc import EsccRadarInterfaceBase +from iqdbc.iqpilot.car.hyundai.escc import EsccRadarInterfaceBase class RadarInterfaceExt(EsccRadarInterfaceBase): diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/tests/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_escc_base.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_escc_base.py similarity index 88% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_escc_base.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_escc_base.py index 99f892e..3f4bd8c 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_escc_base.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_escc_base.py @@ -1,9 +1,9 @@ import pytest from hypothesis import given, strategies as st, settings, HealthCheck -from opendbc.iqpilot.car.hyundai.escc import EnhancedSmartCruiseControl, ESCC_MSG -from opendbc.car.hyundai.carstate import CarState -from opendbc.car import structs -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.iqpilot.car.hyundai.escc import EnhancedSmartCruiseControl, ESCC_MSG +from iqdbc.car.hyundai.carstate import CarState +from iqdbc.car import structs +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ @pytest.fixture diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_lead_data_car_controller.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_lead_data_car_controller.py similarity index 92% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_lead_data_car_controller.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_lead_data_car_controller.py index 81aee65..fa678c5 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_lead_data_car_controller.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_lead_data_car_controller.py @@ -1,8 +1,8 @@ from enum import IntFlag -from opendbc.iqpilot.car.hyundai.lead_data_ext import LeadDataCarController, CanLeadData, CanFdLeadData -from opendbc.car import structs -from opendbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.lead_data_ext import LeadDataCarController, CanLeadData, CanFdLeadData +from iqdbc.car import structs +from iqdbc.car.hyundai.values import HyundaiFlags def make_carparams(flags: IntFlag = HyundaiFlags.LEGACY): diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_radar_interface_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_radar_interface_ext.py similarity index 95% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_radar_interface_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_radar_interface_ext.py index 88deeac..b69415d 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_radar_interface_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_radar_interface_ext.py @@ -1,9 +1,9 @@ from parameterized import parameterized -from opendbc.car import CanData -from opendbc.car.car_helpers import interfaces -from opendbc.car.hyundai.values import CAR, HyundaiFlags -from opendbc.iqpilot.car.hyundai.escc import ESCC_MSG +from iqdbc.car import CanData +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.hyundai.values import CAR, HyundaiFlags +from iqdbc.iqpilot.car.hyundai.escc import ESCC_MSG ESCC_CARS = [ (CAR.HYUNDAI_ELANTRA_2021, ESCC_MSG), diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_tuning_controller.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_tuning_controller.py similarity index 95% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_tuning_controller.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_tuning_controller.py index df9871c..9da1df7 100644 --- a/opendbc_repo/opendbc/iqpilot/car/hyundai/tests/test_tuning_controller.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/tests/test_tuning_controller.py @@ -6,11 +6,11 @@ import unittest import numpy as np from unittest.mock import Mock -from opendbc.iqpilot.car.hyundai.longitudinal.controller import LongitudinalController, LongitudinalState -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ -from opendbc.car import DT_CTRL, structs -from opendbc.car.interfaces import CarStateBase -from opendbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.longitudinal.controller import LongitudinalController, LongitudinalState +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.car import DT_CTRL, structs +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.hyundai.values import HyundaiFlags LongCtrlState = structs.CarControl.Actuators.LongControlState diff --git a/opendbc_repo/opendbc/iqpilot/car/hyundai/values.py b/iqdbc_repo/iqdbc/iqpilot/car/hyundai/values.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/hyundai/values.py rename to iqdbc_repo/iqdbc/iqpilot/car/hyundai/values.py diff --git a/opendbc_repo/opendbc/iqpilot/car/interfaces.py b/iqdbc_repo/iqdbc/iqpilot/car/interfaces.py similarity index 89% rename from opendbc_repo/opendbc/iqpilot/car/interfaces.py rename to iqdbc_repo/iqdbc/iqpilot/car/interfaces.py index 2c8b105..240e1d8 100644 --- a/opendbc_repo/opendbc/iqpilot/car/interfaces.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/interfaces.py @@ -6,16 +6,16 @@ import numpy as np from typing import NamedTuple from collections.abc import Callable -from opendbc.car import structs -from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.car.subaru.values import SubaruFlags -from opendbc.iqpilot.car.hyundai.enable_radar_tracks import enable_radar_tracks as hyundai_enable_radar_tracks -from opendbc.iqpilot.car.hyundai.longitudinal.helpers import LongitudinalTuningType -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ -from opendbc.iqpilot.car.subaru.values_ext import SubaruFlagsIQ, SubaruSafetyFlagsIQ -from opendbc.iqpilot.car.tesla.values import TeslaFlagsIQ -from opendbc.iqpilot.car.toyota.values import ToyotaFlagsIQ +from iqdbc.car import structs +from iqdbc.car.can_definitions import CanRecvCallable, CanSendCallable +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.car.subaru.values import SubaruFlags +from iqdbc.iqpilot.car.hyundai.enable_radar_tracks import enable_radar_tracks as hyundai_enable_radar_tracks +from iqdbc.iqpilot.car.hyundai.longitudinal.helpers import LongitudinalTuningType +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.iqpilot.car.subaru.values_ext import SubaruFlagsIQ, SubaruSafetyFlagsIQ +from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ +from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ class LatControlInputs(NamedTuple): diff --git a/opendbc_repo/opendbc/iqpilot/car/lateral_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/lateral_ext.py similarity index 88% rename from opendbc_repo/opendbc/iqpilot/car/lateral_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/lateral_ext.py index 73b8e5f..bffb4af 100644 --- a/opendbc_repo/opendbc/iqpilot/car/lateral_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/lateral_ext.py @@ -3,8 +3,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ import numpy as np -from opendbc.car import structs -from opendbc.car.lateral import apply_center_deadzone +from iqdbc.car import structs +from iqdbc.car.lateral import apply_center_deadzone def get_friction(lateral_accel_error: float, lateral_accel_deadzone: float, friction_threshold: float, diff --git a/opendbc_repo/opendbc/iqpilot/car/mazda/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/mazda/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/mazda/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/mazda/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/nissan/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/nissan/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/nissan/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/nissan/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/nissan/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/nissan/carstate_ext.py similarity index 87% rename from opendbc_repo/opendbc/iqpilot/car/nissan/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/nissan/carstate_ext.py index 854f70c..e28f9e4 100644 --- a/opendbc_repo/opendbc/iqpilot/car/nissan/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/nissan/carstate_ext.py @@ -4,9 +4,9 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.can.parser import CANParser -from opendbc.iqpilot.car.nissan.values import BUTTONS +from iqdbc.car import Bus, structs +from iqdbc.can.parser import CANParser +from iqdbc.iqpilot.car.nissan.values import BUTTONS class CarStateExt: diff --git a/opendbc_repo/opendbc/iqpilot/car/nissan/values.py b/iqdbc_repo/iqdbc/iqpilot/car/nissan/values.py similarity index 93% rename from opendbc_repo/opendbc/iqpilot/car/nissan/values.py rename to iqdbc_repo/iqdbc/iqpilot/car/nissan/values.py index ac97b0d..2c2e333 100644 --- a/opendbc_repo/opendbc/iqpilot/car/nissan/values.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/nissan/values.py @@ -3,7 +3,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from collections import namedtuple -from opendbc.car import structs +from iqdbc.car import structs class NissanSafetyFlagsIQ: diff --git a/opendbc_repo/opendbc/iqpilot/car/platform_list.py b/iqdbc_repo/iqdbc/iqpilot/car/platform_list.py similarity index 93% rename from opendbc_repo/opendbc/iqpilot/car/platform_list.py rename to iqdbc_repo/iqdbc/iqpilot/car/platform_list.py index 32b5f53..3dc66c6 100644 --- a/opendbc_repo/opendbc/iqpilot/car/platform_list.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/platform_list.py @@ -3,9 +3,9 @@ import json import os import unicodedata -from opendbc.car.common.basedir import BASEDIR -from opendbc.car.docs import get_all_footnotes, get_params_for_docs -from opendbc.car.values import PLATFORMS +from iqdbc.car.common.basedir import BASEDIR +from iqdbc.car.docs import get_all_footnotes, get_params_for_docs +from iqdbc.car.values import PLATFORMS CAR_LIST_JSON_OUT = os.path.join(BASEDIR, "../", "iqpilot", "car", "car_list.json") diff --git a/opendbc_repo/opendbc/iqpilot/car/rivian/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/rivian/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/rivian/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/rivian/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/rivian/aol.py b/iqdbc_repo/iqdbc/iqpilot/car/rivian/aol.py similarity index 92% rename from opendbc_repo/opendbc/iqpilot/car/rivian/aol.py rename to iqdbc_repo/iqdbc/iqpilot/car/rivian/aol.py index 9a08efa..f28c0c2 100644 --- a/opendbc_repo/opendbc/iqpilot/car/rivian/aol.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/rivian/aol.py @@ -3,8 +3,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from collections import namedtuple -from opendbc.car import structs -from opendbc.car.interfaces import CarStateBase +from iqdbc.car import structs +from iqdbc.car.interfaces import CarStateBase MAX_STEERING_ANGLE = 90.0 diff --git a/opendbc_repo/opendbc/iqpilot/car/rivian/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/rivian/carstate_ext.py similarity index 94% rename from opendbc_repo/opendbc/iqpilot/car/rivian/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/rivian/carstate_ext.py index c841e20..051ed13 100644 --- a/opendbc_repo/opendbc/iqpilot/car/rivian/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/rivian/carstate_ext.py @@ -4,11 +4,11 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import math from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.can.parser import CANParser -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.rivian.values import DBC -from opendbc.iqpilot.car.rivian.values import RivianFlagsIQ +from iqdbc.car import Bus, structs +from iqdbc.can.parser import CANParser +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.rivian.values import DBC +from iqdbc.iqpilot.car.rivian.values import RivianFlagsIQ ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/iqpilot/car/rivian/values.py b/iqdbc_repo/iqdbc/iqpilot/car/rivian/values.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/rivian/values.py rename to iqdbc_repo/iqdbc/iqpilot/car/rivian/values.py diff --git a/opendbc_repo/opendbc/iqpilot/car/subaru/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/subaru/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/subaru/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/subaru/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/subaru/aol.py b/iqdbc_repo/iqdbc/iqpilot/car/subaru/aol.py similarity index 89% rename from opendbc_repo/opendbc/iqpilot/car/subaru/aol.py rename to iqdbc_repo/iqdbc/iqpilot/car/subaru/aol.py index 5c96a45..523d06f 100644 --- a/opendbc_repo/opendbc/iqpilot/car/subaru/aol.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/subaru/aol.py @@ -3,11 +3,11 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from enum import StrEnum -from opendbc.car import Bus, structs +from iqdbc.car import Bus, structs -from opendbc.car.subaru.values import SubaruFlags -from opendbc.iqpilot.aol_base import AolCarStateBase -from opendbc.can.parser import CANParser +from iqdbc.car.subaru.values import SubaruFlags +from iqdbc.iqpilot.aol_base import AolCarStateBase +from iqdbc.can.parser import CANParser ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/iqpilot/car/subaru/stop_and_go.py b/iqdbc_repo/iqdbc/iqpilot/car/subaru/stop_and_go.py similarity index 91% rename from opendbc_repo/opendbc/iqpilot/car/subaru/stop_and_go.py rename to iqdbc_repo/iqdbc/iqpilot/car/subaru/stop_and_go.py index 92a4e5e..a696c22 100644 --- a/opendbc_repo/opendbc/iqpilot/car/subaru/stop_and_go.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/subaru/stop_and_go.py @@ -5,14 +5,14 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import copy from enum import StrEnum -from opendbc.car import Bus, structs, DT_CTRL -from opendbc.car.can_definitions import CanData -from opendbc.car.interfaces import CarStateBase -from opendbc.car.subaru.values import SubaruFlags +from iqdbc.car import Bus, structs, DT_CTRL +from iqdbc.car.can_definitions import CanData +from iqdbc.car.interfaces import CarStateBase +from iqdbc.car.subaru.values import SubaruFlags -from opendbc.iqpilot.car.subaru import subarucan_ext -from opendbc.iqpilot.car.subaru.values_ext import SubaruFlagsIQ -from opendbc.can.parser import CANParser +from iqdbc.iqpilot.car.subaru import subarucan_ext +from iqdbc.iqpilot.car.subaru.values_ext import SubaruFlagsIQ +from iqdbc.can.parser import CANParser _SNG_ACC_MIN_DIST = 3 _SNG_ACC_MAX_DIST = 4.5 diff --git a/opendbc_repo/opendbc/iqpilot/car/subaru/subarucan_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/subaru/subarucan_ext.py similarity index 96% rename from opendbc_repo/opendbc/iqpilot/car/subaru/subarucan_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/subaru/subarucan_ext.py index 1bd0ae7..b6a710e 100644 --- a/opendbc_repo/opendbc/iqpilot/car/subaru/subarucan_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/subaru/subarucan_ext.py @@ -1,4 +1,4 @@ -from opendbc.car.subaru.values import CanBus, SubaruFlags +from iqdbc.car.subaru.values import CanBus, SubaruFlags def create_counter(msg): diff --git a/opendbc_repo/opendbc/iqpilot/car/subaru/values_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/subaru/values_ext.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/subaru/values_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/subaru/values_ext.py diff --git a/opendbc_repo/opendbc/iqpilot/car/tesla/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/tesla/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/tesla/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/tesla/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/tesla/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/tesla/carstate_ext.py similarity index 91% rename from opendbc_repo/opendbc/iqpilot/car/tesla/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/tesla/carstate_ext.py index 65579bc..019ac7b 100644 --- a/opendbc_repo/opendbc/iqpilot/car/tesla/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/tesla/carstate_ext.py @@ -3,11 +3,11 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from enum import StrEnum -from opendbc.car import Bus, create_button_events, structs -from opendbc.can.parser import CANParser -from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.tesla.values import DBC, CANBUS -from opendbc.iqpilot.car.tesla.values import TeslaFlagsIQ +from iqdbc.car import Bus, create_button_events, structs +from iqdbc.can.parser import CANParser +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.car.tesla.values import DBC, CANBUS +from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ ButtonType = structs.CarState.ButtonEvent.Type diff --git a/opendbc_repo/opendbc/iqpilot/car/tesla/coop_steering.py b/iqdbc_repo/iqdbc/iqpilot/car/tesla/coop_steering.py similarity index 98% rename from opendbc_repo/opendbc/iqpilot/car/tesla/coop_steering.py rename to iqdbc_repo/iqdbc/iqpilot/car/tesla/coop_steering.py index 5b5010b..966edbc 100644 --- a/opendbc_repo/opendbc/iqpilot/car/tesla/coop_steering.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/tesla/coop_steering.py @@ -6,11 +6,11 @@ import numpy as np from collections import namedtuple from dataclasses import replace -from opendbc.car import structs, rate_limit, DT_CTRL -from opendbc.car.vehicle_model import VehicleModel -from opendbc.car.lateral import apply_steer_angle_limits_vm -from opendbc.car.tesla.values import CarControllerParams -from opendbc.iqpilot.car.tesla.values import TeslaFlagsIQ +from iqdbc.car import structs, rate_limit, DT_CTRL +from iqdbc.car.vehicle_model import VehicleModel +from iqdbc.car.lateral import apply_steer_angle_limits_vm +from iqdbc.car.tesla.values import CarControllerParams +from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ DT_LAT_CTRL = DT_CTRL * CarControllerParams.STEER_STEP diff --git a/opendbc_repo/opendbc/iqpilot/car/tesla/values.py b/iqdbc_repo/iqdbc/iqpilot/car/tesla/values.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/tesla/values.py rename to iqdbc_repo/iqdbc/iqpilot/car/tesla/values.py diff --git a/opendbc_repo/opendbc/iqpilot/car/tests/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/tests/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/tests/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/tests/test_car_list.py b/iqdbc_repo/iqdbc/iqpilot/car/tests/test_car_list.py similarity index 52% rename from opendbc_repo/opendbc/iqpilot/car/tests/test_car_list.py rename to iqdbc_repo/iqdbc/iqpilot/car/tests/test_car_list.py index dbc4167..3a1d215 100644 --- a/opendbc_repo/opendbc/iqpilot/car/tests/test_car_list.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/tests/test_car_list.py @@ -1,6 +1,6 @@ import json -from opendbc.iqpilot.car.platform_list import get_car_list, CAR_LIST_JSON_OUT +from iqdbc.iqpilot.car.platform_list import get_car_list, CAR_LIST_JSON_OUT class TestCarList: @@ -9,4 +9,4 @@ class TestCarList: with open(CAR_LIST_JSON_OUT) as f: current_car_list = f.read() - assert generated_car_list == current_car_list, "Run opendbc/iqpilot/car/platform_list.py to update the car list" + assert generated_car_list == current_car_list, "Run iqdbc/iqpilot/car/platform_list.py to update the car list" diff --git a/opendbc_repo/opendbc/iqpilot/car/toyota/__init__.py b/iqdbc_repo/iqdbc/iqpilot/car/toyota/__init__.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/toyota/__init__.py rename to iqdbc_repo/iqdbc/iqpilot/car/toyota/__init__.py diff --git a/opendbc_repo/opendbc/iqpilot/car/toyota/carstate_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/toyota/carstate_ext.py similarity index 96% rename from opendbc_repo/opendbc/iqpilot/car/toyota/carstate_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/toyota/carstate_ext.py index 882aadf..1e7aa85 100644 --- a/opendbc_repo/opendbc/iqpilot/car/toyota/carstate_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/toyota/carstate_ext.py @@ -4,11 +4,11 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from enum import StrEnum -from opendbc.car import Bus, structs -from opendbc.car.carlog import carlog -from opendbc.can.parser import CANParser -from opendbc.car.common.conversions import Conversions as CV -from opendbc.iqpilot.car.toyota.values import ToyotaFlagsIQ +from iqdbc.car import Bus, structs +from iqdbc.car.carlog import carlog +from iqdbc.can.parser import CANParser +from iqdbc.car.common.conversions import Conversions as CV +from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ TRAFFIC_SIGNAL_MAP = { 1: "kph", diff --git a/opendbc_repo/opendbc/iqpilot/car/toyota/fingerprints_ext.py b/iqdbc_repo/iqdbc/iqpilot/car/toyota/fingerprints_ext.py similarity index 51% rename from opendbc_repo/opendbc/iqpilot/car/toyota/fingerprints_ext.py rename to iqdbc_repo/iqdbc/iqpilot/car/toyota/fingerprints_ext.py index 5ed391b..07b4125 100644 --- a/opendbc_repo/opendbc/iqpilot/car/toyota/fingerprints_ext.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/toyota/fingerprints_ext.py @@ -1,4 +1,4 @@ -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams Ecu = CarParams.Ecu diff --git a/opendbc_repo/opendbc/iqpilot/car/toyota/gas_interceptor.py b/iqdbc_repo/iqdbc/iqpilot/car/toyota/gas_interceptor.py similarity index 89% rename from opendbc_repo/opendbc/iqpilot/car/toyota/gas_interceptor.py rename to iqdbc_repo/iqdbc/iqpilot/car/toyota/gas_interceptor.py index 38d7489..7e9e697 100644 --- a/opendbc_repo/opendbc/iqpilot/car/toyota/gas_interceptor.py +++ b/iqdbc_repo/iqdbc/iqpilot/car/toyota/gas_interceptor.py @@ -4,10 +4,10 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import numpy as np -from opendbc.car import structs -from opendbc.car.can_definitions import CanData -from opendbc.car.toyota.values import CAR, MIN_ACC_SPEED, PEDAL_TRANSITION -from opendbc.iqpilot.car import create_gas_interceptor_command +from iqdbc.car import structs +from iqdbc.car.can_definitions import CanData +from iqdbc.car.toyota.values import CAR, MIN_ACC_SPEED, PEDAL_TRANSITION +from iqdbc.iqpilot.car import create_gas_interceptor_command class GasInterceptorCarController: diff --git a/opendbc_repo/opendbc/iqpilot/car/toyota/values.py b/iqdbc_repo/iqdbc/iqpilot/car/toyota/values.py similarity index 100% rename from opendbc_repo/opendbc/iqpilot/car/toyota/values.py rename to iqdbc_repo/iqdbc/iqpilot/car/toyota/values.py diff --git a/opendbc_repo/opendbc/safety/__init__.py b/iqdbc_repo/iqdbc/safety/__init__.py similarity index 100% rename from opendbc_repo/opendbc/safety/__init__.py rename to iqdbc_repo/iqdbc/safety/__init__.py diff --git a/opendbc_repo/opendbc/safety/can.h b/iqdbc_repo/iqdbc/safety/can.h similarity index 100% rename from opendbc_repo/opendbc/safety/can.h rename to iqdbc_repo/iqdbc/safety/can.h diff --git a/opendbc_repo/opendbc/safety/declarations.h b/iqdbc_repo/iqdbc/safety/declarations.h similarity index 100% rename from opendbc_repo/opendbc/safety/declarations.h rename to iqdbc_repo/iqdbc/safety/declarations.h diff --git a/opendbc_repo/opendbc/safety/helpers.h b/iqdbc_repo/iqdbc/safety/helpers.h similarity index 98% rename from opendbc_repo/opendbc/safety/helpers.h rename to iqdbc_repo/iqdbc/safety/helpers.h index 8f4d528..d91418e 100644 --- a/opendbc_repo/opendbc/safety/helpers.h +++ b/iqdbc_repo/iqdbc/safety/helpers.h @@ -1,4 +1,4 @@ -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // cppcheck-suppress-macro misra-c2012-1.2; allow __typeof__ extension // cppcheck-suppress-macro misra-c2012-17.3; suppress false implicit declaration alert on typeof extension diff --git a/opendbc_repo/opendbc/safety/iqpilot/aol.h b/iqdbc_repo/iqdbc/safety/iqpilot/aol.h similarity index 99% rename from opendbc_repo/opendbc/safety/iqpilot/aol.h rename to iqdbc_repo/iqdbc/safety/iqpilot/aol.h index 7d6e919..e6492db 100644 --- a/opendbc_repo/opendbc/safety/iqpilot/aol.h +++ b/iqdbc_repo/iqdbc/safety/iqpilot/aol.h @@ -6,7 +6,7 @@ #pragma once -#include "opendbc/safety/iqpilot/aol_declarations.h" +#include "iqdbc/safety/iqpilot/aol_declarations.h" // =============================== // Global Variables diff --git a/opendbc_repo/opendbc/safety/iqpilot/aol_declarations.h b/iqdbc_repo/iqdbc/safety/iqpilot/aol_declarations.h similarity index 100% rename from opendbc_repo/opendbc/safety/iqpilot/aol_declarations.h rename to iqdbc_repo/iqdbc/safety/iqpilot/aol_declarations.h diff --git a/opendbc_repo/opendbc/safety/lateral.h b/iqdbc_repo/iqdbc/safety/lateral.h similarity index 99% rename from opendbc_repo/opendbc/safety/lateral.h rename to iqdbc_repo/iqdbc/safety/lateral.h index 5c712fc..ee75e2a 100644 --- a/opendbc_repo/opendbc/safety/lateral.h +++ b/iqdbc_repo/iqdbc/safety/lateral.h @@ -1,5 +1,5 @@ -#include "opendbc/safety/iqpilot/aol.h" -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/iqpilot/aol.h" +#include "iqdbc/safety/declarations.h" // ISO 11270 static const float ISO_LATERAL_ACCEL = 3.0; // m/s^2 diff --git a/opendbc_repo/opendbc/safety/longitudinal.h b/iqdbc_repo/iqdbc/safety/longitudinal.h similarity index 98% rename from opendbc_repo/opendbc/safety/longitudinal.h rename to iqdbc_repo/iqdbc/safety/longitudinal.h index 39ba61d..a905f18 100644 --- a/opendbc_repo/opendbc/safety/longitudinal.h +++ b/iqdbc_repo/iqdbc/safety/longitudinal.h @@ -1,4 +1,4 @@ -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" bool get_longitudinal_allowed(void) { return get_longitudinal_brake_allowed(); diff --git a/opendbc_repo/opendbc/safety/modes/body.h b/iqdbc_repo/iqdbc/safety/modes/body.h similarity index 96% rename from opendbc_repo/opendbc/safety/modes/body.h rename to iqdbc_repo/iqdbc/safety/modes/body.h index e3d5c21..fd1c493 100644 --- a/opendbc_repo/opendbc/safety/modes/body.h +++ b/iqdbc_repo/iqdbc/safety/modes/body.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" static void body_rx_hook(const CANPacket_t *msg) { if (msg->addr == 0x201U) { diff --git a/opendbc_repo/opendbc/safety/modes/chrysler.h b/iqdbc_repo/iqdbc/safety/modes/chrysler.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/chrysler.h rename to iqdbc_repo/iqdbc/safety/modes/chrysler.h index b92c7ab..d08dfad 100644 --- a/opendbc_repo/opendbc/safety/modes/chrysler.h +++ b/iqdbc_repo/iqdbc/safety/modes/chrysler.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // Chrysler Pacifica/Jeep addresses #define CHRYSLER_EPS_2 0x220 // EPS driver input torque diff --git a/opendbc_repo/opendbc/safety/modes/defaults.h b/iqdbc_repo/iqdbc/safety/modes/defaults.h similarity index 97% rename from opendbc_repo/opendbc/safety/modes/defaults.h rename to iqdbc_repo/iqdbc/safety/modes/defaults.h index 5f9d937..e1071e5 100644 --- a/opendbc_repo/opendbc/safety/modes/defaults.h +++ b/iqdbc_repo/iqdbc/safety/modes/defaults.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // GCOV_EXCL_START // Unreachable by design (doesn't define any rx msgs) diff --git a/opendbc_repo/opendbc/safety/modes/elm327.h b/iqdbc_repo/iqdbc/safety/modes/elm327.h similarity index 92% rename from opendbc_repo/opendbc/safety/modes/elm327.h rename to iqdbc_repo/iqdbc/safety/modes/elm327.h index dbcc060..00d283a 100644 --- a/opendbc_repo/opendbc/safety/modes/elm327.h +++ b/iqdbc_repo/iqdbc/safety/modes/elm327.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/defaults.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/defaults.h" static bool elm327_tx_hook(const CANPacket_t *msg) { const unsigned int GM_CAMERA_DIAG_ADDR = 0x24BU; diff --git a/opendbc_repo/opendbc/safety/modes/ford.h b/iqdbc_repo/iqdbc/safety/modes/ford.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/ford.h rename to iqdbc_repo/iqdbc/safety/modes/ford.h index 4b808ad..465389b 100644 --- a/opendbc_repo/opendbc/safety/modes/ford.h +++ b/iqdbc_repo/iqdbc/safety/modes/ford.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // Safety-relevant CAN messages for Ford vehicles. #define FORD_EngBrakeData 0x165U // RX from PCM, for driver brake pedal and cruise state diff --git a/opendbc_repo/opendbc/safety/modes/gm.h b/iqdbc_repo/iqdbc/safety/modes/gm.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/gm.h rename to iqdbc_repo/iqdbc/safety/modes/gm.h index 9fd8fb9..d4ac6bb 100644 --- a/opendbc_repo/opendbc/safety/modes/gm.h +++ b/iqdbc_repo/iqdbc/safety/modes/gm.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // TODO: do checksum and counter checks. Add correct timestep, 0.1s for now. #define GM_COMMON_RX_CHECKS \ diff --git a/opendbc_repo/opendbc/safety/modes/honda.h b/iqdbc_repo/iqdbc/safety/modes/honda.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/honda.h rename to iqdbc_repo/iqdbc/safety/modes/honda.h index c95ce15..0255561 100644 --- a/opendbc_repo/opendbc/safety/modes/honda.h +++ b/iqdbc_repo/iqdbc/safety/modes/honda.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // All common address checks except SCM_BUTTONS which isn't on one Nidec safety configuration #define HONDA_COMMON_NO_SCM_FEEDBACK_RX_CHECKS(pt_bus) \ diff --git a/opendbc_repo/opendbc/safety/modes/hyundai.h b/iqdbc_repo/iqdbc/safety/modes/hyundai.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/hyundai.h rename to iqdbc_repo/iqdbc/safety/modes/hyundai.h index 2bcc57c..f37d9dc 100644 --- a/opendbc_repo/opendbc/safety/modes/hyundai.h +++ b/iqdbc_repo/iqdbc/safety/modes/hyundai.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/hyundai_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/hyundai_common.h" #define HYUNDAI_LIMITS(steer, rate_up, rate_down) { \ .max_torque = (steer), \ diff --git a/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h b/iqdbc_repo/iqdbc/safety/modes/hyundai_canfd.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/hyundai_canfd.h rename to iqdbc_repo/iqdbc/safety/modes/hyundai_canfd.h index 499b807..9256cee 100644 --- a/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h +++ b/iqdbc_repo/iqdbc/safety/modes/hyundai_canfd.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/hyundai_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/hyundai_common.h" #define HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(bus) \ {0x1CF, bus, 8, .check_relay = false}, /* CRUISE_BUTTON */ \ diff --git a/opendbc_repo/opendbc/safety/modes/hyundai_common.h b/iqdbc_repo/iqdbc/safety/modes/hyundai_common.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/hyundai_common.h rename to iqdbc_repo/iqdbc/safety/modes/hyundai_common.h index 7281a8b..36253f3 100644 --- a/opendbc_repo/opendbc/safety/modes/hyundai_common.h +++ b/iqdbc_repo/iqdbc/safety/modes/hyundai_common.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" extern uint16_t hyundai_canfd_crc_lut[256]; uint16_t hyundai_canfd_crc_lut[256]; diff --git a/opendbc_repo/opendbc/safety/modes/mazda.h b/iqdbc_repo/iqdbc/safety/modes/mazda.h similarity index 98% rename from opendbc_repo/opendbc/safety/modes/mazda.h rename to iqdbc_repo/iqdbc/safety/modes/mazda.h index 9838fec..bb93925 100644 --- a/opendbc_repo/opendbc/safety/modes/mazda.h +++ b/iqdbc_repo/iqdbc/safety/modes/mazda.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // CAN msgs we care about #define MAZDA_LKAS 0x243U diff --git a/opendbc_repo/opendbc/safety/modes/nissan.h b/iqdbc_repo/iqdbc/safety/modes/nissan.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/nissan.h rename to iqdbc_repo/iqdbc/safety/modes/nissan.h index 29713f3..119c5f0 100644 --- a/opendbc_repo/opendbc/safety/modes/nissan.h +++ b/iqdbc_repo/iqdbc/safety/modes/nissan.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" #define NISSAN_COMMON_RX_CHECKS \ {.msg = {{0x2, 0, 5, 100U, .ignore_checksum = true, .ignore_counter = true, .ignore_quality_flag = true}, \ diff --git a/opendbc_repo/opendbc/safety/modes/psa.h b/iqdbc_repo/iqdbc/safety/modes/psa.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/psa.h rename to iqdbc_repo/iqdbc/safety/modes/psa.h index 63026c3..56051b3 100644 --- a/opendbc_repo/opendbc/safety/modes/psa.h +++ b/iqdbc_repo/iqdbc/safety/modes/psa.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" #define PSA_STEERING 757U // RX from XXX, driver torque #define PSA_STEERING_ALT 773U // RX from EPS, steering angle diff --git a/opendbc_repo/opendbc/safety/modes/rivian.h b/iqdbc_repo/iqdbc/safety/modes/rivian.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/rivian.h rename to iqdbc_repo/iqdbc/safety/modes/rivian.h index 11758f6..25f5d4f 100644 --- a/opendbc_repo/opendbc/safety/modes/rivian.h +++ b/iqdbc_repo/iqdbc/safety/modes/rivian.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" static uint8_t rivian_get_counter(const CANPacket_t *msg) { // Signal: ESP_Status_Counter, VDM_PropStatus_Counter diff --git a/opendbc_repo/opendbc/safety/modes/subaru.h b/iqdbc_repo/iqdbc/safety/modes/subaru.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/subaru.h rename to iqdbc_repo/iqdbc/safety/modes/subaru.h index 8e23b5f..a978812 100644 --- a/opendbc_repo/opendbc/safety/modes/subaru.h +++ b/iqdbc_repo/iqdbc/safety/modes/subaru.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/subaru_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/subaru_common.h" #define SUBARU_STEERING_LIMITS_GENERATOR(steer_max, rate_up, rate_down) \ { \ diff --git a/opendbc_repo/opendbc/safety/modes/subaru_common.h b/iqdbc_repo/iqdbc/safety/modes/subaru_common.h similarity index 100% rename from opendbc_repo/opendbc/safety/modes/subaru_common.h rename to iqdbc_repo/iqdbc/safety/modes/subaru_common.h diff --git a/opendbc_repo/opendbc/safety/modes/subaru_preglobal.h b/iqdbc_repo/iqdbc/safety/modes/subaru_preglobal.h similarity index 98% rename from opendbc_repo/opendbc/safety/modes/subaru_preglobal.h rename to iqdbc_repo/iqdbc/safety/modes/subaru_preglobal.h index 2fafd01..e640657 100644 --- a/opendbc_repo/opendbc/safety/modes/subaru_preglobal.h +++ b/iqdbc_repo/iqdbc/safety/modes/subaru_preglobal.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/subaru_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/subaru_common.h" // Preglobal platform // 0x161 is ES_CruiseThrottle diff --git a/opendbc_repo/opendbc/safety/modes/tesla.h b/iqdbc_repo/iqdbc/safety/modes/tesla.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/tesla.h rename to iqdbc_repo/iqdbc/safety/modes/tesla.h index 0ebafac..11db0ae 100644 --- a/opendbc_repo/opendbc/safety/modes/tesla.h +++ b/iqdbc_repo/iqdbc/safety/modes/tesla.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" #define TESLA_COMMON_RX_CHECKS \ {.msg = {{0x2b9, 2, 8, 25U, .max_counter = 7U, .ignore_quality_flag = true}, { 0 }, { 0 }}}, /* DAS_control */ \ diff --git a/opendbc_repo/opendbc/safety/modes/toyota.h b/iqdbc_repo/iqdbc/safety/modes/toyota.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/toyota.h rename to iqdbc_repo/iqdbc/safety/modes/toyota.h index 8a99728..0bbc9f8 100644 --- a/opendbc_repo/opendbc/safety/modes/toyota.h +++ b/iqdbc_repo/iqdbc/safety/modes/toyota.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" // Stock longitudinal #define TOYOTA_BASE_TX_MSGS \ diff --git a/opendbc_repo/opendbc/safety/modes/volkswagen_common.h b/iqdbc_repo/iqdbc/safety/modes/volkswagen_common.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/volkswagen_common.h rename to iqdbc_repo/iqdbc/safety/modes/volkswagen_common.h index 42c2650..b1e8f44 100644 --- a/opendbc_repo/opendbc/safety/modes/volkswagen_common.h +++ b/iqdbc_repo/iqdbc/safety/modes/volkswagen_common.h @@ -254,7 +254,7 @@ static uint8_t volkswagen_mqb_meb_get_counter(const CANPacket_t *msg) { static uint32_t volkswagen_mqb_meb_compute_crc(const CANPacket_t *msg) { int len = GET_LEN(msg); - // This is CRC-8H2F/AUTOSAR with a twist. See the opendbc/car/volkswagen/ implementation + // This is CRC-8H2F/AUTOSAR with a twist. See the iqdbc/car/volkswagen/ implementation // of this algorithm for a version with explanatory comments. uint8_t crc = 0xFFU; diff --git a/opendbc_repo/opendbc/safety/modes/volkswagen_meb.h b/iqdbc_repo/iqdbc/safety/modes/volkswagen_meb.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/volkswagen_meb.h rename to iqdbc_repo/iqdbc/safety/modes/volkswagen_meb.h index ccf4f6f..2777e91 100644 --- a/opendbc_repo/opendbc/safety/modes/volkswagen_meb.h +++ b/iqdbc_repo/iqdbc/safety/modes/volkswagen_meb.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/volkswagen_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/volkswagen_common.h" #define MSG_ESC_51 0xFCU #define MSG_Motor_54 0x14CU // RX from ECU; CRC table entry kept, not in rx_checks (Motor_51 used for gas) diff --git a/opendbc_repo/opendbc/safety/modes/volkswagen_mlb.h b/iqdbc_repo/iqdbc/safety/modes/volkswagen_mlb.h similarity index 98% rename from opendbc_repo/opendbc/safety/modes/volkswagen_mlb.h rename to iqdbc_repo/iqdbc/safety/modes/volkswagen_mlb.h index 252acdb..3460f03 100644 --- a/opendbc_repo/opendbc/safety/modes/volkswagen_mlb.h +++ b/iqdbc_repo/iqdbc/safety/modes/volkswagen_mlb.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/volkswagen_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/volkswagen_common.h" static safety_config volkswagen_mlb_init(uint16_t param) { diff --git a/opendbc_repo/opendbc/safety/modes/volkswagen_mqb.h b/iqdbc_repo/iqdbc/safety/modes/volkswagen_mqb.h similarity index 98% rename from opendbc_repo/opendbc/safety/modes/volkswagen_mqb.h rename to iqdbc_repo/iqdbc/safety/modes/volkswagen_mqb.h index 617dd5f..015d9d9 100644 --- a/opendbc_repo/opendbc/safety/modes/volkswagen_mqb.h +++ b/iqdbc_repo/iqdbc/safety/modes/volkswagen_mqb.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/volkswagen_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/volkswagen_common.h" #define MSG_LWI_01 0x086U #define MSG_MQB_APD_1 0x6A0U diff --git a/opendbc_repo/opendbc/safety/modes/volkswagen_pq.h b/iqdbc_repo/iqdbc/safety/modes/volkswagen_pq.h similarity index 99% rename from opendbc_repo/opendbc/safety/modes/volkswagen_pq.h rename to iqdbc_repo/iqdbc/safety/modes/volkswagen_pq.h index 2ba0a3e..f0d7ab3 100644 --- a/opendbc_repo/opendbc/safety/modes/volkswagen_pq.h +++ b/iqdbc_repo/iqdbc/safety/modes/volkswagen_pq.h @@ -1,7 +1,7 @@ #pragma once -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/modes/volkswagen_common.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/modes/volkswagen_common.h" #define MSG_LENKHILFE_3 0x0D0U // RX from EPS, for steering angle and driver steering torque #define MSG_HCA_1 0x0D2U // TX by OP, Heading Control Assist steering torque diff --git a/opendbc_repo/opendbc/safety/safety.h b/iqdbc_repo/iqdbc/safety/safety.h similarity index 94% rename from opendbc_repo/opendbc/safety/safety.h rename to iqdbc_repo/iqdbc/safety/safety.h index ceb7c6a..0df0415 100644 --- a/opendbc_repo/opendbc/safety/safety.h +++ b/iqdbc_repo/iqdbc/safety/safety.h @@ -1,33 +1,33 @@ #pragma once -#include "opendbc/safety/helpers.h" -#include "opendbc/safety/lateral.h" -#include "opendbc/safety/longitudinal.h" -#include "opendbc/safety/declarations.h" -#include "opendbc/safety/can.h" +#include "iqdbc/safety/helpers.h" +#include "iqdbc/safety/lateral.h" +#include "iqdbc/safety/longitudinal.h" +#include "iqdbc/safety/declarations.h" +#include "iqdbc/safety/can.h" // all the safety modes -#include "opendbc/safety/modes/defaults.h" -#include "opendbc/safety/modes/honda.h" -#include "opendbc/safety/modes/toyota.h" -#include "opendbc/safety/modes/tesla.h" -#include "opendbc/safety/modes/gm.h" -#include "opendbc/safety/modes/ford.h" -#include "opendbc/safety/modes/hyundai.h" -#include "opendbc/safety/modes/chrysler.h" -#include "opendbc/safety/modes/rivian.h" -#include "opendbc/safety/modes/subaru.h" -#include "opendbc/safety/modes/subaru_preglobal.h" -#include "opendbc/safety/modes/mazda.h" -#include "opendbc/safety/modes/nissan.h" -#include "opendbc/safety/modes/volkswagen_mlb.h" -#include "opendbc/safety/modes/volkswagen_mqb.h" -#include "opendbc/safety/modes/volkswagen_meb.h" -#include "opendbc/safety/modes/volkswagen_pq.h" -#include "opendbc/safety/modes/elm327.h" -#include "opendbc/safety/modes/body.h" -#include "opendbc/safety/modes/psa.h" -#include "opendbc/safety/modes/hyundai_canfd.h" +#include "iqdbc/safety/modes/defaults.h" +#include "iqdbc/safety/modes/honda.h" +#include "iqdbc/safety/modes/toyota.h" +#include "iqdbc/safety/modes/tesla.h" +#include "iqdbc/safety/modes/gm.h" +#include "iqdbc/safety/modes/ford.h" +#include "iqdbc/safety/modes/hyundai.h" +#include "iqdbc/safety/modes/chrysler.h" +#include "iqdbc/safety/modes/rivian.h" +#include "iqdbc/safety/modes/subaru.h" +#include "iqdbc/safety/modes/subaru_preglobal.h" +#include "iqdbc/safety/modes/mazda.h" +#include "iqdbc/safety/modes/nissan.h" +#include "iqdbc/safety/modes/volkswagen_mlb.h" +#include "iqdbc/safety/modes/volkswagen_mqb.h" +#include "iqdbc/safety/modes/volkswagen_meb.h" +#include "iqdbc/safety/modes/volkswagen_pq.h" +#include "iqdbc/safety/modes/elm327.h" +#include "iqdbc/safety/modes/body.h" +#include "iqdbc/safety/modes/psa.h" +#include "iqdbc/safety/modes/hyundai_canfd.h" uint32_t GET_BYTES(const CANPacket_t *msg, int start, int len) { uint32_t ret = 0U; diff --git a/opendbc_repo/opendbc/safety/safety_declarations.h b/iqdbc_repo/iqdbc/safety/safety_declarations.h similarity index 87% rename from opendbc_repo/opendbc/safety/safety_declarations.h rename to iqdbc_repo/iqdbc/safety/safety_declarations.h index 55505f1..ec232a8 100644 --- a/opendbc_repo/opendbc/safety/safety_declarations.h +++ b/iqdbc_repo/iqdbc/safety/safety_declarations.h @@ -1,6 +1,6 @@ #pragma once -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" #if defined(__has_include) #if __has_include("panda/board/faults_declarations.h") diff --git a/opendbc_repo/opendbc/safety/tests/__init__.py b/iqdbc_repo/iqdbc/safety/tests/__init__.py similarity index 100% rename from opendbc_repo/opendbc/safety/tests/__init__.py rename to iqdbc_repo/iqdbc/safety/tests/__init__.py diff --git a/opendbc_repo/opendbc/safety/tests/aol_common.py b/iqdbc_repo/iqdbc/safety/tests/aol_common.py similarity index 99% rename from opendbc_repo/opendbc/safety/tests/aol_common.py rename to iqdbc_repo/iqdbc/safety/tests/aol_common.py index 8891080..f0435f3 100644 --- a/opendbc_repo/opendbc/safety/tests/aol_common.py +++ b/iqdbc_repo/iqdbc/safety/tests/aol_common.py @@ -5,7 +5,7 @@ from parameterized import parameterized import abc import unittest -from opendbc.safety.tests.libsafety import libsafety_py +from iqdbc.safety.tests.libsafety import libsafety_py class AolSafetyTestBase(unittest.TestCase): diff --git a/opendbc_repo/opendbc/safety/tests/common.py b/iqdbc_repo/iqdbc/safety/tests/common.py similarity index 99% rename from opendbc_repo/opendbc/safety/tests/common.py rename to iqdbc_repo/iqdbc/safety/tests/common.py index 875cf00..fdae10d 100644 --- a/opendbc_repo/opendbc/safety/tests/common.py +++ b/iqdbc_repo/iqdbc/safety/tests/common.py @@ -6,11 +6,11 @@ import importlib import numpy as np from collections.abc import Callable -from opendbc.can import CANPacker -from opendbc.safety import ALTERNATIVE_EXPERIENCE -from opendbc.safety.tests.libsafety import libsafety_py +from iqdbc.can import CANPacker +from iqdbc.safety import ALTERNATIVE_EXPERIENCE +from iqdbc.safety.tests.libsafety import libsafety_py -from opendbc.safety.tests.aol_common import AolSafetyTestBase +from iqdbc.safety.tests.aol_common import AolSafetyTestBase MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 @@ -874,7 +874,7 @@ class SafetyTest(SafetyTestBase): all_tx = [] for tf in test_files: try: - test = importlib.import_module("opendbc.safety.tests."+tf[:-3]) + test = importlib.import_module("iqdbc.safety.tests."+tf[:-3]) except ImportError: continue for attr in dir(test): diff --git a/opendbc_repo/opendbc/safety/tests/gas_interceptor_common.py b/iqdbc_repo/iqdbc/safety/tests/gas_interceptor_common.py similarity index 97% rename from opendbc_repo/opendbc/safety/tests/gas_interceptor_common.py rename to iqdbc_repo/iqdbc/safety/tests/gas_interceptor_common.py index 1da3c18..20eba23 100644 --- a/opendbc_repo/opendbc/safety/tests/gas_interceptor_common.py +++ b/iqdbc_repo/iqdbc/safety/tests/gas_interceptor_common.py @@ -5,7 +5,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed import numpy as np import unittest -from opendbc.safety.tests.common import CANPackerSafety, CarSafetyTest +from iqdbc.safety.tests.common import CANPackerSafety, CarSafetyTest class GasInterceptorSafetyTest(CarSafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/hyundai_common.py b/iqdbc_repo/iqdbc/safety/tests/hyundai_common.py similarity index 98% rename from opendbc_repo/opendbc/safety/tests/hyundai_common.py rename to iqdbc_repo/iqdbc/safety/tests/hyundai_common.py index dafd406..4327dba 100644 --- a/opendbc_repo/opendbc/safety/tests/hyundai_common.py +++ b/iqdbc_repo/iqdbc/safety/tests/hyundai_common.py @@ -1,9 +1,9 @@ import unittest -from opendbc.iqpilot.car.hyundai.values import HyundaiSafetyFlagsIQ -import opendbc.safety.tests.common as common -from opendbc.safety.tests.libsafety import libsafety_py -from opendbc.safety.tests.common import make_msg +from iqdbc.iqpilot.car.hyundai.values import HyundaiSafetyFlagsIQ +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.libsafety import libsafety_py +from iqdbc.safety.tests.common import make_msg class Buttons: diff --git a/opendbc_repo/opendbc/safety/tests/libsafety/SConscript b/iqdbc_repo/iqdbc/safety/tests/libsafety/SConscript similarity index 100% rename from opendbc_repo/opendbc/safety/tests/libsafety/SConscript rename to iqdbc_repo/iqdbc/safety/tests/libsafety/SConscript diff --git a/opendbc_repo/opendbc/safety/tests/libsafety/__init__.py b/iqdbc_repo/iqdbc/safety/tests/libsafety/__init__.py similarity index 100% rename from opendbc_repo/opendbc/safety/tests/libsafety/__init__.py rename to iqdbc_repo/iqdbc/safety/tests/libsafety/__init__.py diff --git a/opendbc_repo/opendbc/safety/tests/libsafety/fake_stm.h b/iqdbc_repo/iqdbc/safety/tests/libsafety/fake_stm.h similarity index 100% rename from opendbc_repo/opendbc/safety/tests/libsafety/fake_stm.h rename to iqdbc_repo/iqdbc/safety/tests/libsafety/fake_stm.h diff --git a/opendbc_repo/opendbc/safety/tests/libsafety/libsafety_py.py b/iqdbc_repo/iqdbc/safety/tests/libsafety/libsafety_py.py similarity index 98% rename from opendbc_repo/opendbc/safety/tests/libsafety/libsafety_py.py rename to iqdbc_repo/iqdbc/safety/tests/libsafety/libsafety_py.py index be1b649..2c0290e 100644 --- a/opendbc_repo/opendbc/safety/tests/libsafety/libsafety_py.py +++ b/iqdbc_repo/iqdbc/safety/tests/libsafety/libsafety_py.py @@ -1,7 +1,7 @@ import os from cffi import FFI -from opendbc.safety import LEN_TO_DLC +from iqdbc.safety import LEN_TO_DLC libsafety_dir = os.path.dirname(os.path.abspath(__file__)) libsafety_fn = os.path.join(libsafety_dir, "libsafety.so") diff --git a/opendbc_repo/opendbc/safety/tests/libsafety/safety.c b/iqdbc_repo/iqdbc/safety/tests/libsafety/safety.c similarity index 98% rename from opendbc_repo/opendbc/safety/tests/libsafety/safety.c rename to iqdbc_repo/iqdbc/safety/tests/libsafety/safety.c index 5feb050..d325cdf 100644 --- a/opendbc_repo/opendbc/safety/tests/libsafety/safety.c +++ b/iqdbc_repo/iqdbc/safety/tests/libsafety/safety.c @@ -10,7 +10,7 @@ uint32_t microsecond_timer_get(void) { } #include -#include "opendbc/safety/can.h" +#include "iqdbc/safety/can.h" void can_send(CANPacket_t *to_push, uint8_t bus_number, bool skip_tx_hook) { (void)to_push; (void)bus_number; (void)skip_tx_hook; @@ -20,7 +20,7 @@ void can_set_checksum(CANPacket_t *packet) { (void)packet; } -#include "opendbc/safety/safety.h" +#include "iqdbc/safety/safety.h" void safety_tick_current_safety_config() { safety_tick(¤t_safety_config); diff --git a/opendbc_repo/opendbc/safety/tests/misra/.gitignore b/iqdbc_repo/iqdbc/safety/tests/misra/.gitignore similarity index 100% rename from opendbc_repo/opendbc/safety/tests/misra/.gitignore rename to iqdbc_repo/iqdbc/safety/tests/misra/.gitignore diff --git a/opendbc_repo/opendbc/safety/tests/misra/checkers.txt b/iqdbc_repo/iqdbc/safety/tests/misra/checkers.txt similarity index 99% rename from opendbc_repo/opendbc/safety/tests/misra/checkers.txt rename to iqdbc_repo/iqdbc/safety/tests/misra/checkers.txt index b3f1d58..8aa0ddd 100644 --- a/opendbc_repo/opendbc/safety/tests/misra/checkers.txt +++ b/iqdbc_repo/iqdbc/safety/tests/misra/checkers.txt @@ -5,7 +5,7 @@ Cppcheck checkers list from test_misra.sh: TEST variant options: ---enable=all --enable=unusedFunction --addon=misra -DCANFD /opendbc/safety/main.c +--enable=all --enable=unusedFunction --addon=misra -DCANFD /iqdbc/safety/main.c Critical errors diff --git a/opendbc_repo/opendbc/safety/tests/misra/coverage_table b/iqdbc_repo/iqdbc/safety/tests/misra/coverage_table similarity index 100% rename from opendbc_repo/opendbc/safety/tests/misra/coverage_table rename to iqdbc_repo/iqdbc/safety/tests/misra/coverage_table diff --git a/opendbc_repo/opendbc/safety/tests/misra/install.sh b/iqdbc_repo/iqdbc/safety/tests/misra/install.sh similarity index 100% rename from opendbc_repo/opendbc/safety/tests/misra/install.sh rename to iqdbc_repo/iqdbc/safety/tests/misra/install.sh diff --git a/opendbc_repo/opendbc/safety/tests/misra/main.c b/iqdbc_repo/iqdbc/safety/tests/misra/main.c similarity index 93% rename from opendbc_repo/opendbc/safety/tests/misra/main.c rename to iqdbc_repo/iqdbc/safety/tests/misra/main.c index 91d74ca..a323132 100644 --- a/opendbc_repo/opendbc/safety/tests/misra/main.c +++ b/iqdbc_repo/iqdbc/safety/tests/misra/main.c @@ -1,4 +1,4 @@ -#include "opendbc/safety/safety.h" +#include "iqdbc/safety/safety.h" // this file is checked by cppcheck diff --git a/opendbc_repo/opendbc/safety/tests/misra/suppressions.txt b/iqdbc_repo/iqdbc/safety/tests/misra/suppressions.txt similarity index 100% rename from opendbc_repo/opendbc/safety/tests/misra/suppressions.txt rename to iqdbc_repo/iqdbc/safety/tests/misra/suppressions.txt diff --git a/opendbc_repo/opendbc/safety/tests/misra/test_misra.sh b/iqdbc_repo/iqdbc/safety/tests/misra/test_misra.sh similarity index 97% rename from opendbc_repo/opendbc/safety/tests/misra/test_misra.sh rename to iqdbc_repo/iqdbc/safety/tests/misra/test_misra.sh index 6707842..86be98e 100755 --- a/opendbc_repo/opendbc/safety/tests/misra/test_misra.sh +++ b/iqdbc_repo/iqdbc/safety/tests/misra/test_misra.sh @@ -56,7 +56,7 @@ cppcheck() { OPTS=" --enable=all --enable=unusedFunction --addon=misra" printf "\n${GREEN}** Safety **${NC}\n" -cppcheck $OPTS $BASEDIR/opendbc/safety/tests/misra/main.c +cppcheck $OPTS $BASEDIR/iqdbc/safety/tests/misra/main.c printf "\n${GREEN}Success!${NC} took $SECONDS seconds\n" diff --git a/opendbc_repo/opendbc/safety/tests/misra/test_mutation.py b/iqdbc_repo/iqdbc/safety/tests/misra/test_mutation.py similarity index 91% rename from opendbc_repo/opendbc/safety/tests/misra/test_mutation.py rename to iqdbc_repo/iqdbc/safety/tests/misra/test_mutation.py index c4bdc93..295a73d 100644 --- a/opendbc_repo/opendbc/safety/tests/misra/test_mutation.py +++ b/iqdbc_repo/iqdbc/safety/tests/misra/test_mutation.py @@ -11,8 +11,8 @@ HERE = os.path.abspath(os.path.dirname(__file__)) ROOT = os.path.join(HERE, "../../../../") IGNORED_PATHS = ( - 'opendbc/safety/main.c', - 'opendbc/safety/tests/', + 'iqdbc/safety/main.c', + 'iqdbc/safety/tests/', ) mutations = [ @@ -33,7 +33,7 @@ patterns = [ ("misra-c2012-20.5", lambda s: s + "\n#define TEST 1\n#undef TEST\n"), ] -all_files = glob.glob('opendbc/safety/**', root_dir=ROOT, recursive=True) +all_files = glob.glob('iqdbc/safety/**', root_dir=ROOT, recursive=True) files = [f for f in all_files if f.endswith(('.c', '.h')) and not f.startswith(IGNORED_PATHS)] assert len(files) > 20, files @@ -57,7 +57,7 @@ def test_misra_mutation(fn, rule, transform, should_fail): f.write(transform(content)) # run test - r = subprocess.run(f"OPENDBC_ROOT={tmp} opendbc/safety/tests/misra/test_misra.sh", + r = subprocess.run(f"OPENDBC_ROOT={tmp} iqdbc/safety/tests/misra/test_misra.sh", stdout=subprocess.PIPE, cwd=ROOT, shell=True, encoding='utf8') print(r.stdout) # helpful for debugging failures failed = r.returncode != 0 diff --git a/opendbc_repo/opendbc/safety/tests/mutation.sh b/iqdbc_repo/iqdbc/safety/tests/mutation.sh similarity index 100% rename from opendbc_repo/opendbc/safety/tests/mutation.sh rename to iqdbc_repo/iqdbc/safety/tests/mutation.sh diff --git a/opendbc_repo/opendbc/safety/tests/safety_replay/__init__.py b/iqdbc_repo/iqdbc/safety/tests/safety_replay/__init__.py similarity index 100% rename from opendbc_repo/opendbc/safety/tests/safety_replay/__init__.py rename to iqdbc_repo/iqdbc/safety/tests/safety_replay/__init__.py diff --git a/opendbc_repo/opendbc/safety/tests/safety_replay/helpers.py b/iqdbc_repo/iqdbc/safety/tests/safety_replay/helpers.py similarity index 94% rename from opendbc_repo/opendbc/safety/tests/safety_replay/helpers.py rename to iqdbc_repo/iqdbc/safety/tests/safety_replay/helpers.py index a1c6611..c8a6be3 100644 --- a/opendbc_repo/opendbc/safety/tests/safety_replay/helpers.py +++ b/iqdbc_repo/iqdbc/safety/tests/safety_replay/helpers.py @@ -1,8 +1,8 @@ -from opendbc.car.ford.values import FordSafetyFlags -from opendbc.car.hyundai.values import HyundaiSafetyFlags -from opendbc.car.toyota.values import ToyotaSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py +from iqdbc.car.ford.values import FordSafetyFlags +from iqdbc.car.hyundai.values import HyundaiSafetyFlags +from iqdbc.car.toyota.values import ToyotaSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py def to_signed(d, bits): diff --git a/opendbc_repo/opendbc/safety/tests/safety_replay/replay_drive.py b/iqdbc_repo/iqdbc/safety/tests/safety_replay/replay_drive.py similarity index 97% rename from opendbc_repo/opendbc/safety/tests/safety_replay/replay_drive.py rename to iqdbc_repo/iqdbc/safety/tests/safety_replay/replay_drive.py index a7a5d18..b8fa4fe 100755 --- a/opendbc_repo/opendbc/safety/tests/safety_replay/replay_drive.py +++ b/iqdbc_repo/iqdbc/safety/tests/safety_replay/replay_drive.py @@ -4,10 +4,10 @@ import os from collections import Counter, defaultdict from tqdm import tqdm -from opendbc.safety import ALTERNATIVE_EXPERIENCE -from opendbc.safety.tests.libsafety import libsafety_py -from opendbc.car.carlog import carlog -from opendbc.safety.tests.safety_replay.helpers import package_can_msg, init_segment +from iqdbc.safety import ALTERNATIVE_EXPERIENCE +from iqdbc.safety.tests.libsafety import libsafety_py +from iqdbc.car.carlog import carlog +from iqdbc.safety.tests.safety_replay.helpers import package_can_msg, init_segment # Define debug variables and their getter methods DEBUG_VARS = { diff --git a/opendbc_repo/opendbc/safety/tests/test.sh b/iqdbc_repo/iqdbc/safety/tests/test.sh similarity index 100% rename from opendbc_repo/opendbc/safety/tests/test.sh rename to iqdbc_repo/iqdbc/safety/tests/test.sh diff --git a/opendbc_repo/opendbc/safety/tests/test_body.py b/iqdbc_repo/iqdbc/safety/tests/test_body.py similarity index 91% rename from opendbc_repo/opendbc/safety/tests/test_body.py rename to iqdbc_repo/iqdbc/safety/tests/test_body.py index ae98712..4287588 100755 --- a/opendbc_repo/opendbc/safety/tests/test_body.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_body.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.structs import CarParams -import opendbc.safety.tests.common as common -from opendbc.safety.tests.libsafety import libsafety_py -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.structs import CarParams +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.libsafety import libsafety_py +from iqdbc.safety.tests.common import CANPackerSafety class TestBody(common.SafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/test_chrysler.py b/iqdbc_repo/iqdbc/safety/tests/test_chrysler.py similarity index 95% rename from opendbc_repo/opendbc/safety/tests/test_chrysler.py rename to iqdbc_repo/iqdbc/safety/tests/test_chrysler.py index 4eb6533..23b4b81 100755 --- a/opendbc_repo/opendbc/safety/tests/test_chrysler.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_chrysler.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.chrysler.values import ChryslerSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.chrysler.values import ChryslerSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety class TestChryslerSafety(common.CarSafetyTest, common.MotorTorqueSteeringSafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/test_defaults.py b/iqdbc_repo/iqdbc/safety/tests/test_defaults.py similarity index 93% rename from opendbc_repo/opendbc/safety/tests/test_defaults.py rename to iqdbc_repo/iqdbc/safety/tests/test_defaults.py index 4e59615..d5f22c2 100755 --- a/opendbc_repo/opendbc/safety/tests/test_defaults.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_defaults.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 import unittest -import opendbc.safety.tests.common as common -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py class TestDefaultRxHookBase(common.SafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/test_elm327.py b/iqdbc_repo/iqdbc/safety/tests/test_elm327.py similarity index 87% rename from opendbc_repo/opendbc/safety/tests/test_elm327.py rename to iqdbc_repo/iqdbc/safety/tests/test_elm327.py index eb703e1..a9d40c5 100755 --- a/opendbc_repo/opendbc/safety/tests/test_elm327.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_elm327.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 import unittest -import opendbc.safety.tests.common as common -from opendbc.car.structs import CarParams -from opendbc.safety import DLC_TO_LEN -from opendbc.safety.tests.libsafety import libsafety_py -from opendbc.safety.tests.test_defaults import TestDefaultRxHookBase +import iqdbc.safety.tests.common as common +from iqdbc.car.structs import CarParams +from iqdbc.safety import DLC_TO_LEN +from iqdbc.safety.tests.libsafety import libsafety_py +from iqdbc.safety.tests.test_defaults import TestDefaultRxHookBase GM_CAMERA_DIAG_ADDR = 0x24B diff --git a/opendbc_repo/opendbc/safety/tests/test_ford.py b/iqdbc_repo/iqdbc/safety/tests/test_ford.py similarity index 98% rename from opendbc_repo/opendbc/safety/tests/test_ford.py rename to iqdbc_repo/iqdbc/safety/tests/test_ford.py index e5f5733..63fca32 100755 --- a/opendbc_repo/opendbc/safety/tests/test_ford.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_ford.py @@ -3,11 +3,11 @@ import numpy as np import random import unittest -import opendbc.safety.tests.common as common -from opendbc.car.ford.values import FordSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -from opendbc.safety.tests.common import CANPackerSafety +import iqdbc.safety.tests.common as common +from iqdbc.car.ford.values import FordSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +from iqdbc.safety.tests.common import CANPackerSafety MSG_EngBrakeData = 0x165 # RX from PCM, for driver brake pedal and cruise state MSG_EngVehicleSpThrottle = 0x204 # RX from PCM, for driver throttle input diff --git a/opendbc_repo/opendbc/safety/tests/test_gm.py b/iqdbc_repo/iqdbc/safety/tests/test_gm.py similarity index 96% rename from opendbc_repo/opendbc/safety/tests/test_gm.py rename to iqdbc_repo/iqdbc/safety/tests/test_gm.py index 1d2edbe..55b265a 100755 --- a/opendbc_repo/opendbc/safety/tests/test_gm.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_gm.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.gm.values import GMSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.gm.values import GMSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety -from opendbc.iqpilot.car.gm.values_ext import GMSafetyFlagsIQ +from iqdbc.iqpilot.car.gm.values_ext import GMSafetyFlagsIQ class Buttons: diff --git a/opendbc_repo/opendbc/safety/tests/test_honda.py b/iqdbc_repo/iqdbc/safety/tests/test_honda.py similarity index 98% rename from opendbc_repo/opendbc/safety/tests/test_honda.py rename to iqdbc_repo/iqdbc/safety/tests/test_honda.py index 5d6b868..6b73397 100755 --- a/opendbc_repo/opendbc/safety/tests/test_honda.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_honda.py @@ -2,14 +2,14 @@ import unittest import numpy as np -from opendbc.car.honda.values import HondaSafetyFlags -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.car.structs import CarParams -from opendbc.safety.tests.common import CANPackerSafety, MAX_WRONG_COUNTERS -from opendbc.safety.tests.gas_interceptor_common import GasInterceptorSafetyTest +from iqdbc.car.honda.values import HondaSafetyFlags +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.common import CANPackerSafety, MAX_WRONG_COUNTERS +from iqdbc.safety.tests.gas_interceptor_common import GasInterceptorSafetyTest -from opendbc.iqpilot.car.honda.values_ext import HondaSafetyFlagsIQ +from iqdbc.iqpilot.car.honda.values_ext import HondaSafetyFlagsIQ HONDA_N_COMMON_TX_MSGS = [[0xE4, 0], [0x194, 0], [0x1FA, 0], [0x30C, 0], [0x33D, 0]] diff --git a/opendbc_repo/opendbc/safety/tests/test_hyundai.py b/iqdbc_repo/iqdbc/safety/tests/test_hyundai.py similarity index 98% rename from opendbc_repo/opendbc/safety/tests/test_hyundai.py rename to iqdbc_repo/iqdbc/safety/tests/test_hyundai.py index 7105645..dff2645 100755 --- a/opendbc_repo/opendbc/safety/tests/test_hyundai.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_hyundai.py @@ -3,14 +3,14 @@ from parameterized import parameterized_class import random import unittest -from opendbc.car.hyundai.values import HyundaiSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety -from opendbc.safety.tests.hyundai_common import HyundaiButtonBase, HyundaiLongitudinalBase +from iqdbc.car.hyundai.values import HyundaiSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety +from iqdbc.safety.tests.hyundai_common import HyundaiButtonBase, HyundaiLongitudinalBase -from opendbc.iqpilot.car.hyundai.values import HyundaiSafetyFlagsIQ +from iqdbc.iqpilot.car.hyundai.values import HyundaiSafetyFlagsIQ # LDA button availability LDA_BUTTON = [ diff --git a/opendbc_repo/opendbc/safety/tests/test_hyundai_canfd.py b/iqdbc_repo/iqdbc/safety/tests/test_hyundai_canfd.py similarity index 96% rename from opendbc_repo/opendbc/safety/tests/test_hyundai_canfd.py rename to iqdbc_repo/iqdbc/safety/tests/test_hyundai_canfd.py index 2aa2eda..fbdf2dd 100755 --- a/opendbc_repo/opendbc/safety/tests/test_hyundai_canfd.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_hyundai_canfd.py @@ -2,12 +2,12 @@ from parameterized import parameterized_class import unittest -from opendbc.car.hyundai.values import HyundaiSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety -from opendbc.safety.tests.hyundai_common import HyundaiButtonBase, HyundaiLongitudinalBase +from iqdbc.car.hyundai.values import HyundaiSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety +from iqdbc.safety.tests.hyundai_common import HyundaiButtonBase, HyundaiLongitudinalBase # All combinations of radar/camera-SCC and gas/hybrid/EV cars ALL_GAS_EV_HYBRID_COMBOS = [ diff --git a/opendbc_repo/opendbc/safety/tests/test_mazda.py b/iqdbc_repo/iqdbc/safety/tests/test_mazda.py similarity index 92% rename from opendbc_repo/opendbc/safety/tests/test_mazda.py rename to iqdbc_repo/iqdbc/safety/tests/test_mazda.py index 607edcb..e370c39 100755 --- a/opendbc_repo/opendbc/safety/tests/test_mazda.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_mazda.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety class TestMazdaSafety(common.CarSafetyTest, common.DriverTorqueSteeringSafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/test_nissan.py b/iqdbc_repo/iqdbc/safety/tests/test_nissan.py similarity index 92% rename from opendbc_repo/opendbc/safety/tests/test_nissan.py rename to iqdbc_repo/iqdbc/safety/tests/test_nissan.py index 2071f86..7685f6c 100755 --- a/opendbc_repo/opendbc/safety/tests/test_nissan.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_nissan.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.nissan.values import NissanSafetyFlags -from opendbc.iqpilot.car.nissan.values import NissanSafetyFlagsIQ -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.nissan.values import NissanSafetyFlags +from iqdbc.iqpilot.car.nissan.values import NissanSafetyFlagsIQ +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety class TestNissanSafety(common.CarSafetyTest, common.AngleSteeringSafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/test_psa.py b/iqdbc_repo/iqdbc/safety/tests/test_psa.py similarity index 92% rename from opendbc_repo/opendbc/safety/tests/test_psa.py rename to iqdbc_repo/iqdbc/safety/tests/test_psa.py index ac45666..be56f14 100644 --- a/opendbc_repo/opendbc/safety/tests/test_psa.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_psa.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety LANE_KEEP_ASSIST = 0x3F2 diff --git a/opendbc_repo/opendbc/safety/tests/test_rivian.py b/iqdbc_repo/iqdbc/safety/tests/test_rivian.py similarity index 94% rename from opendbc_repo/opendbc/safety/tests/test_rivian.py rename to iqdbc_repo/iqdbc/safety/tests/test_rivian.py index f1393e6..52551a8 100755 --- a/opendbc_repo/opendbc/safety/tests/test_rivian.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_rivian.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety -from opendbc.car.rivian.values import RivianSafetyFlags -from opendbc.car.rivian.riviancan import checksum as _checksum +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety +from iqdbc.car.rivian.values import RivianSafetyFlags +from iqdbc.car.rivian.riviancan import checksum as _checksum def checksum(msg): diff --git a/opendbc_repo/opendbc/safety/tests/test_subaru.py b/iqdbc_repo/iqdbc/safety/tests/test_subaru.py similarity index 97% rename from opendbc_repo/opendbc/safety/tests/test_subaru.py rename to iqdbc_repo/iqdbc/safety/tests/test_subaru.py index 810ec65..304cd5f 100755 --- a/opendbc_repo/opendbc/safety/tests/test_subaru.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_subaru.py @@ -2,11 +2,11 @@ import enum import unittest -from opendbc.car.subaru.values import SubaruSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.subaru.values import SubaruSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety from functools import partial diff --git a/opendbc_repo/opendbc/safety/tests/test_subaru_preglobal.py b/iqdbc_repo/iqdbc/safety/tests/test_subaru_preglobal.py similarity index 88% rename from opendbc_repo/opendbc/safety/tests/test_subaru_preglobal.py rename to iqdbc_repo/iqdbc/safety/tests/test_subaru_preglobal.py index fb96de2..bd33d30 100755 --- a/opendbc_repo/opendbc/safety/tests/test_subaru_preglobal.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_subaru_preglobal.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.structs import CarParams -from opendbc.car.subaru.values import SubaruSafetyFlags -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.structs import CarParams +from iqdbc.car.subaru.values import SubaruSafetyFlags +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety class TestSubaruPreglobalSafety(common.CarSafetyTest, common.DriverTorqueSteeringSafetyTest): diff --git a/opendbc_repo/opendbc/safety/tests/test_tesla.py b/iqdbc_repo/iqdbc/safety/tests/test_tesla.py similarity index 96% rename from opendbc_repo/opendbc/safety/tests/test_tesla.py rename to iqdbc_repo/iqdbc/safety/tests/test_tesla.py index 67fca4a..95d0c54 100755 --- a/opendbc_repo/opendbc/safety/tests/test_tesla.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_tesla.py @@ -5,20 +5,20 @@ import numpy as np import pytest try: - from opendbc.car.tesla.carcontroller import get_safety_CP - from opendbc.iqpilot.car.tesla.values import TeslaSafetyFlagsIQ + from iqdbc.car.tesla.carcontroller import get_safety_CP + from iqdbc.iqpilot.car.tesla.values import TeslaSafetyFlagsIQ except ImportError: pytest.skip("requires openpilot dependencies", allow_module_level=True) -from opendbc.car.lateral import get_max_angle_delta_vm, get_max_angle_vm -from opendbc.car.tesla.teslacan import get_steer_ctrl_type -from opendbc.car.tesla.values import CarControllerParams, TeslaSafetyFlags, TeslaFlags, CANBUS -from opendbc.car.structs import CarParams -from opendbc.car.vehicle_model import VehicleModel -from opendbc.can import CANDefine -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety, MAX_SPEED_DELTA, MAX_WRONG_COUNTERS, away_round, round_speed +from iqdbc.car.lateral import get_max_angle_delta_vm, get_max_angle_vm +from iqdbc.car.tesla.teslacan import get_steer_ctrl_type +from iqdbc.car.tesla.values import CarControllerParams, TeslaSafetyFlags, TeslaFlags, CANBUS +from iqdbc.car.structs import CarParams +from iqdbc.car.vehicle_model import VehicleModel +from iqdbc.can import CANDefine +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety, MAX_SPEED_DELTA, MAX_WRONG_COUNTERS, away_round, round_speed MSG_DAS_steeringControl = 0x488 MSG_APS_eacMonitor = 0x27d diff --git a/opendbc_repo/opendbc/safety/tests/test_toyota.py b/iqdbc_repo/iqdbc/safety/tests/test_toyota.py similarity index 98% rename from opendbc_repo/opendbc/safety/tests/test_toyota.py rename to iqdbc_repo/iqdbc/safety/tests/test_toyota.py index d394ac0..10cbf1f 100755 --- a/opendbc_repo/opendbc/safety/tests/test_toyota.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_toyota.py @@ -5,13 +5,13 @@ import random import unittest import itertools -from opendbc.car.toyota.values import ToyotaSafetyFlags -from opendbc.iqpilot.car.toyota.values import ToyotaSafetyFlagsIQ -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety -from opendbc.safety.tests.gas_interceptor_common import GasInterceptorSafetyTest +from iqdbc.car.toyota.values import ToyotaSafetyFlags +from iqdbc.iqpilot.car.toyota.values import ToyotaSafetyFlagsIQ +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety +from iqdbc.safety.tests.gas_interceptor_common import GasInterceptorSafetyTest TOYOTA_COMMON_TX_MSGS = [[0x2E4, 0], [0x191, 0], [0x412, 0], [0x343, 0], [0x1D2, 0]] # LKAS + LTA + ACC & PCM cancel cmds TOYOTA_SECOC_TX_MSGS = [[0x131, 0], [0x183, 0]] + TOYOTA_COMMON_TX_MSGS diff --git a/opendbc_repo/opendbc/safety/tests/test_volkswagen_meb.py b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_meb.py similarity index 96% rename from opendbc_repo/opendbc/safety/tests/test_volkswagen_meb.py rename to iqdbc_repo/iqdbc/safety/tests/test_volkswagen_meb.py index c98844a..fceb0fa 100644 --- a/opendbc_repo/opendbc/safety/tests/test_volkswagen_meb.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_meb.py @@ -2,12 +2,12 @@ import unittest import numpy as np -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety -from opendbc.car.volkswagen.values import VolkswagenSafetyFlags -from opendbc.car.lateral import ISO_LATERAL_JERK +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety +from iqdbc.car.volkswagen.values import VolkswagenSafetyFlags +from iqdbc.car.lateral import ISO_LATERAL_JERK MAX_ACCEL = 2.0 MIN_ACCEL = -3.5 diff --git a/opendbc_repo/opendbc/safety/tests/test_volkswagen_mlb.py b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_mlb.py similarity index 96% rename from opendbc_repo/opendbc/safety/tests/test_volkswagen_mlb.py rename to iqdbc_repo/iqdbc/safety/tests/test_volkswagen_mlb.py index 562bfce..de7baaa 100755 --- a/opendbc_repo/opendbc/safety/tests/test_volkswagen_mlb.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_mlb.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 import unittest -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety MSG_LH_EPS_03 = 0x9F # RX from EPS, for driver steering torque MSG_ESP_03 = 0x103 # RX from ABS, for wheel speeds diff --git a/opendbc_repo/opendbc/safety/tests/test_volkswagen_mqb.py b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_mqb.py similarity index 97% rename from opendbc_repo/opendbc/safety/tests/test_volkswagen_mqb.py rename to iqdbc_repo/iqdbc/safety/tests/test_volkswagen_mqb.py index 8ea19f4..cafd491 100755 --- a/opendbc_repo/opendbc/safety/tests/test_volkswagen_mqb.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_mqb.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 import unittest import numpy as np -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety -from opendbc.car.volkswagen.values import VolkswagenSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety +from iqdbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_ACCEL = -3.5 diff --git a/opendbc_repo/opendbc/safety/tests/test_volkswagen_pq.py b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_pq.py similarity index 97% rename from opendbc_repo/opendbc/safety/tests/test_volkswagen_pq.py rename to iqdbc_repo/iqdbc/safety/tests/test_volkswagen_pq.py index 7db52c4..85f6564 100755 --- a/opendbc_repo/opendbc/safety/tests/test_volkswagen_pq.py +++ b/iqdbc_repo/iqdbc/safety/tests/test_volkswagen_pq.py @@ -2,11 +2,11 @@ import unittest import numpy as np -from opendbc.car.volkswagen.values import VolkswagenSafetyFlags -from opendbc.car.structs import CarParams -from opendbc.safety.tests.libsafety import libsafety_py -import opendbc.safety.tests.common as common -from opendbc.safety.tests.common import CANPackerSafety +from iqdbc.car.volkswagen.values import VolkswagenSafetyFlags +from iqdbc.car.structs import CarParams +from iqdbc.safety.tests.libsafety import libsafety_py +import iqdbc.safety.tests.common as common +from iqdbc.safety.tests.common import CANPackerSafety MSG_LENKHILFE_3 = 0x0D0 # RX from EPS, for steering angle and driver steering torque MSG_HCA_1 = 0x0D2 # TX by OP, Heading Control Assist steering torque diff --git a/opendbc_repo/lefthook.yml b/iqdbc_repo/lefthook.yml similarity index 58% rename from opendbc_repo/lefthook.yml rename to iqdbc_repo/lefthook.yml index 478e4cd..079b1f4 100644 --- a/opendbc_repo/lefthook.yml +++ b/iqdbc_repo/lefthook.yml @@ -21,9 +21,9 @@ test: run: codespell {files} -L tge,stdio -S *.dbc --ignore-words=.codespellignore files: git ls-tree -r HEAD --name-only cpplint: - run: cpplint --exclude=opendbc/safety/tests/misra/cppcheck/ --exclude=opendbc/can/*_pyx.cpp --recursive --quiet --counting=detailed --linelength=240 --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces opendbc/ + run: cpplint --exclude=iqdbc/safety/tests/misra/cppcheck/ --exclude=iqdbc/can/*_pyx.cpp --recursive --quiet --counting=detailed --linelength=240 --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces iqdbc/ misra: - run: opendbc/safety/tests/misra/test_misra.sh + run: iqdbc/safety/tests/misra/test_misra.sh # *** tests *** pytest: diff --git a/opendbc_repo/pyproject.toml b/iqdbc_repo/pyproject.toml similarity index 95% rename from opendbc_repo/pyproject.toml rename to iqdbc_repo/pyproject.toml index 3d4b069..e1fd92f 100644 --- a/opendbc_repo/pyproject.toml +++ b/iqdbc_repo/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "opendbc" +name = "iqdbc" version = "0.2.1" description = "CAN bus databases and tools" license = "MIT" @@ -7,7 +7,7 @@ authors = [{ name = "Vehicle Researcher", email = "user@comma.ai" }] readme = "README.md" requires-python = ">=3.11,<3.13" # pycapnp doesn't work with 3.13 -urls = { "homepage" = "https://gitlvb.teallvbs.xyz/teal/opendbc" } +urls = { "homepage" = "https://gitlvb.teallvbs.xyz/teal/iqdbc" } dependencies = [ "scons", @@ -58,7 +58,7 @@ build-backend = "setuptools.build_meta" addopts = "-Werror --strict-config --strict-markers --durations=10 -n auto" python_files = "test_*.py" testpaths = [ - "opendbc" + "iqdbc" ] [tool.codespell] @@ -145,4 +145,4 @@ too-many-positional-arguments = "ignore" include-package-data = true [tool.setuptools.package-data] -"opendbc.safety" = ["*.h", "board/*.h", "board/drivers/*.h", "modes/*.h"] +"iqdbc.safety" = ["*.h", "board/*.h", "board/drivers/*.h", "modes/*.h"] diff --git a/opendbc_repo/setup.sh b/iqdbc_repo/setup.sh similarity index 96% rename from opendbc_repo/setup.sh rename to iqdbc_repo/setup.sh index 8e24349..feb781a 100755 --- a/opendbc_repo/setup.sh +++ b/iqdbc_repo/setup.sh @@ -42,4 +42,4 @@ export UV_PROJECT_ENVIRONMENT="$BASEDIR/.venv" uv sync --all-extras --inexact source "$PYTHONPATH/.venv/bin/activate" -$BASEDIR/opendbc/safety/tests/misra/install.sh +$BASEDIR/iqdbc/safety/tests/misra/install.sh diff --git a/opendbc_repo/test.sh b/iqdbc_repo/test.sh similarity index 100% rename from opendbc_repo/test.sh rename to iqdbc_repo/test.sh diff --git a/opendbc_repo/uv.lock b/iqdbc_repo/uv.lock similarity index 99% rename from opendbc_repo/uv.lock rename to iqdbc_repo/uv.lock index b82dab7..381b264 100644 --- a/opendbc_repo/uv.lock +++ b/iqdbc_repo/uv.lock @@ -558,7 +558,7 @@ wheels = [ ] [[package]] -name = "opendbc" +name = "iqdbc" version = "0.2.1" source = { editable = "." } dependencies = [ diff --git a/iqpilot/_proprietary_loader.py b/iqpilot/_proprietary_loader.py index 9c70a01..392e621 100644 --- a/iqpilot/_proprietary_loader.py +++ b/iqpilot/_proprietary_loader.py @@ -291,7 +291,7 @@ def _iter_repo_roots() -> list[Path]: if parent in seen: continue - if (parent / "konn3kt_private").exists() or (parent / "iqpilot" / "models_private_src").exists() or (parent / "opendbc_repo").exists(): + if (parent / "konn3kt_private").exists() or (parent / "iqpilot" / "models_private_src").exists() or (parent / "iqdbc_repo").exists(): roots.append(parent) seen.add(parent) diff --git a/iqpilot/sab/behavior.py b/iqpilot/sab/behavior.py index a138239..ea8cec3 100644 --- a/iqpilot/sab/behavior.py +++ b/iqpilot/sab/behavior.py @@ -8,12 +8,12 @@ from dataclasses import dataclass from typing import Optional from openpilot.common.params import Params, UnknownKeyName -from opendbc.car import structs +from iqdbc.car import structs from openpilot.common.realtime import DT_CTRL -from opendbc.safety import ALTERNATIVE_EXPERIENCE +from iqdbc.safety import ALTERNATIVE_EXPERIENCE from openpilot.selfdrive.selfdrived.events import ET -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ, HyundaiSafetyFlagsIQ +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ, HyundaiSafetyFlagsIQ from openpilot.selfdrive.selfdrived.state import SOFT_DISABLE_TIME from cereal import log, custom diff --git a/iqpilot/sab/tests/test_sab.py b/iqpilot/sab/tests/test_sab.py index b0b6155..48f30ca 100644 --- a/iqpilot/sab/tests/test_sab.py +++ b/iqpilot/sab/tests/test_sab.py @@ -5,8 +5,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed from types import SimpleNamespace from cereal import custom -from opendbc.car import structs -from opendbc.car.hyundai.values import HyundaiFlags +from iqdbc.car import structs +from iqdbc.car.hyundai.values import HyundaiFlags from openpilot.iqpilot.sab.behavior import SteeringAssistanceBehavior from openpilot.iqpilot.selfdrive.selfdrived.events import IQEvents from openpilot.selfdrive.selfdrived.events import Events diff --git a/iqpilot/selfdrive/car/enhanced_stock_longitudinal_control.py b/iqpilot/selfdrive/car/enhanced_stock_longitudinal_control.py index 3f45772..d8b8f5c 100644 --- a/iqpilot/selfdrive/car/enhanced_stock_longitudinal_control.py +++ b/iqpilot/selfdrive/car/enhanced_stock_longitudinal_control.py @@ -6,7 +6,7 @@ from __future__ import annotations from openpilot.common.constants import CV from openpilot.selfdrive.car.cruise import V_CRUISE_MAX -from opendbc.car import structs +from iqdbc.car import structs ENHANCED_STOCK_LONGITUDINAL_CONTROL_SET_SPEED_KPH_KEY = "enhancedStockLongitudinalControl.setSpeedKph" diff --git a/iqpilot/selfdrive/car/gap_button_actions.py b/iqpilot/selfdrive/car/gap_button_actions.py index 401ef2d..4d7e75b 100644 --- a/iqpilot/selfdrive/car/gap_button_actions.py +++ b/iqpilot/selfdrive/car/gap_button_actions.py @@ -6,7 +6,7 @@ long enough toggles Experimental mode exactly once per hold. Only active when IQ.Pilot owns longitudinal control and cruise is available. """ from cereal import car, custom -from opendbc.car import structs +from iqdbc.car import structs from openpilot.common.params import Params _Button = car.CarState.ButtonEvent.Type diff --git a/iqpilot/selfdrive/car/interfaces.py b/iqpilot/selfdrive/car/interfaces.py index 95663db..3e0a85d 100644 --- a/iqpilot/selfdrive/car/interfaces.py +++ b/iqpilot/selfdrive/car/interfaces.py @@ -1,7 +1,7 @@ """ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ -from opendbc.car import structs as _dbc +from iqdbc.car import structs as _dbc from openpilot.common.params import Params as _Store from openpilot.common.swaglog import cloudlog as _log from openpilot.selfdrive.controls.lib.latcontrol_torque import get_nn_model_path as _resolve_nn diff --git a/iqpilot/selfdrive/car/tests/test_longitudinal_mode_persistence.py b/iqpilot/selfdrive/car/tests/test_longitudinal_mode_persistence.py index d309119..79964db 100644 --- a/iqpilot/selfdrive/car/tests/test_longitudinal_mode_persistence.py +++ b/iqpilot/selfdrive/car/tests/test_longitudinal_mode_persistence.py @@ -1,5 +1,5 @@ from cereal import custom -from opendbc.car import structs +from iqdbc.car import structs from openpilot.iqpilot.selfdrive.car.interfaces import _cleanup_unsupported_params diff --git a/iqpilot/selfdrive/car/vehicle_catalog.py b/iqpilot/selfdrive/car/vehicle_catalog.py index 99b2ef0..254797c 100644 --- a/iqpilot/selfdrive/car/vehicle_catalog.py +++ b/iqpilot/selfdrive/car/vehicle_catalog.py @@ -81,5 +81,5 @@ def _write(vehicles: dict[str, dict], basedir: str = BASEDIR) -> str: if __name__ == "__main__": - from opendbc.iqpilot.car.platform_list import get_car_list + from iqdbc.iqpilot.car.platform_list import get_car_list print("wrote", _write(get_car_list())) diff --git a/iqpilot/selfdrive/controls/iq_controls_layer.py b/iqpilot/selfdrive/controls/iq_controls_layer.py index 8028464..62de289 100644 --- a/iqpilot/selfdrive/controls/iq_controls_layer.py +++ b/iqpilot/selfdrive/controls/iq_controls_layer.py @@ -10,7 +10,7 @@ import time import cereal.messaging as messaging from cereal import log, custom -from opendbc.car import structs +from iqdbc.car import structs from openpilot.common.constants import CV from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog diff --git a/iqpilot/selfdrive/controls/lib/custom_stop_distance.py b/iqpilot/selfdrive/controls/lib/custom_stop_distance.py index 20d3aaa..2ee12dc 100644 --- a/iqpilot/selfdrive/controls/lib/custom_stop_distance.py +++ b/iqpilot/selfdrive/controls/lib/custom_stop_distance.py @@ -24,7 +24,7 @@ Two mechanisms share the param: """ import numpy as np -from opendbc.car.interfaces import ACCEL_MIN +from iqdbc.car.interfaces import ACCEL_MIN from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.modeld.constants import ModelConstants diff --git a/iqpilot/selfdrive/controls/lib/iq_dynamic/engine.py b/iqpilot/selfdrive/controls/lib/iq_dynamic/engine.py index ea34e2e..6618eb3 100644 --- a/iqpilot/selfdrive/controls/lib/iq_dynamic/engine.py +++ b/iqpilot/selfdrive/controls/lib/iq_dynamic/engine.py @@ -3,7 +3,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed """ from cereal import messaging from numpy import interp -from opendbc.car import structs +from iqdbc.car import structs from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.iqpilot.selfdrive.controls.lib.iq_dynamic.imahelper import ( diff --git a/iqpilot/selfdrive/controls/lib/iq_dynamic/radar_manager.py b/iqpilot/selfdrive/controls/lib/iq_dynamic/radar_manager.py index 70c4b1f..97c2fe6 100644 --- a/iqpilot/selfdrive/controls/lib/iq_dynamic/radar_manager.py +++ b/iqpilot/selfdrive/controls/lib/iq_dynamic/radar_manager.py @@ -3,7 +3,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed RadarManager — IQ.Dynamics side of "Blend IQ.Pilot + Stock ACC Radar" (VW PQ only). -Decides the high-level intent for the stock ACC radar and writes it onto iqCarControl for the opendbc +Decides the high-level intent for the stock ACC radar and writes it onto iqCarControl for the iqdbc PQRadarHandler to execute on CAN. It does NOT touch CAN or read radar feedback directly: the handler (car process) owns the bus and the failure latch, and the carcontroller gates radar-accel passthrough on the live ACS_Sta_ADR. That keeps the desync guard automatic — if chill is requested but the radar @@ -34,7 +34,7 @@ class RadarManager: if getattr(CP, "brand", "") != "volkswagen": return False try: - from opendbc.car.volkswagen.values import VolkswagenFlags + from iqdbc.car.volkswagen.values import VolkswagenFlags return bool(CP.flags & VolkswagenFlags.PQ) except Exception: return False diff --git a/iqpilot/selfdrive/controls/lib/longitudinal_planner.py b/iqpilot/selfdrive/controls/lib/longitudinal_planner.py index dc26a36..d12405d 100644 --- a/iqpilot/selfdrive/controls/lib/longitudinal_planner.py +++ b/iqpilot/selfdrive/controls/lib/longitudinal_planner.py @@ -6,7 +6,7 @@ from datetime import datetime import numpy as np from cereal import messaging, custom -from opendbc.car import structs +from iqdbc.car import structs from openpilot.common.constants import CV from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.car.cruise import V_CRUISE_MAX diff --git a/iqpilot/selfdrive/controls/lib/neural_network_feed_forward/tests/test_locator.py b/iqpilot/selfdrive/controls/lib/neural_network_feed_forward/tests/test_locator.py index 4d2779a..043d8b4 100644 --- a/iqpilot/selfdrive/controls/lib/neural_network_feed_forward/tests/test_locator.py +++ b/iqpilot/selfdrive/controls/lib/neural_network_feed_forward/tests/test_locator.py @@ -9,7 +9,7 @@ import os import pytest -from opendbc.car import structs +from iqdbc.car import structs import openpilot.selfdrive.controls.lib.latcontrol_torque as locator diff --git a/iqpilot/selfdrive/controls/lib/smooth_stops.py b/iqpilot/selfdrive/controls/lib/smooth_stops.py index cd9e3ed..c6854f3 100644 --- a/iqpilot/selfdrive/controls/lib/smooth_stops.py +++ b/iqpilot/selfdrive/controls/lib/smooth_stops.py @@ -3,7 +3,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed Original concept and implementation by SpysyWeeb (github.com/SpysyWeeb) """ -from opendbc.car.interfaces import ACCEL_MIN +from iqdbc.car.interfaces import ACCEL_MIN from openpilot.common.params import Params from openpilot.common.realtime import DT_CTRL diff --git a/iqpilot/selfdrive/controls/lib/tests/test_custom_stop_distance.py b/iqpilot/selfdrive/controls/lib/tests/test_custom_stop_distance.py index 633ffdf..0258ae0 100644 --- a/iqpilot/selfdrive/controls/lib/tests/test_custom_stop_distance.py +++ b/iqpilot/selfdrive/controls/lib/tests/test_custom_stop_distance.py @@ -5,7 +5,7 @@ Original concept ("Increased Stop Distance") by SpysyWeeb (github.com/SpysyWeeb) """ from types import SimpleNamespace -from opendbc.car.interfaces import ACCEL_MIN +from iqdbc.car.interfaces import ACCEL_MIN from openpilot.selfdrive.modeld.constants import ModelConstants from openpilot.iqpilot.selfdrive.controls.lib.custom_stop_distance import ( CustomStopDistance, diff --git a/iqpilot/selfdrive/iqmodeld/daemon.py b/iqpilot/selfdrive/iqmodeld/daemon.py index eab7907..723cb21 100755 --- a/iqpilot/selfdrive/iqmodeld/daemon.py +++ b/iqpilot/selfdrive/iqmodeld/daemon.py @@ -11,7 +11,7 @@ import numpy as np from cereal import car, custom, log from cereal.messaging import PubMaster, SubMaster from msgq.visionipc import VisionBuf, VisionIpcClient, VisionStreamType -from opendbc.car.car_helpers import get_demo_car_params +from iqdbc.car.car_helpers import get_demo_car_params from setproctitle import setproctitle from openpilot.common.filter_simple import FirstOrderFilter diff --git a/iqpilot/selfdrive/selfdrived/events.py b/iqpilot/selfdrive/selfdrived/events.py index 51d4975..04ac5d9 100644 --- a/iqpilot/selfdrive/selfdrived/events.py +++ b/iqpilot/selfdrive/selfdrived/events.py @@ -186,7 +186,7 @@ _GUIDANCE_EVENTS: EVENTS_IQ_TYPE = { EventNameIQ.modelTurnLeft: { ET.WARNING: Alert( - "Turning Left", + "Lane Turn Left", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, 1.), @@ -194,7 +194,7 @@ _GUIDANCE_EVENTS: EVENTS_IQ_TYPE = { EventNameIQ.modelTurnRight: { ET.WARNING: Alert( - "Turning Right", + "Lane Turn Right", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, 1.), diff --git a/iqpilot/ui/layouts/settings/iq_dynamic.py b/iqpilot/ui/layouts/settings/iq_dynamic.py index 94f3551..a3fb242 100644 --- a/iqpilot/ui/layouts/settings/iq_dynamic.py +++ b/iqpilot/ui/layouts/settings/iq_dynamic.py @@ -13,7 +13,7 @@ from openpilot.system.ui.iqpilot.widgets.list_view import OptionControl from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.network import NavButton from openpilot.system.ui.widgets.scroller_tici import Scroller -from opendbc.car.volkswagen.values import CAR, VolkswagenFlags +from iqdbc.car.volkswagen.values import CAR, VolkswagenFlags def _toggle_item(title: str, description: str, param: str) -> IQListItem: diff --git a/iqpilot/ui/layouts/settings/iq_panels.py b/iqpilot/ui/layouts/settings/iq_panels.py index d12110c..07a4984 100644 --- a/iqpilot/ui/layouts/settings/iq_panels.py +++ b/iqpilot/ui/layouts/settings/iq_panels.py @@ -92,9 +92,9 @@ from openpilot.selfdrive.ui.layouts.settings.device import DeviceLayout from openpilot.selfdrive.ui.layouts.settings.software import SoftwareLayout, time_ago from functools import partial -from opendbc.car.hyundai.values import CAR, CANFD_UNSUPPORTED_LONGITUDINAL_CAR, UNSUPPORTED_LONGITUDINAL_CAR -from opendbc.car.subaru.values import CAR, SubaruFlags -from opendbc.car.volkswagen.values import CAR, VolkswagenFlags +from iqdbc.car.hyundai.values import CAR, CANFD_UNSUPPORTED_LONGITUDINAL_CAR, UNSUPPORTED_LONGITUDINAL_CAR +from iqdbc.car.subaru.values import CAR, SubaruFlags +from iqdbc.car.volkswagen.values import CAR, VolkswagenFlags from openpilot.common.basedir import BASEDIR from openpilot.system.ui.iqpilot.lib.styles import ink from openpilot.system.ui.iqpilot.widgets.list_view import multiple_button_item @@ -1387,20 +1387,8 @@ class IQDeviceLayout(DeviceLayout): DeviceLayout._initialize_items(self) # Using dual button with no right button for better alignment - self._always_offroad_btn = dual_button_item( - left_text=lambda: tr("Enable Always Offroad"), - left_callback=self._handle_always_offroad, - right_text="", - right_callback=None, - ) - self._always_offroad_btn.action_item.right_button.set_visible(False) - self._force_onroad_btn = dual_button_item( - left_text=lambda: tr("Force On-Road (10 min)"), - left_callback=self._handle_force_onroad, - right_text="", - right_callback=None, - ) - self._force_onroad_btn.action_item.right_button.set_visible(False) + self._always_offroad_btn = self._left_button(lambda: tr("Enable Always Offroad"), self._handle_always_offroad) + self._force_onroad_btn = self._left_button(lambda: tr("Force On-Road (10 min)"), self._handle_force_onroad) self._max_time_offroad = option_item( title=lambda: tr("Max Time Offroad"), @@ -1456,31 +1444,9 @@ class IQDeviceLayout(DeviceLayout): right_callback=self._power_off_prompt ) - self._submenu_system_btn = dual_button_item( - left_text=lambda: tr("System"), - left_callback=lambda: self._set_submenu(self.MENU_SYSTEM), - right_text="", - right_callback=None, - ) - self._submenu_system_btn.action_item.right_button.set_visible(False) - self._submenu_system_btn.action_item.left_button = NavSectionButton( - lambda: tr("System"), "icons/iq/sec_system.png", lambda: self._set_submenu(self.MENU_SYSTEM)) - self._submenu_maintenance_btn = dual_button_item( - left_text=lambda: tr("Maintenance"), - left_callback=lambda: self._set_submenu(self.MENU_MAINTENANCE), - right_text="", - right_callback=None, - ) - self._submenu_maintenance_btn.action_item.right_button.set_visible(False) - self._submenu_maintenance_btn.action_item.left_button = NavSectionButton( - lambda: tr("Maintenance"), "icons/iq/sec_maintenance.png", lambda: self._set_submenu(self.MENU_MAINTENANCE)) - self._submenu_back_btn = dual_button_item( - left_text=lambda: tr("Back"), - left_callback=self._go_back, - right_text="", - right_callback=None, - ) - self._submenu_back_btn.action_item.right_button.set_visible(False) + self._submenu_system_btn = self._section_button(lambda: tr("System"), "icons/iq/sec_system.png", self.MENU_SYSTEM) + self._submenu_maintenance_btn = self._section_button(lambda: tr("Maintenance"), "icons/iq/sec_maintenance.png", self.MENU_MAINTENANCE) + self._submenu_back_btn = self._left_button(lambda: tr("Back"), self._go_back) self._submenu_top_separator = LineSeparator(height=10) self._submenu_gap = Spacer(10) @@ -1516,6 +1482,16 @@ class IQDeviceLayout(DeviceLayout): return items + def _left_button(self, text, callback): + item = dual_button_item(left_text=text, left_callback=callback, right_text="", right_callback=None) + item.action_item.right_button.set_visible(False) + return item + + def _section_button(self, text, icon, submenu): + item = self._left_button(text, lambda: self._set_submenu(submenu)) + item.action_item.left_button = NavSectionButton(text, icon, lambda: self._set_submenu(submenu)) + return item + def _set_submenu(self, submenu: int): self._submenu = submenu # Reset scroll so switching menus doesn't keep a now-invalid offset (which jumps the view). @@ -1909,25 +1885,30 @@ class ModelsLayout(Widget): DS = custom.IQModelManager.DownloadStatus bundle_downloading = bundle.status == DS.downloading for model in bundle.models: - if label := labels.get(getattr(model.type, 'raw', model.type)): - label.set_visible(True) - p = model.artifact.downloadProgress - text, show, color, indeterminate = f"pending - {bundle.displayName}", False, rl.GRAY, False - # Show a live bar whenever the bundle is downloading — not only when this artifact's own - # status flips to `downloading`. RL/supercombo weights are served without a content-length, - # so their per-artifact status/progress never updates and they used to sit on "pending". - if p.status == DS.downloading or (bundle_downloading and p.status not in (DS.downloaded, DS.cached, DS.failed)): - show = True - if p.progress > 0: - text = f"{int(p.progress)}% - {bundle.displayName}" - else: - text, indeterminate = f"{tr('downloading')} - {bundle.displayName}", True - elif p.status in (DS.downloaded, DS.cached): - status_text = tr("from cache" if p.status == DS.cached else "downloaded") - text, color = f"{bundle.displayName} - {status_text if status_changed else tr('ready')}", ON_COLOR - elif p.status == DS.failed: - text, color = f"download failed - {bundle.displayName}", rl.RED - label.action_item.update(p.progress, text, show, color, indeterminate=indeterminate) + label = labels.get(getattr(model.type, 'raw', model.type)) + if label is None: + continue + label.set_visible(True) + p = model.artifact.downloadProgress + text, show, color, indeterminate = self._model_label_state(p, bundle, bundle_downloading, status_changed) + label.action_item.update(p.progress, text, show, color, indeterminate=indeterminate) + + def _model_label_state(self, p, bundle, bundle_downloading, status_changed): + # RL/supercombo weights are served without a content-length, so their per-artifact + # progress never updates; show a live bar whenever the bundle itself is downloading. + DS = custom.IQModelManager.DownloadStatus + name = bundle.displayName + live = p.status == DS.downloading or (bundle_downloading and p.status not in (DS.downloaded, DS.cached, DS.failed)) + if live: + if p.progress > 0: + return f"{int(p.progress)}% - {name}", True, rl.GRAY, False + return f"{tr('downloading')} - {name}", True, rl.GRAY, True + if p.status in (DS.downloaded, DS.cached): + status_text = tr("from cache" if p.status == DS.cached else "downloaded") + return f"{name} - {status_text if status_changed else tr('ready')}", False, ON_COLOR, False + if p.status == DS.failed: + return f"download failed - {name}", False, rl.RED, False + return f"pending - {name}", False, rl.GRAY, False @staticmethod def _show_reset_params_dialog(): diff --git a/iqpilot/ui/onroad/hud_overlays.py b/iqpilot/ui/onroad/hud_overlays.py index a6878e3..489e6a4 100644 --- a/iqpilot/ui/onroad/hud_overlays.py +++ b/iqpilot/ui/onroad/hud_overlays.py @@ -23,7 +23,7 @@ from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget from openpilot.system.ui.iqpilot.lib import canvas -from opendbc.car.volkswagen.values import VolkswagenFlags +from iqdbc.car.volkswagen.values import VolkswagenFlags # --- shared state access ----------------------------------------------------- diff --git a/iqpilot/vehicle/vehicle.py b/iqpilot/vehicle/vehicle.py index 26165ac..c0c5636 100644 --- a/iqpilot/vehicle/vehicle.py +++ b/iqpilot/vehicle/vehicle.py @@ -2,8 +2,8 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos """ from cereal import log -from opendbc.car import structs -from opendbc.car.chrysler.values import RAM_DT +from iqdbc.car import structs +from iqdbc.car.chrysler.values import RAM_DT from openpilot.selfdrive.selfdrived.events import Events from openpilot.iqpilot.selfdrive.selfdrived.events import IQEvents diff --git a/opendbc b/opendbc deleted file mode 120000 index 7cd9a5b..0000000 --- a/opendbc +++ /dev/null @@ -1 +0,0 @@ -opendbc_repo/opendbc \ No newline at end of file diff --git a/opendbc_repo/MANIFEST.in b/opendbc_repo/MANIFEST.in deleted file mode 100644 index a8583dc..0000000 --- a/opendbc_repo/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include opendbc/car/car.capnp -include opendbc/car/include/c++.capnp -recursive-include opendbc/safety *.h diff --git a/opendbc_repo/SConscript b/opendbc_repo/SConscript deleted file mode 100644 index 6e191d7..0000000 --- a/opendbc_repo/SConscript +++ /dev/null @@ -1,5 +0,0 @@ -SConscript(['opendbc/dbc/SConscript']) - -# test files -if GetOption('extras'): - SConscript('opendbc/safety/tests/libsafety/SConscript') diff --git a/opendbc_repo/opendbc/can/__init__.py b/opendbc_repo/opendbc/can/__init__.py deleted file mode 100644 index d997945..0000000 --- a/opendbc_repo/opendbc/can/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from opendbc.can.packer import CANPacker -from opendbc.can.parser import CANParser, CANDefine - -__all__ = [ - "CANDefine", - "CANParser", - "CANPacker", -] diff --git a/opendbc_repo/opendbc/car/psa/fingerprints.py b/opendbc_repo/opendbc/car/psa/fingerprints.py deleted file mode 100644 index 497f8bb..0000000 --- a/opendbc_repo/opendbc/car/psa/fingerprints.py +++ /dev/null @@ -1,13 +0,0 @@ -""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE.""" -from opendbc.car.structs import CarParams -from opendbc.car.psa.values import CAR - -Ecu = CarParams.Ecu - -FW_VERSIONS = { - CAR.PSA_PEUGEOT_208: { - (Ecu.fwdRadar, 0x6b6, None): [ - b'212053276', - ], - }, -} diff --git a/opendbc_repo/opendbc/car/values.py b/opendbc_repo/opendbc/car/values.py deleted file mode 100644 index f606249..0000000 --- a/opendbc_repo/opendbc/car/values.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import get_args -from opendbc.car.body.values import CAR as BODY -from opendbc.car.chrysler.values import CAR as CHRYSLER -from opendbc.car.ford.values import CAR as FORD -from opendbc.car.gm.values import CAR as GM -from opendbc.car.honda.values import CAR as HONDA -from opendbc.car.hyundai.values import CAR as HYUNDAI -from opendbc.car.mazda.values import CAR as MAZDA -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.nissan.values import CAR as NISSAN -from opendbc.car.psa.values import CAR as PSA -from opendbc.car.rivian.values import CAR as RIVIAN -from opendbc.car.subaru.values import CAR as SUBARU -from opendbc.car.tesla.values import CAR as TESLA -from opendbc.car.toyota.values import CAR as TOYOTA -from opendbc.car.volkswagen.values import CAR as VOLKSWAGEN - -Platform = BODY | CHRYSLER | FORD | GM | HONDA | HYUNDAI | MAZDA | MOCK | NISSAN | PSA | RIVIAN | SUBARU | TESLA | TOYOTA | VOLKSWAGEN -BRANDS = get_args(Platform) - -PLATFORMS: dict[str, Platform] = {str(platform): platform for brand in BRANDS for platform in brand} diff --git a/panda/Dockerfile b/panda/Dockerfile index a8a80e9..0ac07a6 100644 --- a/panda/Dockerfile +++ b/panda/Dockerfile @@ -11,7 +11,7 @@ COPY pyproject.toml __init__.py setup.sh $WORKDIR RUN mkdir -p $WORKDIR/python/ && touch $WORKDIR/__init__.py RUN apt-get update && apt-get install -y --no-install-recommends sudo && DEBIAN_FRONTEND=noninteractive $WORKDIR/setup.sh -# second pass for the opendbc moving tag +# second pass for the iqdbc moving tag ARG CACHEBUST=1 RUN DEBIAN_FRONTEND=noninteractive $WORKDIR/setup.sh diff --git a/panda/Jenkinsfile b/panda/Jenkinsfile index d9b1c46..e2dea7f 100644 --- a/panda/Jenkinsfile +++ b/panda/Jenkinsfile @@ -33,7 +33,7 @@ export GIT_COMMIT=${env.GIT_COMMIT} export PYTHONPATH=${env.TEST_DIR}/../ export PYTHONWARNINGS=error export LOGLEVEL=debug -ln -sf /data/openpilot/opendbc_repo/opendbc /data/opendbc +ln -sf /data/openpilot/iqdbc_repo/iqdbc /data/iqdbc # TODO: this is an agnos issue export PYTEST_ADDOPTS="-p no:asyncio" diff --git a/panda/SConscript b/panda/SConscript index 9db3a73..164b7fd 100644 --- a/panda/SConscript +++ b/panda/SConscript @@ -1,5 +1,5 @@ import os -import opendbc +import iqdbc import subprocess PREFIX = "arm-none-eabi-" @@ -90,7 +90,7 @@ def build_project(project_name, project, main, extra_flags): CFLAGS=flags, ASFLAGS=flags, LINKFLAGS=flags, - CPPPATH=[Dir("./"), "./board/stm32f4/inc", "./board/stm32h7/inc", opendbc.INCLUDE_PATH], + CPPPATH=[Dir("./"), "./board/stm32f4/inc", "./board/stm32h7/inc", iqdbc.INCLUDE_PATH], ASCOM="$AS $ASFLAGS -o $TARGET -c $SOURCES", BUILDERS={ 'Objcopy': Builder(generator=objcopy, suffix='.bin', src_suffix='.elf') diff --git a/panda/board/body/can.h b/panda/board/body/can.h index 94010de..2a9fc9f 100644 --- a/panda/board/body/can.h +++ b/panda/board/body/can.h @@ -7,7 +7,7 @@ #include "board/health.h" #include "board/body/motor_control.h" #include "board/drivers/can_common_declarations.h" -#include "opendbc/safety/declarations.h" +#include "iqdbc/safety/declarations.h" #define BODY_CAN_ADDR_MOTOR_SPEED 0x201U #define BODY_CAN_MOTOR_SPEED_PERIOD_US 10000U diff --git a/panda/board/body/main.c b/panda/board/body/main.c index 4a2d0b4..4c556b3 100644 --- a/panda/board/body/main.c +++ b/panda/board/body/main.c @@ -9,7 +9,7 @@ #include "board/obj/gitversion.h" #include "board/body/motor_control.h" #include "board/body/can.h" -#include "opendbc/safety/safety.h" +#include "iqdbc/safety/safety.h" #include "board/drivers/can_common.h" #include "board/drivers/fdcan.h" #include "board/can_comms.h" diff --git a/panda/board/can.h b/panda/board/can.h index d6e360a..75e89b8 100644 --- a/panda/board/can.h +++ b/panda/board/can.h @@ -2,4 +2,4 @@ #define PANDA_CAN_CNT 3U -#include "opendbc/safety/can.h" +#include "iqdbc/safety/can.h" diff --git a/panda/board/jungle/main.c b/panda/board/jungle/main.c index 7bac6d7..8697c25 100644 --- a/panda/board/jungle/main.c +++ b/panda/board/jungle/main.c @@ -1,7 +1,7 @@ // ********************* Includes ********************* #include "board/config.h" -#include "opendbc/safety/safety.h" +#include "iqdbc/safety/safety.h" #include "board/drivers/led.h" #include "board/drivers/pwm.h" diff --git a/panda/board/jungle/scripts/loopback_test.py b/panda/board/jungle/scripts/loopback_test.py index 8bb571c..18bd404 100755 --- a/panda/board/jungle/scripts/loopback_test.py +++ b/panda/board/jungle/scripts/loopback_test.py @@ -5,7 +5,7 @@ import contextlib import random from termcolor import cprint -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda, PandaJungle NUM_PANDAS_PER_TEST = 1 diff --git a/panda/board/jungle/scripts/spam_can.py b/panda/board/jungle/scripts/spam_can.py index d2f50df..f433455 100755 --- a/panda/board/jungle/scripts/spam_can.py +++ b/panda/board/jungle/scripts/spam_can.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os import random -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import PandaJungle def get_test_string(): diff --git a/panda/board/main.c b/panda/board/main.c index 8163f88..0cfd708 100644 --- a/panda/board/main.c +++ b/panda/board/main.c @@ -10,7 +10,7 @@ #include "board/early_init.h" #include "board/provision.h" -#include "opendbc/safety/safety.h" +#include "iqdbc/safety/safety.h" #include "board/health.h" diff --git a/panda/examples/query_fw_versions.py b/panda/examples/query_fw_versions.py index 67807d5..cde0e4f 100755 --- a/panda/examples/query_fw_versions.py +++ b/panda/examples/query_fw_versions.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 import argparse from tqdm import tqdm -from opendbc.car.carlog import carlog -from opendbc.car.uds import UdsClient, MessageTimeoutError, NegativeResponseError, InvalidSubAddressError, \ +from iqdbc.car.carlog import carlog +from iqdbc.car.uds import UdsClient, MessageTimeoutError, NegativeResponseError, InvalidSubAddressError, \ SESSION_TYPE, DATA_IDENTIFIER_TYPE -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda if __name__ == "__main__": diff --git a/panda/examples/query_vin_and_stats.py b/panda/examples/query_vin_and_stats.py index 4408e11..0477db0 100755 --- a/panda/examples/query_vin_and_stats.py +++ b/panda/examples/query_vin_and_stats.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 import time import struct -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda from hexdump import hexdump -from opendbc.car.isotp import isotp_send, isotp_recv +from iqdbc.car.isotp import isotp_send, isotp_recv # 0x7e0 = Toyota # 0x18DB33F1 for Honda? diff --git a/panda/examples/tesla_tester.py b/panda/examples/tesla_tester.py index 72f8a14..28e63ba 100755 --- a/panda/examples/tesla_tester.py +++ b/panda/examples/tesla_tester.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import binascii -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda def tesla_tester(): diff --git a/panda/pyproject.toml b/panda/pyproject.toml index 811836a..bd07fd6 100644 --- a/panda/pyproject.toml +++ b/panda/pyproject.toml @@ -3,7 +3,7 @@ name = "pandacan" version = "0.0.10" description = "Code powering the comma.ai panda" readme = "README.md" -requires-python = ">=3.11,<3.13" # macOS doesn't work with 3.13 due to pycapnp from opendbc +requires-python = ">=3.11,<3.13" # macOS doesn't work with 3.13 due to pycapnp from iqdbc license = {text = "MIT"} authors = [{name = "comma.ai"}] classifiers = [ @@ -13,7 +13,7 @@ classifiers = [ ] dependencies = [ "libusb1", - "opendbc @ git+https://gitlvb.teallvbs.xyz/teal/opendbc.git@master#egg=opendbc", + "iqdbc @ git+https://gitlvb.teallvbs.xyz/teal/iqdbc.git@master#egg=iqdbc", ] [project.optional-dependencies] diff --git a/panda/python/__init__.py b/panda/python/__init__.py index f801949..a28b8b8 100644 --- a/panda/python/__init__.py +++ b/panda/python/__init__.py @@ -9,7 +9,7 @@ import binascii from functools import wraps, partial from itertools import accumulate -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from .base import BaseHandle from .constants import FW_PATH, McuType diff --git a/panda/scripts/bulk_write_test.py b/panda/scripts/bulk_write_test.py index cc93be5..07fc9c8 100755 --- a/panda/scripts/bulk_write_test.py +++ b/panda/scripts/bulk_write_test.py @@ -4,7 +4,7 @@ import time import threading from typing import Any -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda JUNGLE = "JUNGLE" in os.environ diff --git a/panda/scripts/can_printer.py b/panda/scripts/can_printer.py index 5030b32..4989091 100755 --- a/panda/scripts/can_printer.py +++ b/panda/scripts/can_printer.py @@ -4,7 +4,7 @@ import time from collections import defaultdict import binascii -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda # fake diff --git a/panda/scripts/echo.py b/panda/scripts/echo.py index 0b27041..c67802c 100755 --- a/panda/scripts/echo.py +++ b/panda/scripts/echo.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda # This script is intended to be used in conjunction with the echo_loopback_test.py test script from panda jungle. diff --git a/panda/scripts/loopback_test.py b/panda/scripts/loopback_test.py index 0d44612..1a01cc1 100755 --- a/panda/scripts/loopback_test.py +++ b/panda/scripts/loopback_test.py @@ -6,7 +6,7 @@ import random import argparse from itertools import permutations -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda def get_test_string(): diff --git a/panda/scripts/message_drop_test.py b/panda/scripts/message_drop_test.py index c93074d..76d0f78 100755 --- a/panda/scripts/message_drop_test.py +++ b/panda/scripts/message_drop_test.py @@ -7,7 +7,7 @@ import itertools import threading from typing import Any -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda JUNGLE = "JUNGLE" in os.environ diff --git a/panda/scripts/relay_test.py b/panda/scripts/relay_test.py index f8dd1b2..0ee111f 100755 --- a/panda/scripts/relay_test.py +++ b/panda/scripts/relay_test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import time -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda p = Panda() diff --git a/panda/scripts/spam_can.py b/panda/scripts/spam_can.py index 337859f..2025650 100755 --- a/panda/scripts/spam_can.py +++ b/panda/scripts/spam_can.py @@ -2,7 +2,7 @@ import os import random -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda def get_test_string(): diff --git a/panda/scripts/standalone_test.py b/panda/scripts/standalone_test.py index 528c21c..d73c538 100755 --- a/panda/scripts/standalone_test.py +++ b/panda/scripts/standalone_test.py @@ -2,7 +2,7 @@ import struct import time -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda if __name__ == "__main__": diff --git a/panda/scripts/test_canfd.py b/panda/scripts/test_canfd.py index ee61e8c..d208069 100755 --- a/panda/scripts/test_canfd.py +++ b/panda/scripts/test_canfd.py @@ -3,7 +3,7 @@ import os import time import random from collections import defaultdict -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda, calculate_checksum, DLC_TO_LEN from panda import PandaJungle from panda.tests.hitl.helpers import time_many_sends diff --git a/panda/tests/hitl/2_health.py b/panda/tests/hitl/2_health.py index 8fac3e9..eaa5212 100644 --- a/panda/tests/hitl/2_health.py +++ b/panda/tests/hitl/2_health.py @@ -1,7 +1,7 @@ import time -from opendbc.car.hyundai.values import HyundaiSafetyFlags -from opendbc.car.structs import CarParams +from iqdbc.car.hyundai.values import HyundaiSafetyFlags +from iqdbc.car.structs import CarParams from panda import Panda diff --git a/panda/tests/hitl/3_usb.py b/panda/tests/hitl/3_usb.py index f3ae43e..841718a 100644 --- a/panda/tests/hitl/3_usb.py +++ b/panda/tests/hitl/3_usb.py @@ -2,7 +2,7 @@ import time import pytest from flaky import flaky -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda from panda.tests.hitl.helpers import time_many_sends diff --git a/panda/tests/hitl/4_can_loopback.py b/panda/tests/hitl/4_can_loopback.py index 63fce9d..ed46966 100644 --- a/panda/tests/hitl/4_can_loopback.py +++ b/panda/tests/hitl/4_can_loopback.py @@ -6,7 +6,7 @@ import threading from flaky import flaky from collections import defaultdict -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda.tests.hitl.helpers import time_many_sends, get_random_can_messages, clear_can_buffers @flaky(max_runs=3, min_passes=1) diff --git a/panda/tests/hitl/6_safety.py b/panda/tests/hitl/6_safety.py index 0688456..ec697b1 100644 --- a/panda/tests/hitl/6_safety.py +++ b/panda/tests/hitl/6_safety.py @@ -1,6 +1,6 @@ import time -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams def test_safety_nooutput(p): diff --git a/panda/tests/hitl/9_harness.py b/panda/tests/hitl/9_harness.py index ddd3516..3981e3b 100644 --- a/panda/tests/hitl/9_harness.py +++ b/panda/tests/hitl/9_harness.py @@ -2,7 +2,7 @@ import time import pytest import itertools -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda # TODO: test relay diff --git a/panda/tests/libpanda/SConscript b/panda/tests/libpanda/SConscript index a5bdd7c..4f5d193 100644 --- a/panda/tests/libpanda/SConscript +++ b/panda/tests/libpanda/SConscript @@ -1,4 +1,4 @@ -import opendbc +import iqdbc import platform CC = 'gcc' @@ -21,7 +21,7 @@ env = Environment( '-Wfatal-errors', '-Wno-pointer-to-int-cast', ], - CPPPATH=[".", "../../", "../../board/", opendbc.INCLUDE_PATH], + CPPPATH=[".", "../../", "../../board/", iqdbc.INCLUDE_PATH], ) if system == "Darwin": env.PrependENVPath('PATH', '/opt/homebrew/bin') diff --git a/panda/tests/libpanda/panda.c b/panda/tests/libpanda/panda.c index 2d17d64..91968f3 100644 --- a/panda/tests/libpanda/panda.c +++ b/panda/tests/libpanda/panda.c @@ -15,7 +15,7 @@ void can_tx_comms_resume_spi(void) { }; #include "faults.h" #include "libc.h" #include "boards/board_declarations.h" -#include "opendbc/safety/safety.h" +#include "iqdbc/safety/safety.h" #include "main_definitions.h" #include "drivers/can_common.h" diff --git a/panda/tests/misra/test_misra.sh b/panda/tests/misra/test_misra.sh index d7b9c6e..447cd11 100755 --- a/panda/tests/misra/test_misra.sh +++ b/panda/tests/misra/test_misra.sh @@ -3,7 +3,7 @@ set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" PANDA_DIR=$(realpath $DIR/../../) -OPENDBC_ROOT=$(python3 -c "import opendbc; print(opendbc.INCLUDE_PATH)") +OPENDBC_ROOT=$(python3 -c "import iqdbc; print(iqdbc.INCLUDE_PATH)") GREEN="\e[1;32m" YELLOW="\e[1;33m" diff --git a/panda/tests/som/on-device.py b/panda/tests/som/on-device.py index aa432ef..fc21084 100755 --- a/panda/tests/som/on-device.py +++ b/panda/tests/som/on-device.py @@ -2,7 +2,7 @@ import os import time -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda diff --git a/panda/tests/som/test_bootkick.py b/panda/tests/som/test_bootkick.py index 497cfd8..1e10e23 100644 --- a/panda/tests/som/test_bootkick.py +++ b/panda/tests/som/test_bootkick.py @@ -1,7 +1,7 @@ import time import pytest -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda, PandaJungle PANDA_SERIAL = "300008001851333037333932" diff --git a/panda/tests/usbprotocol/test_comms.py b/panda/tests/usbprotocol/test_comms.py index 446a134..f17aa66 100755 --- a/panda/tests/usbprotocol/test_comms.py +++ b/panda/tests/usbprotocol/test_comms.py @@ -2,7 +2,7 @@ import random import unittest -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import DLC_TO_LEN, USBPACKET_MAX_SIZE, pack_can_buffer, unpack_can_buffer from panda.tests.libpanda import libpanda_py diff --git a/pyproject.toml b/pyproject.toml index aef98a9..4830835 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ dependencies = [ # body / webrtcd "aiohttp", "aiortc", + "libdatachannel-py>=2026.1.0.dev2", # aiortc does not put an upper bound on pyopenssl and is now incompatible # with the latest release "pyopenssl < 24.3.0", @@ -131,7 +132,7 @@ allow-direct-references = true [tool.pytest.ini_options] minversion = "6.0" -addopts = "--ignore=openpilot/ --ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=teleoprtc_repo/ --ignore=msgq/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup" +addopts = "--ignore=openpilot/ --ignore=iqdbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=teleoprtc_repo/ --ignore=msgq/ -Werror --strict-config --strict-markers --durations=10 -n auto --dist=loadgroup" cpp_files = "test_*" cpp_harness = "selfdrive/test/cpp_harness.py" python_files = "test_*.py" @@ -156,7 +157,7 @@ quiet-level = 3 # if you've got a short variable name that's getting flagged, add it here ignore-words-list = "bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie,preints,whit,indexIn,ws,uint,grey,deque,stdio,amin,BA,LITE,atEnd,UIs,errorString,arange,FocusIn,od,tim,relA,hist,copyable,jupyter,thead,TGE,abl,lite" builtin = "clear,rare,informal,code,names,en-GB_to_en-US" -skip = "./third_party/*, ./tinygrad/*, ./tinygrad_repo/*, ./msgq/*, ./panda/*, ./opendbc/*, ./opendbc_repo/*, ./rednose/*, ./rednose_repo/*, ./teleoprtc/*, ./teleoprtc_repo/*, *.po, uv.lock, *.onnx, ./cereal/gen/*, */c_generated_code/*, docs/assets/*, tools/plotjuggler/layouts/*, selfdrive/assets/offroad/mici_fcc.html" +skip = "./third_party/*, ./tinygrad/*, ./tinygrad_repo/*, ./msgq/*, ./panda/*, ./iqdbc/*, ./iqdbc_repo/*, ./rednose/*, ./rednose_repo/*, ./teleoprtc/*, ./teleoprtc_repo/*, *.po, uv.lock, *.onnx, ./cereal/gen/*, */c_generated_code/*, docs/assets/*, tools/plotjuggler/layouts/*, selfdrive/assets/offroad/mici_fcc.html" # https://docs.astral.sh/ruff/configuration/#using-pyprojecttoml [tool.ruff] @@ -186,8 +187,8 @@ exclude = [ "body", "cereal", "panda", - "opendbc", - "opendbc_repo", + "iqdbc", + "iqdbc_repo", "rednose_repo", "tinygrad_repo", "teleoprtc", @@ -222,8 +223,8 @@ exclude = [ "cereal/", "msgq/", "msgq_repo/", - "opendbc/", - "opendbc_repo/", + "iqdbc/", + "iqdbc_repo/", "panda/", "rednose/", "rednose_repo/", diff --git a/selfdrive/car/car_specific.py b/selfdrive/car/car_specific.py index 56c9c1c..6a272c1 100644 --- a/selfdrive/car/car_specific.py +++ b/selfdrive/car/car_specific.py @@ -1,8 +1,8 @@ from cereal import car, log -from opendbc.car import DT_CTRL, structs -from opendbc.car.car_helpers import interfaces -from opendbc.car.interfaces import MAX_CTRL_SPEED -from opendbc.car.toyota.values import ToyotaFlags +from iqdbc.car import DT_CTRL, structs +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.interfaces import MAX_CTRL_SPEED +from iqdbc.car.toyota.values import ToyotaFlags from openpilot.selfdrive.selfdrived.events import Events diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index e809492..a0b6d47 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -15,12 +15,12 @@ from openpilot.common.params import Params, UnknownKeyName from openpilot.common.realtime import config_realtime_process, lock_memory, Priority, Ratekeeper from openpilot.common.swaglog import cloudlog, ForwardingHandler -from opendbc.car import DT_CTRL, structs -from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable -from opendbc.car.carlog import carlog -from opendbc.car.fw_versions import ObdCallback -from opendbc.car.car_helpers import get_car, interfaces -from opendbc.car.interfaces import CarInterfaceBase, RadarInterfaceBase +from iqdbc.car import DT_CTRL, structs +from iqdbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable +from iqdbc.car.carlog import carlog +from iqdbc.car.fw_versions import ObdCallback +from iqdbc.car.car_helpers import get_car, interfaces +from iqdbc.car.interfaces import CarInterfaceBase, RadarInterfaceBase from openpilot.selfdrive.pandad import can_capnp_to_list, can_list_to_can_capnp from openpilot.selfdrive.car.cruise import VCruiseHelper from openpilot.selfdrive.car.helpers import convert_iq_car_control_compact, convert_to_capnp diff --git a/selfdrive/car/cruise.py b/selfdrive/car/cruise.py index 8b28e21..e425c1c 100644 --- a/selfdrive/car/cruise.py +++ b/selfdrive/car/cruise.py @@ -4,7 +4,7 @@ import numpy as np from cereal import car from openpilot.common.constants import CV from cereal import car, custom -from opendbc.car import structs +from iqdbc.car import structs from openpilot.common.params import Params from openpilot.iqpilot.selfdrive.car.long_increments import LongIncrementConfig, read_long_increment_config, resolve_button_step diff --git a/selfdrive/car/docs.py b/selfdrive/car/docs.py index f807fc3..aa2a261 100755 --- a/selfdrive/car/docs.py +++ b/selfdrive/car/docs.py @@ -3,7 +3,7 @@ import argparse import os from openpilot.common.basedir import BASEDIR -from opendbc.car.docs import get_all_car_docs, generate_cars_md +from iqdbc.car.docs import get_all_car_docs, generate_cars_md CARS_MD_OUT = os.path.join(BASEDIR, "docs", "CARS.md") CARS_MD_TEMPLATE = os.path.join(BASEDIR, "selfdrive", "car", "CARS_template.md") diff --git a/selfdrive/car/helpers.py b/selfdrive/car/helpers.py index af0f334..9c023e0 100644 --- a/selfdrive/car/helpers.py +++ b/selfdrive/car/helpers.py @@ -2,7 +2,7 @@ import capnp from typing import Any from cereal import custom -from opendbc.car import structs +from iqdbc.car import structs _FIELDS = '__dataclass_fields__' # copy of dataclasses._FIELDS diff --git a/selfdrive/car/tests/test_car_interfaces.py b/selfdrive/car/tests/test_car_interfaces.py index e643e06..286cdbb 100644 --- a/selfdrive/car/tests/test_car_interfaces.py +++ b/selfdrive/car/tests/test_car_interfaces.py @@ -5,11 +5,11 @@ from parameterized import parameterized from types import SimpleNamespace from cereal import car, custom -from opendbc.car import DT_CTRL -from opendbc.car.structs import CarParams -from opendbc.car.tests.test_car_interfaces import get_fuzzy_car_interface -from opendbc.car.mock.values import CAR as MOCK -from opendbc.car.values import PLATFORMS +from iqdbc.car import DT_CTRL +from iqdbc.car.structs import CarParams +from iqdbc.car.tests.test_car_interfaces import get_fuzzy_car_interface +from iqdbc.car.mock.values import CAR as MOCK +from iqdbc.car.values import PLATFORMS from openpilot.selfdrive.car.card import run_optional_pre_init from openpilot.selfdrive.car.helpers import convert_iq_car_control, convert_iq_car_control_compact from openpilot.selfdrive.controls.lib.latcontrol_angle import LatControlAngle diff --git a/selfdrive/car/tests/test_car_specific_events.py b/selfdrive/car/tests/test_car_specific_events.py index 7cc9cf3..d87bde1 100644 --- a/selfdrive/car/tests/test_car_specific_events.py +++ b/selfdrive/car/tests/test_car_specific_events.py @@ -1,7 +1,7 @@ from types import SimpleNamespace from cereal import log -from opendbc.car import structs +from iqdbc.car import structs from openpilot.selfdrive.car.car_specific import CarSpecificEvents diff --git a/selfdrive/car/tests/test_docs.py b/selfdrive/car/tests/test_docs.py index 6e13d55..e7f3b71 100644 --- a/selfdrive/car/tests/test_docs.py +++ b/selfdrive/car/tests/test_docs.py @@ -1,7 +1,7 @@ import os from openpilot.common.basedir import BASEDIR -from opendbc.car.docs import generate_cars_md, get_all_car_docs +from iqdbc.car.docs import generate_cars_md, get_all_car_docs from openpilot.selfdrive.debug.dump_car_docs import dump_car_docs from openpilot.selfdrive.debug.print_docs_diff import print_car_docs_diff from openpilot.selfdrive.car.docs import CARS_MD_TEMPLATE diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 21c626d..08e6657 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -9,15 +9,15 @@ import hypothesis.strategies as st from hypothesis import Phase, given, settings from parameterized import parameterized_class -from opendbc.car import DT_CTRL, gen_empty_fingerprint, structs -from opendbc.car.can_definitions import CanData -from opendbc.car.car_helpers import FRAME_FINGERPRINT, interfaces -from opendbc.car.fingerprints import MIGRATION -from opendbc.car.honda.values import CAR as HONDA, HondaFlags -from opendbc.car.structs import car -from opendbc.car.tests.routes import non_tested_cars, routes, CarTestRoute -from opendbc.car.values import Platform, PLATFORMS -from opendbc.safety.tests.libsafety import libsafety_py +from iqdbc.car import DT_CTRL, gen_empty_fingerprint, structs +from iqdbc.car.can_definitions import CanData +from iqdbc.car.car_helpers import FRAME_FINGERPRINT, interfaces +from iqdbc.car.fingerprints import MIGRATION +from iqdbc.car.honda.values import CAR as HONDA, HondaFlags +from iqdbc.car.structs import car +from iqdbc.car.tests.routes import non_tested_cars, routes, CarTestRoute +from iqdbc.car.values import Platform, PLATFORMS +from iqdbc.safety.tests.libsafety import libsafety_py from openpilot.common.basedir import BASEDIR from openpilot.selfdrive.pandad import can_capnp_to_list from openpilot.selfdrive.test.helpers import read_segment_list diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 9435a4e..1bd7b31 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -11,8 +11,8 @@ from openpilot.common.params import Params from openpilot.common.realtime import config_realtime_process, lock_memory, DT_CTRL, Priority, Ratekeeper from openpilot.common.swaglog import cloudlog -from opendbc.car.car_helpers import interfaces -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.vehicle_model import VehicleModel from openpilot.selfdrive.controls.lib.drive_helpers import clip_curvature from openpilot.selfdrive.controls.lib.latcontrol import LatControl from openpilot.selfdrive.controls.lib.latcontrol_pid import LatControlPID @@ -99,7 +99,7 @@ class Controls(IQControlsLayer): try: if self.CP.brand != 'volkswagen': return False - from opendbc.car.volkswagen.values import VolkswagenFlags + from iqdbc.car.volkswagen.values import VolkswagenFlags return bool(self.CP.flags & VolkswagenFlags.PQ) except Exception: cloudlog.exception("pq torque selection failed; using generic torque") diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index 4e52d2b..c57a907 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -12,6 +12,11 @@ MAX_VEL_ERR = 5.0 # m/s MAX_LATERAL_JERK = 5.0 # m/s^3 MAX_LATERAL_ACCEL_NO_ROLL = 3.0 # m/s^2 MAX_LATERAL_ACCEL_NO_ROLL_OVERRIDE = 5.0 # m/s^2 +DEFAULT_STOPPING_SPEED = 0.25 # m/s + + +def should_stop(v_ego: float, a_target: float, stopping_speed: float = DEFAULT_STOPPING_SPEED) -> bool: + return bool(v_ego < stopping_speed and a_target < 0.1) def clamp(val, min_val, max_val): @@ -52,7 +57,7 @@ def clip_curvature(v_ego, prev_curvature, new_curvature, roll, override=False) - return float(new_curvature), limited_accel or limited_max_curv -def get_accel_from_plan(speeds, accels, t_idxs, action_t=DT_MDL, vEgoStopping=0.3): +def get_accel_from_plan(speeds, accels, t_idxs, action_t=DT_MDL, stopping_speed=DEFAULT_STOPPING_SPEED): if len(speeds) == len(t_idxs): v_now = speeds[0] a_now = accels[0] @@ -62,8 +67,7 @@ def get_accel_from_plan(speeds, accels, t_idxs, action_t=DT_MDL, vEgoStopping=0. v_now = 0.0 v_target = 0.0 a_target = 0.0 - should_stop = (v_now < vEgoStopping and a_target < 0.1) - return a_target, should_stop + return a_target, should_stop(v_now, a_target, stopping_speed) def curv_from_psis(psi_target, psi_rate, vego, action_t): vego = np.clip(vego, MIN_SPEED, np.inf) diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index 65fb5ce..b676e11 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -8,10 +8,10 @@ from difflib import SequenceMatcher import numpy as np from cereal import log, custom # noqa: F401 (custom kept available for downstream imports) -from opendbc.car import structs -from opendbc.car.lateral import FRICTION_THRESHOLD, get_friction -from opendbc.iqpilot.car.interfaces import LatControlInputs -from opendbc.iqpilot.car.lateral_ext import get_friction as get_friction_in_torque_space +from iqdbc.car import structs +from iqdbc.car.lateral import FRICTION_THRESHOLD, get_friction +from iqdbc.iqpilot.car.interfaces import LatControlInputs +from iqdbc.iqpilot.car.lateral_ext import get_friction as get_friction_in_torque_space from openpilot.common.basedir import BASEDIR from openpilot.common.constants import ACCELERATION_DUE_TO_GRAVITY from openpilot.common.filter_simple import FirstOrderFilter @@ -27,7 +27,7 @@ from openpilot.iqpilot.selfdrive.controls.lib.helpers.nav_torque_pulse import Na # ===== locator ===== TORQUE_NN_MODEL_PATH = os.path.join(BASEDIR, "iqpilot", "iqpilot_iq_nnff_models", "neural_network_lateral_control") -TORQUE_NN_MODEL_SUBSTITUTE_PATH = os.path.join(BASEDIR, "opendbc", "car", "torque_data", "substitute.toml") +TORQUE_NN_MODEL_SUBSTITUTE_PATH = os.path.join(BASEDIR, "iqdbc", "car", "torque_data", "substitute.toml") MOCK_MODEL_PATH = os.path.join(TORQUE_NN_MODEL_PATH, "MOCK.json") # A candidate must reach this score for the fingerprint(+fw) match to count as exact. diff --git a/selfdrive/controls/lib/latcontrol_torque_pq.py b/selfdrive/controls/lib/latcontrol_torque_pq.py index ee8e2a1..cfa4d42 100644 --- a/selfdrive/controls/lib/latcontrol_torque_pq.py +++ b/selfdrive/controls/lib/latcontrol_torque_pq.py @@ -3,7 +3,7 @@ import numpy as np from collections import deque from cereal import log -from opendbc.car.lateral import get_friction +from iqdbc.car.lateral import get_friction from openpilot.common.constants import ACCELERATION_DUE_TO_GRAVITY from openpilot.common.filter_simple import FirstOrderFilter from openpilot.selfdrive.controls.lib.latcontrol import LatControl diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 7bc6fa5..c304425 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -11,16 +11,13 @@ CONTROL_N_T_IDX = ModelConstants.T_IDXS[:CONTROL_N] LongCtrlState = car.CarControl.Actuators.LongControlState -def long_control_state_trans(CP, CP_IQ, active, long_control_state, v_ego, - should_stop, brake_pressed, cruise_standstill): +def long_control_state_trans(CP_IQ, active, long_control_state, should_stop, brake_pressed, cruise_standstill): # Gas Interceptor cruise_standstill = cruise_standstill and not CP_IQ.enableGasInterceptor - stopping_condition = should_stop starting_condition = (not should_stop and not cruise_standstill and not brake_pressed) - started_condition = v_ego > CP.vEgoStarting if not active: long_control_state = LongCtrlState.off @@ -30,22 +27,15 @@ def long_control_state_trans(CP, CP_IQ, active, long_control_state, v_ego, if not starting_condition: long_control_state = LongCtrlState.stopping else: - if starting_condition and CP.startingState: - long_control_state = LongCtrlState.starting - else: - long_control_state = LongCtrlState.pid + long_control_state = LongCtrlState.pid elif long_control_state == LongCtrlState.stopping: - if starting_condition and CP.startingState: - long_control_state = LongCtrlState.starting - elif starting_condition: + if starting_condition: long_control_state = LongCtrlState.pid - elif long_control_state in [LongCtrlState.starting, LongCtrlState.pid]: - if stopping_condition: + elif long_control_state == LongCtrlState.pid: + if should_stop: long_control_state = LongCtrlState.stopping - elif started_condition: - long_control_state = LongCtrlState.pid return long_control_state class LongControl: @@ -73,8 +63,7 @@ class LongControl: else: stop_now = should_stop - self.long_control_state = long_control_state_trans(self.CP, self.CP_IQ, active, self.long_control_state, CS.vEgo, - stop_now, CS.brakePressed, + self.long_control_state = long_control_state_trans(self.CP_IQ, active, self.long_control_state, stop_now, CS.brakePressed, CS.cruiseState.standstill) if self.long_control_state == LongCtrlState.off: self.reset() @@ -85,12 +74,8 @@ class LongControl: output_accel = self.last_output_accel if output_accel > self.CP.stopAccel: output_accel = min(output_accel, 0.0) - output_accel -= self.CP.stoppingDecelRate * DT_CTRL - self.reset() - self.smooth.reset() - - elif self.long_control_state == LongCtrlState.starting: - output_accel = self.CP.startAccel + # TODO: can we just go straight to stopAccel? + output_accel -= 1.0 * DT_CTRL # m/s^2/s while trying to stop self.reset() self.smooth.reset() diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index 4d5d2b4..b0467ea 100755 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -3,7 +3,7 @@ import os import time import numpy as np from cereal import log -from opendbc.car.interfaces import ACCEL_MIN, ACCEL_MAX +from iqdbc.car.interfaces import ACCEL_MIN, ACCEL_MAX from openpilot.common.realtime import DT_MDL from openpilot.common.swaglog import cloudlog # WARNING: imports outside of constants will not trigger a rebuild diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 152c547..298ae0d 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -3,7 +3,7 @@ import math import numpy as np import cereal.messaging as messaging -from opendbc.car.interfaces import ACCEL_MIN, ACCEL_MAX +from iqdbc.car.interfaces import ACCEL_MIN, ACCEL_MAX from openpilot.common.constants import CV from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.realtime import DT_MDL @@ -11,7 +11,7 @@ from openpilot.selfdrive.modeld.constants import ModelConstants from openpilot.selfdrive.controls.lib.longcontrol import LongCtrlState from openpilot.selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import LongitudinalMpc, LongitudinalPlanSource from openpilot.selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import T_IDXS as T_IDXS_MPC -from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N, get_accel_from_plan +from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N, DEFAULT_STOPPING_SPEED, get_accel_from_plan from openpilot.selfdrive.car.cruise import V_CRUISE_MAX, V_CRUISE_UNSET from openpilot.common.swaglog import cloudlog from openpilot.common.issue_debug import log_issue_limited @@ -72,6 +72,7 @@ def get_cruise_accel(e2e, v_cruise, v_ego, a_cruise_prev, angle_steers, CP, dt, class LongitudinalPlanner(LongitudinalPlannerIQ): def __init__(self, CP, CP_IQ, init_v=0.0, init_a=0.0, dt=DT_MDL): self.CP = CP + self.stopping_speed = CP_IQ.longitudinalStoppingSpeedOverride or DEFAULT_STOPPING_SPEED self.mpc = LongitudinalMpc(dt=dt) LongitudinalPlannerIQ.__init__(self, self.CP, CP_IQ, self.mpc) self.fcw = False @@ -167,7 +168,7 @@ class LongitudinalPlanner(LongitudinalPlannerIQ): action_t = self.CP.longitudinalActuatorDelay + DT_MDL output_a_target_mpc, output_should_stop_mpc = get_accel_from_plan(self.v_desired_trajectory, self.a_desired_trajectory, CONTROL_N_T_IDX, - action_t=action_t, vEgoStopping=self.CP.vEgoStopping) + action_t=action_t, stopping_speed=self.stopping_speed) output_a_target_e2e = sm['modelV2'].action.desiredAcceleration output_should_stop_e2e = sm['modelV2'].action.shouldStop @@ -183,7 +184,7 @@ class LongitudinalPlanner(LongitudinalPlannerIQ): t_shifted = T_IDXS_MPC + t_cut v_shifted = np.interp(t_shifted, T_IDXS_MPC, model_v) a_shifted = np.interp(t_shifted, T_IDXS_MPC, model_a) - a_launch = get_accel_from_plan(v_shifted, a_shifted, T_IDXS_MPC, action_t=action_t, vEgoStopping=self.CP.vEgoStopping)[0] + a_launch = get_accel_from_plan(v_shifted, a_shifted, T_IDXS_MPC, action_t=action_t)[0] a_launch_max = np.interp(v_ego, [LAUNCH_MOVING_SPEED, LAUNCH_DISARM_SPEED], [LAUNCH_MAX_ACCEL, 0.]) output_a_target_e2e = max(output_a_target_e2e, min(a_launch, a_launch_max)) diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index 2b988c6..48d2b69 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -12,9 +12,9 @@ from openpilot.common.realtime import DT_MDL, Priority, config_realtime_process from openpilot.common.swaglog import cloudlog from openpilot.common.simple_kalman import KF1D -from opendbc.car import structs -from opendbc.car.hyundai.values import HyundaiFlags -from opendbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ +from iqdbc.car import structs +from iqdbc.car.hyundai.values import HyundaiFlags +from iqdbc.iqpilot.car.hyundai.values import HyundaiFlagsIQ from openpilot.iqpilot.selfdrive.controls.lib.custom_stop_distance import CustomStopDistance diff --git a/selfdrive/controls/tests/test_drive_helpers.py b/selfdrive/controls/tests/test_drive_helpers.py new file mode 100644 index 0000000..66a6a6f --- /dev/null +++ b/selfdrive/controls/tests/test_drive_helpers.py @@ -0,0 +1,20 @@ +import pytest + +from openpilot.selfdrive.controls.lib.drive_helpers import DEFAULT_STOPPING_SPEED, should_stop + + +class TestShouldStop: + @pytest.mark.parametrize("v_ego, expected", [ + (DEFAULT_STOPPING_SPEED - 0.01, True), + (DEFAULT_STOPPING_SPEED, False), + ]) + def test_upstream_default(self, v_ego, expected): + assert should_stop(v_ego, -0.1) == expected + + @pytest.mark.parametrize("stopping_speed", [0.55 / 3.6, 1.5 / 3.6]) + def test_car_override(self, stopping_speed): + assert should_stop(stopping_speed - 0.01, -0.1, stopping_speed) + assert not should_stop(stopping_speed, -0.1, stopping_speed) + + def test_requires_deceleration(self): + assert not should_stop(0.0, 0.1, 1.0) diff --git a/selfdrive/controls/tests/test_latcontrol.py b/selfdrive/controls/tests/test_latcontrol.py index 272f4e0..5d54397 100644 --- a/selfdrive/controls/tests/test_latcontrol.py +++ b/selfdrive/controls/tests/test_latcontrol.py @@ -1,12 +1,12 @@ from parameterized import parameterized from cereal import car, log -from opendbc.car.car_helpers import interfaces -from opendbc.car.honda.values import CAR as HONDA -from opendbc.car.toyota.values import CAR as TOYOTA -from opendbc.car.nissan.values import CAR as NISSAN -from opendbc.car.gm.values import CAR as GM -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.honda.values import CAR as HONDA +from iqdbc.car.toyota.values import CAR as TOYOTA +from iqdbc.car.nissan.values import CAR as NISSAN +from iqdbc.car.gm.values import CAR as GM +from iqdbc.car.vehicle_model import VehicleModel from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.car.helpers import convert_to_capnp from openpilot.selfdrive.controls.lib.latcontrol_pid import LatControlPID diff --git a/selfdrive/controls/tests/test_latcontrol_torque_buffer.py b/selfdrive/controls/tests/test_latcontrol_torque_buffer.py index bac8f8a..798d49b 100644 --- a/selfdrive/controls/tests/test_latcontrol_torque_buffer.py +++ b/selfdrive/controls/tests/test_latcontrol_torque_buffer.py @@ -1,9 +1,9 @@ from parameterized import parameterized from cereal import car, log -from opendbc.car.car_helpers import interfaces -from opendbc.car.toyota.values import CAR as TOYOTA -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.car.car_helpers import interfaces +from iqdbc.car.toyota.values import CAR as TOYOTA +from iqdbc.car.vehicle_model import VehicleModel from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.controls.lib.latcontrol_torque import LatControlTorque, LAT_ACCEL_REQUEST_BUFFER_SECONDS diff --git a/selfdrive/controls/tests/test_leads.py b/selfdrive/controls/tests/test_leads.py index 77384fe..5367f1e 100644 --- a/selfdrive/controls/tests/test_leads.py +++ b/selfdrive/controls/tests/test_leads.py @@ -1,6 +1,6 @@ import cereal.messaging as messaging -from opendbc.car.toyota.values import CAR as TOYOTA +from iqdbc.car.toyota.values import CAR as TOYOTA from openpilot.selfdrive.test.process_replay import replay_process_with_name diff --git a/selfdrive/controls/tests/test_longcontrol.py b/selfdrive/controls/tests/test_longcontrol.py index 45fd4d5..8ccd62a 100644 --- a/selfdrive/controls/tests/test_longcontrol.py +++ b/selfdrive/controls/tests/test_longcontrol.py @@ -1,59 +1,43 @@ -from cereal import car, custom +from cereal import custom from openpilot.selfdrive.controls.lib.longcontrol import LongCtrlState, long_control_state_trans - - class TestLongControlStateTransition: def test_stay_stopped(self): - CP = car.CarParams.new_message() CP_IQ = custom.IQCarParams.new_message() active = True current_state = LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=True, brake_pressed=False, cruise_standstill=False) assert next_state == LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=True, cruise_standstill=False) assert next_state == LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=False, cruise_standstill=True) assert next_state == LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=1.0, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=False, cruise_standstill=False) assert next_state == LongCtrlState.pid active = False - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=1.0, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=False, cruise_standstill=False) assert next_state == LongCtrlState.off def test_engage(): - CP = car.CarParams.new_message() CP_IQ = custom.IQCarParams.new_message() active = True current_state = LongCtrlState.off - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=True, brake_pressed=False, cruise_standstill=False) assert next_state == LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=True, cruise_standstill=False) assert next_state == LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=False, cruise_standstill=True) assert next_state == LongCtrlState.stopping - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, - should_stop=False, brake_pressed=False, cruise_standstill=False) - assert next_state == LongCtrlState.pid - -def test_starting(): - CP = car.CarParams.new_message(startingState=True, vEgoStarting=0.5) - CP_IQ = custom.IQCarParams.new_message() - active = True - current_state = LongCtrlState.starting - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=0.1, - should_stop=False, brake_pressed=False, cruise_standstill=False) - assert next_state == LongCtrlState.starting - next_state = long_control_state_trans(CP, CP_IQ, active, current_state, v_ego=1.0, + next_state = long_control_state_trans(CP_IQ, active, current_state, should_stop=False, brake_pressed=False, cruise_standstill=False) assert next_state == LongCtrlState.pid diff --git a/selfdrive/controls/tests/test_torqued_lat_accel_offset.py b/selfdrive/controls/tests/test_torqued_lat_accel_offset.py index 8438985..477ecd0 100644 --- a/selfdrive/controls/tests/test_torqued_lat_accel_offset.py +++ b/selfdrive/controls/tests/test_torqued_lat_accel_offset.py @@ -1,8 +1,8 @@ import numpy as np from cereal import car, messaging -from opendbc.car import ACCELERATION_DUE_TO_GRAVITY -from opendbc.car import structs -from opendbc.car.lateral import get_friction, FRICTION_THRESHOLD +from iqdbc.car import ACCELERATION_DUE_TO_GRAVITY +from iqdbc.car import structs +from iqdbc.car.lateral import get_friction, FRICTION_THRESHOLD from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.locationd.torqued import TorqueEstimator, MIN_BUCKET_POINTS, POINTS_PER_BUCKET, STEER_BUCKET_BOUNDS diff --git a/selfdrive/debug/car/clear_dtc.py b/selfdrive/debug/car/clear_dtc.py index b2c5fe3..c5060b3 100755 --- a/selfdrive/debug/car/clear_dtc.py +++ b/selfdrive/debug/car/clear_dtc.py @@ -2,9 +2,9 @@ import sys import argparse from subprocess import check_output, CalledProcessError -from opendbc.car.carlog import carlog -from opendbc.car.uds import UdsClient, MessageTimeoutError, SESSION_TYPE, DTC_GROUP_TYPE -from opendbc.car.structs import CarParams +from iqdbc.car.carlog import carlog +from iqdbc.car.uds import UdsClient, MessageTimeoutError, SESSION_TYPE, DTC_GROUP_TYPE +from iqdbc.car.structs import CarParams from panda import Panda parser = argparse.ArgumentParser(description="clear DTC status") diff --git a/selfdrive/debug/car/disable_ecu.py b/selfdrive/debug/car/disable_ecu.py index 14d0cbb..6efd201 100755 --- a/selfdrive/debug/car/disable_ecu.py +++ b/selfdrive/debug/car/disable_ecu.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import time import cereal.messaging as messaging -from opendbc.car.disable_ecu import disable_ecu +from iqdbc.car.disable_ecu import disable_ecu from openpilot.selfdrive.car.card import can_comm_callbacks if __name__ == "__main__": diff --git a/selfdrive/debug/car/ecu_addrs.py b/selfdrive/debug/car/ecu_addrs.py index 584c930..62f3c2a 100755 --- a/selfdrive/debug/car/ecu_addrs.py +++ b/selfdrive/debug/car/ecu_addrs.py @@ -2,8 +2,8 @@ import argparse import time import cereal.messaging as messaging -from opendbc.car.carlog import carlog -from opendbc.car.ecu_addrs import get_all_ecu_addrs +from iqdbc.car.carlog import carlog +from iqdbc.car.ecu_addrs import get_all_ecu_addrs from openpilot.common.params import Params from openpilot.selfdrive.car.card import can_comm_callbacks, obd_callback diff --git a/selfdrive/debug/car/fw_versions.py b/selfdrive/debug/car/fw_versions.py index 6ae10d2..21c7df8 100755 --- a/selfdrive/debug/car/fw_versions.py +++ b/selfdrive/debug/car/fw_versions.py @@ -3,9 +3,9 @@ import time import argparse import cereal.messaging as messaging from cereal import car -from opendbc.car.carlog import carlog -from opendbc.car.fw_versions import get_fw_versions, match_fw_to_car -from opendbc.car.vin import get_vin +from iqdbc.car.carlog import carlog +from iqdbc.car.fw_versions import get_fw_versions, match_fw_to_car +from iqdbc.car.vin import get_vin from openpilot.common.params import Params from openpilot.selfdrive.car.card import can_comm_callbacks, obd_callback from typing import Any diff --git a/selfdrive/debug/car/hyundai_enable_radar_points.py b/selfdrive/debug/car/hyundai_enable_radar_points.py index 1cab7b0..84038fa 100755 --- a/selfdrive/debug/car/hyundai_enable_radar_points.py +++ b/selfdrive/debug/car/hyundai_enable_radar_points.py @@ -16,9 +16,9 @@ import argparse from typing import NamedTuple from subprocess import check_output, CalledProcessError -from opendbc.car.carlog import carlog -from opendbc.car.uds import UdsClient, SESSION_TYPE, DATA_IDENTIFIER_TYPE -from opendbc.car.structs import CarParams +from iqdbc.car.carlog import carlog +from iqdbc.car.uds import UdsClient, SESSION_TYPE, DATA_IDENTIFIER_TYPE +from iqdbc.car.structs import CarParams from panda.python import Panda class ConfigValues(NamedTuple): diff --git a/selfdrive/debug/car/toyota_eps_factor.py b/selfdrive/debug/car/toyota_eps_factor.py index f35a86e..57a9cf4 100755 --- a/selfdrive/debug/car/toyota_eps_factor.py +++ b/selfdrive/debug/car/toyota_eps_factor.py @@ -3,7 +3,7 @@ import sys import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model -from opendbc.car.toyota.values import STEER_THRESHOLD +from iqdbc.car.toyota.values import STEER_THRESHOLD from openpilot.tools.lib.logreader import LogReader diff --git a/selfdrive/debug/car/vin.py b/selfdrive/debug/car/vin.py index 9b1d652..12e3577 100755 --- a/selfdrive/debug/car/vin.py +++ b/selfdrive/debug/car/vin.py @@ -2,8 +2,8 @@ import argparse import time import cereal.messaging as messaging -from opendbc.car.carlog import carlog -from opendbc.car.vin import get_vin +from iqdbc.car.carlog import carlog +from iqdbc.car.vin import get_vin from openpilot.selfdrive.car.card import can_comm_callbacks if __name__ == "__main__": diff --git a/selfdrive/debug/car/vw_mqb_config.py b/selfdrive/debug/car/vw_mqb_config.py index 13ee778..a540eaa 100755 --- a/selfdrive/debug/car/vw_mqb_config.py +++ b/selfdrive/debug/car/vw_mqb_config.py @@ -3,10 +3,10 @@ import argparse import struct from enum import IntEnum -from opendbc.car.carlog import carlog -from opendbc.car.uds import UdsClient, MessageTimeoutError, NegativeResponseError, SESSION_TYPE,\ +from iqdbc.car.carlog import carlog +from iqdbc.car.uds import UdsClient, MessageTimeoutError, NegativeResponseError, SESSION_TYPE,\ DATA_IDENTIFIER_TYPE, ACCESS_TYPE -from opendbc.car.structs import CarParams +from iqdbc.car.structs import CarParams from panda import Panda from datetime import date diff --git a/selfdrive/debug/check_can_parser_performance.py b/selfdrive/debug/check_can_parser_performance.py index 20987b3..930f814 100755 --- a/selfdrive/debug/check_can_parser_performance.py +++ b/selfdrive/debug/check_can_parser_performance.py @@ -4,7 +4,7 @@ import time from tqdm import tqdm from cereal import car -from opendbc.car.tests.routes import CarTestRoute +from iqdbc.car.tests.routes import CarTestRoute from openpilot.selfdrive.car.tests.test_models import TestCarModelBase from openpilot.tools.plotjuggler.juggle import DEMO_ROUTE diff --git a/selfdrive/debug/cycle_alerts.py b/selfdrive/debug/cycle_alerts.py index 00fa33a..5b25d8c 100755 --- a/selfdrive/debug/cycle_alerts.py +++ b/selfdrive/debug/cycle_alerts.py @@ -4,7 +4,7 @@ import random from cereal import car, log import cereal.messaging as messaging -from opendbc.car.honda.interface import CarInterface +from iqdbc.car.honda.interface import CarInterface from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.selfdrived.events import ET, Events from openpilot.selfdrive.selfdrived.alertmanager import AlertManager diff --git a/selfdrive/debug/debug_fw_fingerprinting_offline.py b/selfdrive/debug/debug_fw_fingerprinting_offline.py index d841e91..dc53431 100755 --- a/selfdrive/debug/debug_fw_fingerprinting_offline.py +++ b/selfdrive/debug/debug_fw_fingerprinting_offline.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import argparse -from opendbc.car import uds +from iqdbc.car import uds from openpilot.tools.lib.live_logreader import live_logreader from openpilot.tools.lib.logreader import LogReader, ReadMode diff --git a/selfdrive/debug/dump_car_docs.py b/selfdrive/debug/dump_car_docs.py index f0e99cd..5f81870 100755 --- a/selfdrive/debug/dump_car_docs.py +++ b/selfdrive/debug/dump_car_docs.py @@ -2,7 +2,7 @@ import argparse import pickle -from opendbc.car.docs import get_all_car_docs +from iqdbc.car.docs import get_all_car_docs def dump_car_docs(path): diff --git a/selfdrive/debug/fuzz_fw_fingerprint.py b/selfdrive/debug/fuzz_fw_fingerprint.py index b4276c0..5122c5d 100755 --- a/selfdrive/debug/fuzz_fw_fingerprint.py +++ b/selfdrive/debug/fuzz_fw_fingerprint.py @@ -4,11 +4,11 @@ from collections import defaultdict from tqdm import tqdm -from opendbc.car.fw_versions import match_fw_to_car_fuzzy -from opendbc.car.toyota.values import FW_VERSIONS as TOYOTA_FW_VERSIONS -from opendbc.car.honda.values import FW_VERSIONS as HONDA_FW_VERSIONS -from opendbc.car.hyundai.values import FW_VERSIONS as HYUNDAI_FW_VERSIONS -from opendbc.car.volkswagen.values import FW_VERSIONS as VW_FW_VERSIONS +from iqdbc.car.fw_versions import match_fw_to_car_fuzzy +from iqdbc.car.toyota.values import FW_VERSIONS as TOYOTA_FW_VERSIONS +from iqdbc.car.honda.values import FW_VERSIONS as HONDA_FW_VERSIONS +from iqdbc.car.hyundai.values import FW_VERSIONS as HYUNDAI_FW_VERSIONS +from iqdbc.car.volkswagen.values import FW_VERSIONS as VW_FW_VERSIONS FWS = {} diff --git a/selfdrive/debug/print_docs_diff.py b/selfdrive/debug/print_docs_diff.py index 388acf3..9e1d204 100755 --- a/selfdrive/debug/print_docs_diff.py +++ b/selfdrive/debug/print_docs_diff.py @@ -4,8 +4,8 @@ from collections import defaultdict import difflib import pickle -from opendbc.car.docs import get_all_car_docs -from opendbc.car.docs_definitions import Column +from iqdbc.car.docs import get_all_car_docs +from iqdbc.car.docs_definitions import Column FOOTNOTE_TAG = "{}" STAR_ICON = ' bool: - from opendbc.car.volkswagen.values import VolkswagenFlags + from iqdbc.car.volkswagen.values import VolkswagenFlags return bool(self._vw_flags() & VolkswagenFlags.PQ) def _is_vw_mqb(self) -> bool: - from opendbc.car.volkswagen.values import VolkswagenFlags + from iqdbc.car.volkswagen.values import VolkswagenFlags flags = self._vw_flags() return not bool(flags & (VolkswagenFlags.PQ | VolkswagenFlags.MLB | VolkswagenFlags.MEB | VolkswagenFlags.MEB_GEN2 | VolkswagenFlags.MQB_EVO)) def _supports_vw_lateral_when_faulted(self) -> bool: - from opendbc.car.volkswagen.values import VolkswagenFlags + from iqdbc.car.volkswagen.values import VolkswagenFlags # PQ, MEB, MQB_EVO and base MQB all implement cruiseFaultLateralMode in carstate.py. # MLB does not. return not bool(self._vw_flags() & VolkswagenFlags.MLB) diff --git a/selfdrive/ui/ui_state.py b/selfdrive/ui/ui_state.py index ad5457d..d82f7c0 100644 --- a/selfdrive/ui/ui_state.py +++ b/selfdrive/ui/ui_state.py @@ -76,7 +76,9 @@ class IQUIState: @property def onroad_brightness_timer_expired(self) -> bool: - return self.onroad_brightness != OnroadBrightness.AUTO and self.onroad_brightness_timer == 0 + if self.onroad_brightness == OnroadBrightness.AUTO: + return False + return self.onroad_brightness_timer == 0 @property def auto_onroad_brightness(self) -> bool: @@ -208,18 +210,20 @@ class IQDevice: @staticmethod def set_min_onroad_brightness(_ui_state, min_brightness: int) -> int: - if _ui_state.onroad_brightness == OnroadBrightness.AUTO_DARK: - min_brightness = 10 - - return min_brightness + dark = _ui_state.onroad_brightness == OnroadBrightness.AUTO_DARK + return 10 if dark else min_brightness @staticmethod def wake_from_dimmed_onroad_brightness(_ui_state, evs) -> None: - if _ui_state.started and (_ui_state.onroad_brightness_timer_expired or _ui_state.onroad_brightness == OnroadBrightness.AUTO_DARK): - if any(ev.left_down for ev in evs): - if _ui_state.onroad_brightness_timer_expired: - gui_app.mouse_events.clear() - _ui_state.reset_onroad_sleep_timer() + expired = _ui_state.onroad_brightness_timer_expired + dimmed = expired or _ui_state.onroad_brightness == OnroadBrightness.AUTO_DARK + if not (_ui_state.started and dimmed): + return + if not any(ev.left_down for ev in evs): + return + if expired: + gui_app.mouse_events.clear() + _ui_state.reset_onroad_sleep_timer() class UIStatus(Enum): diff --git a/system/hardware/tici/tests/test_power_draw.py b/system/hardware/tici/tests/test_power_draw.py index 4fbde81..199ef6b 100644 --- a/system/hardware/tici/tests/test_power_draw.py +++ b/system/hardware/tici/tests/test_power_draw.py @@ -7,7 +7,7 @@ from tabulate import tabulate import cereal.messaging as messaging from cereal.services import SERVICE_LIST -from opendbc.car.car_helpers import get_demo_car_params +from iqdbc.car.car_helpers import get_demo_car_params from openpilot.common.mock import mock_messages from openpilot.common.params import Params from openpilot.system.hardware.tici.power_monitor import get_power diff --git a/system/webrtc/device/audio_ldc.py b/system/webrtc/device/audio_ldc.py new file mode 100644 index 0000000..a20a394 --- /dev/null +++ b/system/webrtc/device/audio_ldc.py @@ -0,0 +1,124 @@ +import asyncio +import contextlib +from collections import deque +from fractions import Fraction + +import av + +from cereal import messaging +from openpilot.selfdrive.ui.soundd import SAMPLE_RATE as SOUND_SAMPLE_RATE +from openpilot.system.webrtc.device.audio import WEBRTC_AUDIO_PTIME, WEBRTC_AUDIO_SERVICE + + +class AudioInputOpusProducer: + """Micd PCM -> 48 kHz Opus payloads for libdatachannel's RTP packetizer.""" + + def __init__(self) -> None: + self._sock = messaging.sub_sock("rawAudioData", conflate=False) + self._pcm = bytearray() + self._source_rate = 16_000 + self._next_pts = 0 + self._pending: deque[tuple[bytes, int]] = deque() + self._enabled = True + self._resampler = av.AudioResampler(format="fltp", layout="mono", rate=48_000) + self._encoder = av.CodecContext.create("libopus", "w") + self._encoder.sample_rate = 48_000 + self._encoder.layout = "mono" + self._encoder.format = "fltp" + self._encoder.open() + + def enable(self, enabled: bool) -> None: + self._enabled = enabled + + async def _read_pcm_frame(self) -> av.AudioFrame: + while True: + samples = max(1, int(WEBRTC_AUDIO_PTIME * self._source_rate)) + target_bytes = samples * 2 + while len(self._pcm) < target_bytes: + msg = messaging.recv_one_or_none(self._sock) + if msg is None: + await asyncio.sleep(0.002) + continue + audio = msg.rawAudioData + rate = int(audio.sampleRate) or self._source_rate + if rate != self._source_rate: + self._source_rate = rate + self._pcm.clear() + continue + self._pcm.extend(bytes(audio.data)) + + data = bytes(self._pcm[:target_bytes]) + del self._pcm[:target_bytes] + frame = av.AudioFrame(format="s16", layout="mono", samples=samples) + frame.planes[0].update(data) + frame.sample_rate = self._source_rate + return frame + + async def recv(self) -> tuple[bytes, int] | None: + if not self._enabled: + await asyncio.sleep(WEBRTC_AUDIO_PTIME) + return None + while not self._pending: + source_frame = await self._read_pcm_frame() + for frame in self._resampler.resample(source_frame): + frame.pts = self._next_pts + frame.time_base = Fraction(1, 48_000) + self._next_pts += frame.samples + for packet in self._encoder.encode(frame): + self._pending.append((bytes(packet), int(packet.pts or 0))) + return self._pending.popleft() + + +class IncomingOpusCerealProxy: + """libdatachannel Opus payloads -> soundd-compatible PCM cereal messages.""" + + def __init__(self, track) -> None: + self._loop = asyncio.get_running_loop() + self._queue: asyncio.Queue[bytes] = asyncio.Queue(maxsize=32) + self._pm = messaging.PubMaster([WEBRTC_AUDIO_SERVICE]) + self._decoder = av.CodecContext.create("opus", "r") + self._resampler = av.AudioResampler(format="s16", layout="mono", rate=SOUND_SAMPLE_RATE) + self._task: asyncio.Task | None = None + track.on_frame(self._on_frame) + + def _on_frame(self, payload: bytes, _info) -> None: + def enqueue() -> None: + if self._queue.full(): + with contextlib.suppress(asyncio.QueueEmpty): + self._queue.get_nowait() + self._queue.put_nowait(bytes(payload)) + self._loop.call_soon_threadsafe(enqueue) + + def start(self) -> None: + if self._task is None: + self._task = asyncio.create_task(self.run()) + + async def stop(self) -> None: + if self._task is None: + return + self._task.cancel() + try: + await self._task + except asyncio.CancelledError: + pass + self._task = None + + def _publish(self, frame: av.AudioFrame) -> None: + data = frame.to_ndarray().tobytes() + if not data: + return + msg = messaging.new_message(WEBRTC_AUDIO_SERVICE, valid=True) + msg.webrtcAudioData.data = data + msg.webrtcAudioData.sampleRate = frame.sample_rate + self._pm.send(WEBRTC_AUDIO_SERVICE, msg) + + async def run(self) -> None: + while True: + payload = await self._queue.get() + try: + for decoded in self._decoder.decode(av.Packet(payload)): + for frame in self._resampler.resample(decoded): + self._publish(frame) + except Exception: + # A malformed or stale packet must not end the video/control session. + continue diff --git a/system/webrtc/device/video.py b/system/webrtc/device/video.py index 5ff5f81..a2061a2 100644 --- a/system/webrtc/device/video.py +++ b/system/webrtc/device/video.py @@ -86,6 +86,9 @@ class LiveStreamVideoStreamTrack(TiciVideoStreamTrack): self._kf_requested = True self._request_keyframe(True) + def request_keyframe(self) -> None: + self._mark_keyframe_needed() + def _mark_keyframe_received(self) -> None: """This track got its keyframe; only clear the global request once no track needs one.""" if self._kf_requested: diff --git a/system/webrtc/device/video_ldc.py b/system/webrtc/device/video_ldc.py new file mode 100644 index 0000000..5767b65 --- /dev/null +++ b/system/webrtc/device/video_ldc.py @@ -0,0 +1,274 @@ +import asyncio +import logging +import struct +import time + +import av +from openpilot.system.webrtc.teleoprtc_ldc.tracks import TiciVideoStreamTrack + +from cereal import messaging +from openpilot.common.params import Params +from openpilot.common.realtime import DT_MDL, DT_DMON + +# Arbitrary 16-byte UUID identifying konn3kt frame-timing SEI messages. When timing +# telemetry is enabled, each frame carries a user_data_unregistered SEI NAL with four +# big-endian doubles (ms): encode duration, IPC/queue delay, host transit, and the +# device wall clock. The client decodes these to compute true glass-to-glass latency. +TIMING_SEI_UUID = bytes([ + 0xa5, 0xe0, 0xc4, 0xa4, 0x5b, 0x6e, 0x4e, 0x1e, + 0x9c, 0x7e, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, +]) +# Annex-B start code + SEI NAL (type 6) + user_data_unregistered (type 5) + payload size +# (0x30 = 48 bytes = 16 UUID + 32 data). Trailing 0x80 is the RBSP stop bit. +_SEI_PREFIX = b'\x00\x00\x00\x01\x06\x05\x30' + TIMING_SEI_UUID + + +class LiveStreamVideoStreamTrack(TiciVideoStreamTrack): + livestream_camera_to_sock_mapping = { + "driver": "livestreamDriverEncodeData", + "wideRoad": "livestreamWideRoadEncodeData", + "road": "livestreamRoadEncodeData", + } + main_camera_to_sock_mapping = { + "driver": "driverEncodeData", + "wideRoad": "wideRoadEncodeData", + "road": "roadEncodeData", + } + + # Number of live tracks still waiting for their first keyframe. The on-demand + # keyframe request (LivestreamRequestKeyframe) is a single global param honored by + # every encoder, so with multiple concurrent tracks (dual-camera PiP) we must not + # clear it until *all* tracks have received an IDR — otherwise the first track to + # get its keyframe clears the request and starves the others (black feed). + _kf_pending_count = 0 + + def __init__(self, camera_type: str): + dt = DT_DMON if camera_type == "driver" else DT_MDL + super().__init__(camera_type, dt) + + self._params = Params() + self._camera_type = camera_type + self._candidate_topics = [ + self.main_camera_to_sock_mapping[camera_type], + self.livestream_camera_to_sock_mapping[camera_type], + ] + self._socks = {topic: messaging.sub_sock(topic, conflate=True) for topic in self._candidate_topics} + self._active_topic = self._preferred_topics()[0] + self._pts = 0 + self._t0_ns = time.monotonic_ns() + self._cached_header: bytes = b"" + self._sent_keyframe = False + self._kf_requested = False # whether this track counts toward _kf_pending_count + self._frame_count = 0 + self._last_frame_time = 0.0 + self._last_preference_refresh = 0.0 + # Tracks how long the H264 livestream feed has been silent, to gate the last-resort main-feed + # fallback (see recv) without flapping between sources frame-by-frame. + self._live_silent_since: float | None = None + # Opt-in glass-to-glass latency telemetry (toggled by the client over the data channel). + self.timing_sei_enabled = False + self._logger = logging.getLogger("LiveStreamVideoStreamTrack") + + # Ask the encoder for an immediate IDR so the stream starts fast instead of waiting up to a full + # GOP for the next periodic keyframe (encoderd honors LivestreamRequestKeyframe per-frame). + self._mark_keyframe_needed() + + def _request_keyframe(self, enabled: bool) -> None: + try: + self._params.put_bool("LivestreamRequestKeyframe", enabled) + except Exception: + self._logger.exception("failed to set LivestreamRequestKeyframe") + + def _mark_keyframe_needed(self) -> None: + """This track needs (another) keyframe: keep the global request asserted.""" + if not self._kf_requested: + LiveStreamVideoStreamTrack._kf_pending_count += 1 + self._kf_requested = True + self._request_keyframe(True) + + def request_keyframe(self) -> None: + """RTCP PLI hook used by libdatachannel's native H.264 packetizer.""" + self._mark_keyframe_needed() + + def _mark_keyframe_received(self) -> None: + """This track got its keyframe; only clear the global request once no track needs one.""" + if self._kf_requested: + self._kf_requested = False + LiveStreamVideoStreamTrack._kf_pending_count = max(0, LiveStreamVideoStreamTrack._kf_pending_count - 1) + if LiveStreamVideoStreamTrack._kf_pending_count == 0: + self._request_keyframe(False) + + def stop(self): + # Release our pending-keyframe hold so a torn-down track that never received an + # IDR doesn't pin LivestreamRequestKeyframe True forever (continuous keyframes). + if getattr(self, "_kf_requested", False): + self._kf_requested = False + LiveStreamVideoStreamTrack._kf_pending_count = max(0, LiveStreamVideoStreamTrack._kf_pending_count - 1) + try: + super().stop() + except Exception: + pass + + def switch_camera(self, camera_type: str) -> None: + """Repoint this track at a different camera without renegotiating the peer connection. + + Lets a single video track back the whole Live View — the client flips cameras over the + data channel and we swap the source here, instead of uplinking every camera at once.""" + if camera_type not in self.livestream_camera_to_sock_mapping: + self._logger.warning("[%s] ignoring switch to unknown camera %s", self._id, camera_type) + return + if camera_type == self._camera_type: + return + self._logger.info("[%s] switching camera %s -> %s", self._id, self._camera_type, camera_type) + self._camera_type = camera_type + self._candidate_topics = [ + self.main_camera_to_sock_mapping[camera_type], + self.livestream_camera_to_sock_mapping[camera_type], + ] + self._socks = {topic: messaging.sub_sock(topic, conflate=True) for topic in self._candidate_topics} + self._active_topic = self._preferred_topics()[0] + # Force a fresh keyframe/header before emitting frames from the new source, and ask the encoder + # for an immediate IDR so the camera switch isn't stalled waiting for the next periodic keyframe. + self._cached_header = b"" + self._sent_keyframe = False + self._last_preference_refresh = 0.0 + self._live_silent_since = None + self._mark_keyframe_needed() + + def _preferred_topics(self) -> list[str]: + # WebRTC currently forces H.264. The dedicated livestream topics are the H.264 feeds, + # while the main encode topics are the full-resolution HEVC recordings. Prefer the + # livestream feeds both onroad and offroad, and keep the main topics only as fallback. + return [ + self.livestream_camera_to_sock_mapping[self._camera_type], + self.main_camera_to_sock_mapping[self._camera_type], + ] + + def _reset_decoder_state(self, topic: str) -> None: + if topic == self._active_topic: + return + self._logger.info("[%s] switching video source from %s to %s", self._id, self._active_topic, topic) + self._active_topic = topic + self._cached_header = b"" + self._sent_keyframe = False + + def _timing_sei(self, evta, log_mono_time: int) -> bytes: + """Build a timing SEI NAL from encode metadata, or empty bytes when disabled.""" + if not self.timing_sei_enabled: + return b"" + idx = evta.idx + return _SEI_PREFIX + struct.pack( + '>4d', + (idx.timestampEof - idx.timestampSof) / 1e6, # encode duration (ms) + (log_mono_time - idx.timestampEof) / 1e6, # IPC/queue delay (ms) + (time.monotonic_ns() - log_mono_time) / 1e6, # host transit so far (ms) + time.time() * 1000, # device wall clock (ms) # noqa: TID251 + ) + b'\x80' + + def _is_keyframe(self, data: bytes) -> bool: + """Check if H.264 NAL unit contains an IDR keyframe (NAL type 5).""" + i = 0 + while i < len(data) - 4: + # Look for Annex B start codes: 0x000001 or 0x00000001 + if data[i:i+3] == b'\x00\x00\x01': + nal_type = data[i+3] & 0x1f + if nal_type == 5: # IDR slice + return True + i += 3 + elif data[i:i+4] == b'\x00\x00\x00\x01': + nal_type = data[i+4] & 0x1f + if nal_type == 5: # IDR slice + return True + i += 4 + else: + i += 1 + return False + + async def recv(self): + while True: + now = time.monotonic() + # Resolve topics each iteration: a camera switch (different async task) can rebuild self._socks + # across the await below, so a value cached before the loop would index a stale key (KeyError). + live_topic = self.livestream_camera_to_sock_mapping[self._camera_type] + main_topic = self.main_camera_to_sock_mapping[self._camera_type] + # Lock onto the dedicated H264 livestream feed. Onroad the HEVC main feed also publishes at + # 20fps; eagerly preferring whichever socket had a frame ready raced frame-by-frame, reset the + # decoder every frame, and (the track is negotiated H264) shoved HEVC garbage into the stream — + # the onroad choppiness. Only fall back to the main feed as a last resort after a long + # livestream silence (e.g. stream_encoderd still spinning up), and snap back when it returns. + msg = messaging.recv_one_or_none(self._socks[live_topic]) + if msg is not None: + self._reset_decoder_state(live_topic) + self._last_frame_time = now + self._live_silent_since = None + break + + if self._live_silent_since is None: + self._live_silent_since = now + elif now - self._live_silent_since > 3.0: + maybe_msg = messaging.recv_one_or_none(self._socks[main_topic]) + if maybe_msg is not None: + self._reset_decoder_state(main_topic) + self._last_frame_time = now + msg = maybe_msg + break + + await asyncio.sleep(0.005) + + evta = getattr(msg, msg.which()) + + header = bytes(evta.header) + data = bytes(evta.data) + self._frame_count += 1 + + # Cache SPS/PPS header when it arrives + if header: + self._cached_header = header + self._logger.debug(f"[{self._id}] cached SPS/PPS header ({len(header)} bytes)") + + # CRITICAL: Cannot decode without SPS/PPS. Wait for it. + if not self._cached_header: + self._logger.debug(f"[{self._id}] frame {self._frame_count}: no SPS/PPS yet, skipping") + return await self.recv() + + is_keyframe = self._is_keyframe(data) + + # Wait for first keyframe before sending any frames + # Browser decoder needs IDR to initialize properly + if not self._sent_keyframe: + if not is_keyframe: + self._logger.debug(f"[{self._id}] frame {self._frame_count}: waiting for keyframe") + return await self.recv() + self._sent_keyframe = True + # Got the IDR we asked for — stop nagging the encoder, but only once every + # concurrent track has its keyframe (multi-track PiP shares the global param). + self._mark_keyframe_received() + self._logger.info(f"[{self._id}] first keyframe received, starting stream") + + # Optional timing SEI NAL, inserted before the slice data (and after SPS/PPS on keyframes). + sei_nal = self._timing_sei(evta, msg.logMonoTime) + + # Prepend SPS/PPS header to keyframes (required by some decoders) + # For non-keyframes, header is optional but safe to include + if is_keyframe: + payload = self._cached_header + sei_nal + data + else: + payload = sei_nal + data + + self._pts = ((time.monotonic_ns() - self._t0_ns) * self._clock_rate) // 1_000_000_000 + + packet = av.Packet(payload) + packet.time_base = self._time_base + packet.pts = int(self._pts) + packet.dts = int(self._pts) + packet.duration = int(self._dt * self._clock_rate) + + if is_keyframe: + packet.is_keyframe = True + + self.log_debug("track sending frame %s (keyframe=%s, size=%d)", self._pts, is_keyframe, len(payload)) + + return packet + + def codec_preference(self) -> str | None: + return "H264" diff --git a/system/webrtc/teleoprtc_ldc/__init__.py b/system/webrtc/teleoprtc_ldc/__init__.py new file mode 100644 index 0000000..13cd60a --- /dev/null +++ b/system/webrtc/teleoprtc_ldc/__init__.py @@ -0,0 +1,2 @@ +from .builder import WebRTCOfferBuilder, WebRTCAnswerBuilder # noqa +from .stream import WebRTCBaseStream, StreamingOffer, ConnectionProvider, MessageHandler # noqa diff --git a/system/webrtc/teleoprtc_ldc/builder.py b/system/webrtc/teleoprtc_ldc/builder.py new file mode 100644 index 0000000..f9e5e98 --- /dev/null +++ b/system/webrtc/teleoprtc_ldc/builder.py @@ -0,0 +1,89 @@ +# ruff: noqa: TID251, UP006, UP035 + +import abc +from typing import Dict, List, Optional + +from .stream import RTCSessionDescription, WebRTCBaseStream, WebRTCOfferStream, WebRTCAnswerStream, ConnectionProvider +from .tracks import TiciVideoStreamTrack, TiciTrackWrapper + + +class WebRTCStreamBuilder(abc.ABC): + @abc.abstractmethod + def stream(self) -> WebRTCBaseStream: + raise NotImplementedError + + +class WebRTCOfferBuilder(WebRTCStreamBuilder): + def __init__(self, connection_provider: ConnectionProvider, bind_address: Optional[str] = None, + ice_servers: Optional[List[dict]] = None): + self.connection_provider = connection_provider + self.bind_address = bind_address + self.ice_servers = ice_servers + self.requested_camera_types: List[str] = [] + self.requested_audio = False + self.audio_tracks: List[object] = [] + self.messaging_enabled = False + + def offer_to_receive_video_stream(self, camera_type: str): + assert camera_type in ["driver", "wideRoad", "road"] + self.requested_camera_types.append(camera_type) + + def offer_to_receive_audio_stream(self): + self.requested_audio = True + + def add_audio_stream(self, track: object): + assert len(self.audio_tracks) == 0 + self.audio_tracks = [track] + + def add_messaging(self): + self.messaging_enabled = True + + def stream(self) -> WebRTCBaseStream: + return WebRTCOfferStream( + self.connection_provider, + consumed_camera_types=self.requested_camera_types, + consume_audio=self.requested_audio, + video_producer_tracks=[], + audio_producer_tracks=self.audio_tracks, + should_add_data_channel=self.messaging_enabled, + bind_address=self.bind_address, + ice_servers=self.ice_servers, + ) + + +class WebRTCAnswerBuilder(WebRTCStreamBuilder): + def __init__(self, offer_sdp: str, bind_address: Optional[str] = None, + ice_servers: Optional[List[dict]] = None): + self.offer_sdp = offer_sdp + self.bind_address = bind_address + self.ice_servers = ice_servers + self.video_tracks: Dict[str, TiciVideoStreamTrack] = {} + self.requested_audio = False + self.audio_tracks: List[object] = [] + + def offer_to_receive_audio_stream(self): + self.requested_audio = True + + def add_video_stream(self, camera_type: str, track: object): + assert camera_type not in self.video_tracks + assert camera_type in ["driver", "wideRoad", "road"] + if not isinstance(track, TiciVideoStreamTrack): + track = TiciTrackWrapper(camera_type, track) + self.video_tracks[camera_type] = track + + def add_audio_stream(self, track: object): + assert len(self.audio_tracks) == 0 + self.audio_tracks = [track] + + def stream(self) -> WebRTCBaseStream: + description = RTCSessionDescription(sdp=self.offer_sdp, type="offer") + return WebRTCAnswerStream( + description, + consumed_camera_types=[], + consume_audio=self.requested_audio, + video_producer_tracks=list(self.video_tracks.values()), + audio_producer_tracks=self.audio_tracks, + should_add_data_channel=False, + bind_address=self.bind_address, + ice_servers=self.ice_servers, + ) diff --git a/system/webrtc/teleoprtc_ldc/decoder.py b/system/webrtc/teleoprtc_ldc/decoder.py new file mode 100644 index 0000000..843c67a --- /dev/null +++ b/system/webrtc/teleoprtc_ldc/decoder.py @@ -0,0 +1,52 @@ +# ruff: noqa: UP006, UP035 + +import dataclasses +import struct +from typing import List + + +@dataclasses.dataclass(frozen=True) +class RtcpReceiverReport: + ssrc: int + fraction_lost: int + packets_lost: int + highest_seq_no: int + jitter: int + lsr: int + dlsr: int + + +def _decode_receiver_reports(message: bytes) -> List[RtcpReceiverReport]: + reports: List[RtcpReceiverReport] = [] + offset = 0 + + while offset + 4 <= len(message): + flags, packet_type, length_words = struct.unpack_from("!BBH", message, offset) + packet_end = offset + (length_words + 1) * 4 + if flags >> 6 != 2 or packet_end > len(message): + break + + report_count = flags & 0x1F + if packet_type == 200: # Sender Report + report_offset = offset + 28 + elif packet_type == 201: # Receiver Report + report_offset = offset + 8 + else: + offset = packet_end + continue + + if report_offset + report_count * 24 > packet_end: + break + + for i in range(report_count): + block_offset = report_offset + i * 24 + ssrc, loss, highest_seq_no, jitter, lsr, dlsr = struct.unpack_from("!IIIIII", message, block_offset) + fraction_lost = loss >> 24 + packets_lost = loss & 0xFFFFFF + if packets_lost & 0x800000: + packets_lost -= 1 << 24 + reports.append(RtcpReceiverReport(ssrc, fraction_lost, packets_lost, highest_seq_no, jitter, lsr, dlsr)) + + offset = packet_end + + return reports diff --git a/system/webrtc/teleoprtc_ldc/info.py b/system/webrtc/teleoprtc_ldc/info.py new file mode 100644 index 0000000..191d177 --- /dev/null +++ b/system/webrtc/teleoprtc_ldc/info.py @@ -0,0 +1,37 @@ +import dataclasses + +from libdatachannel import Description + + +@dataclasses.dataclass +class StreamingMediaInfo: + n_expected_camera_tracks: int + expected_audio_track: bool + incoming_audio_track: bool + incoming_datachannel: bool + + +def parse_info_from_offer(sdp: str) -> StreamingMediaInfo: + """ + helper function to parse info about outgoing and incoming streams from an offer sdp + """ + desc = Description(sdp, Description.Type.Offer) + n_video = 0 + expected_audio_track = False + incoming_audio_track = False + incoming_datachannel = desc.has_application() + + for i in range(desc.media_count()): + media = desc.media(i) + if media is None: + continue + direction = media.direction() + if media.type() == "video" and direction in (Description.Direction.RecvOnly, Description.Direction.SendRecv): + n_video += 1 + elif media.type() == "audio": + if direction in (Description.Direction.RecvOnly, Description.Direction.SendRecv): + expected_audio_track = True + if direction in (Description.Direction.SendOnly, Description.Direction.SendRecv): + incoming_audio_track = True + + return StreamingMediaInfo(n_video, expected_audio_track, incoming_audio_track, incoming_datachannel) diff --git a/system/webrtc/teleoprtc_ldc/stream.py b/system/webrtc/teleoprtc_ldc/stream.py new file mode 100644 index 0000000..41d47de --- /dev/null +++ b/system/webrtc/teleoprtc_ldc/stream.py @@ -0,0 +1,530 @@ +# ruff: noqa: TID251, UP006, UP035 + +import abc +import asyncio +import contextlib +import dataclasses +import logging +import random +from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union + +from libdatachannel import ( + Configuration, + DataChannel, + Candidate, + Description, + FrameInfo, + H264RtpPacketizer, + IceServer, + NalUnit, + OpusRtpDepacketizer, + OpusRtpPacketizer, + PeerConnection, + PliHandler, + RtcpNackResponder, + RtcpSrReporter, + RtpPacketizationConfig, + Track, +) + +from .decoder import RtcpReceiverReport, _decode_receiver_reports +from .tracks import TiciVideoStreamTrack, parse_video_track_id + + +@dataclasses.dataclass +class StreamingOffer: + sdp: str + video: List[str] + + +@dataclasses.dataclass +class RTCSessionDescription: + sdp: str + type: str + + +ConnectionProvider = Callable[[StreamingOffer], Awaitable[RTCSessionDescription]] +MessageHandler = Callable[[Union[bytes, str]], None] + + +class WebRTCBaseStream(abc.ABC): + def __init__(self, + consumed_camera_types: List[str], + consume_audio: bool, + video_producer_tracks: List[TiciVideoStreamTrack], + audio_producer_tracks: List[Any], + should_add_data_channel: bool, + bind_address: Optional[str] = None, + ice_servers: Optional[List[dict]] = None): + config = Configuration() + config.force_media_transport = True + config.disable_auto_negotiation = True + config.ice_servers = self._make_ice_servers(ice_servers) + if bind_address is not None: + config.bind_address = bind_address + + self.peer_connection = PeerConnection(config) + self.expected_incoming_camera_types = consumed_camera_types + self.expected_incoming_audio = consume_audio + self.expected_number_of_incoming_media: Optional[int] = None + + self.incoming_camera_tracks: Dict[str, Any] = {} + self.incoming_audio_tracks: List[Any] = [] + self.outgoing_video_tracks = video_producer_tracks + self.outgoing_audio_tracks = audio_producer_tracks + + self.should_add_data_channel = should_add_data_channel + self.messaging_channel: Optional[DataChannel] = None + self.incoming_message_handlers: List[MessageHandler] = [] + self._consumer_tracks: List[Track] = [] + self._sender_tasks: List[asyncio.Task] = [] + self._track_state: List[Tuple[Track, TiciVideoStreamTrack, RtpPacketizationConfig]] = [] + self._audio_track_state: List[Tuple[Track, Any, RtpPacketizationConfig]] = [] + self._receiver_reports: Dict[str, RtcpReceiverReport] = {} + self._receiver_report_tracks: Dict[str, Tuple[Track, int]] = {} + + self.incoming_media_ready_event = asyncio.Event() + self.messaging_channel_ready_event = asyncio.Event() + self.connection_attempted_event = asyncio.Event() + self.connection_stopped_event = asyncio.Event() + self.gathering_complete_event = asyncio.Event() + self._loop: Optional[asyncio.AbstractEventLoop] = None + + self.peer_connection.on_state_change(self._on_connectionstatechange) + self.peer_connection.on_gathering_state_change(self._on_gatheringstatechange) + self.peer_connection.on_data_channel(self._on_incoming_datachannel) + if self.expected_incoming_camera_types or self.expected_incoming_audio: + self.peer_connection.on_track(self._on_incoming_track) + + self.logger = logging.getLogger("WebRTCStream") + + @staticmethod + def _make_ice_servers(servers: Optional[List[dict]]) -> List[IceServer]: + """Preserve Konn3kt's authenticated STUN/TURN configuration in libdatachannel.""" + parsed: List[IceServer] = [] + for server in servers or []: + urls = server.get("urls", []) if isinstance(server, dict) else [] + if isinstance(urls, str): + urls = [urls] + username = str(server.get("username") or "") + credential = str(server.get("credential") or "") + for url in urls: + if not isinstance(url, str) or not url: + continue + try: + ice_server = IceServer(url) + ice_server.username = username + ice_server.password = credential + parsed.append(ice_server) + except Exception: + logging.getLogger("WebRTCStream").warning("Ignoring invalid ICE server %r", url, exc_info=True) + # A supplied list is authoritative, including LAN-only sessions where relay is deliberately filtered. + return parsed or [IceServer("stun:stun.l.google.com:19302")] + + def _log_debug(self, msg: Any, *args): + self.logger.debug(f"{type(self)}() {msg}", *args) + + def _call_soon_threadsafe(self, fn: Callable, *args) -> None: + if self._loop is not None and self._loop.is_running(): + self._loop.call_soon_threadsafe(fn, *args) + else: + fn(*args) + + def _set_event(self, event: asyncio.Event) -> None: + self._call_soon_threadsafe(event.set) + + @property + def _number_of_incoming_media(self) -> int: + media = len(self.incoming_camera_tracks) + len(self.incoming_audio_tracks) + media += int(self.messaging_channel is not None) if not self.should_add_data_channel else 0 + return media + + def _add_consumer_transceivers(self): + for camera_type in self.expected_incoming_camera_types: + media = Description.Video(camera_type, Description.Direction.RecvOnly) + media.add_h264_codec(96) + track = self.peer_connection.add_track(media) + track.set_media_handler(OpusRtpDepacketizer()) + self._consumer_tracks.append(track) + self.incoming_camera_tracks[camera_type] = track + if self.expected_incoming_audio: + media = Description.Audio("audio", Description.Direction.RecvOnly) + media.add_opus_codec(111) + track = self.peer_connection.add_track(media) + self._consumer_tracks.append(track) + self.incoming_audio_tracks.append(track) + + def _find_offer_video(self, remote_sdp: str) -> Tuple[str, int]: + desc = Description(remote_sdp, Description.Type.Offer) + for i in range(desc.media_count()): + media = desc.media(i) + if media is None or media.type() != "video": + continue + for payload_type in media.payload_types(): + with contextlib.suppress(ValueError): + rtp_map = media.rtp_map(payload_type) + if rtp_map is not None and rtp_map.format.upper() == "H264": + return media.mid(), payload_type + raise ValueError("Remote SDP does not offer H264 video") + + def _make_video_media(self, track: TiciVideoStreamTrack, remote_sdp: str) -> Tuple[Description.Video, int, int, str]: + mid, payload_type = self._find_offer_video(remote_sdp) + ssrc = random.randint(1, 0xFFFFFFFF) + cname = f"teleoprtc-{random.getrandbits(32):08x}" + stream_id = f"stream-{random.getrandbits(32):08x}" + media = Description.Video(mid, Description.Direction.SendOnly) + media.add_h264_codec(payload_type) + media.add_ssrc(ssrc, cname, stream_id, track.id) + return media, ssrc, payload_type, cname + + def _find_offer_audio(self, remote_sdp: str) -> Tuple[str, int]: + desc = Description(remote_sdp, Description.Type.Offer) + for i in range(desc.media_count()): + media = desc.media(i) + if media is None or media.type() != "audio": + continue + for payload_type in media.payload_types(): + with contextlib.suppress(ValueError): + rtp_map = media.rtp_map(payload_type) + if rtp_map is not None and rtp_map.format.upper() == "OPUS": + return media.mid(), payload_type + raise ValueError("Remote SDP does not offer Opus audio") + + def _make_audio_media(self, remote_sdp: str) -> Tuple[Description.Audio, int, int, str]: + mid, payload_type = self._find_offer_audio(remote_sdp) + ssrc = random.randint(1, 0xFFFFFFFF) + cname = f"teleoprtc-audio-{random.getrandbits(32):08x}" + direction = Description.Direction.SendRecv if self.expected_incoming_audio else Description.Direction.SendOnly + media = Description.Audio(mid, direction) + media.add_opus_codec(payload_type) + media.add_ssrc(ssrc, cname, "audio", "audio") + return media, ssrc, payload_type, cname + + def _add_producer_tracks(self, remote_sdp: Optional[str] = None): + for track in self.outgoing_video_tracks: + media, ssrc, payload_type, cname = self._make_video_media(track, remote_sdp or "") + rtc_track = self.peer_connection.add_track(media) + + rtp_config = RtpPacketizationConfig(ssrc, cname, payload_type, H264RtpPacketizer.CLOCK_RATE) + rtp_config.start_timestamp = random.randint(0, 0xFFFFFFFF) + rtp_config.timestamp = rtp_config.start_timestamp + rtp_config.sequence_number = random.randint(0, 0xFFFF) + + packetizer = H264RtpPacketizer(NalUnit.Separator.LongStartSequence, rtp_config, 1200) + packetizer.add_to_chain(RtcpSrReporter(rtp_config)) + packetizer.add_to_chain(PliHandler(track.request_keyframe)) + packetizer.add_to_chain(RtcpNackResponder()) + rtc_track.set_media_handler(packetizer) + + camera_type, _ = parse_video_track_id(track.id) + rtc_track.reset_callbacks() + self._receiver_report_tracks[camera_type] = (rtc_track, ssrc) + self._track_state.append((rtc_track, track, rtp_config)) + + for producer in self.outgoing_audio_tracks: + media, ssrc, payload_type, cname = self._make_audio_media(remote_sdp or "") + if self.expected_incoming_audio and self.incoming_audio_tracks: + # set_remote_description() creates the browser's sendrecv audio track. Reuse that + # negotiated m-line for our outbound Opus instead of adding a second track with the + # same MID, which leaves libdatachannel stuck in signalling/ICE negotiation. + rtc_track = self.incoming_audio_tracks[0] + negotiated_media = rtc_track.description() + negotiated_media.add_ssrc(ssrc, cname, "audio", "audio") + rtc_track.set_description(negotiated_media) + else: + rtc_track = self.peer_connection.add_track(media) + rtp_config = RtpPacketizationConfig(ssrc, cname, payload_type, OpusRtpPacketizer.DEFAULT_CLOCK_RATE) + rtp_config.start_timestamp = random.randint(0, 0xFFFFFFFF) + rtp_config.timestamp = rtp_config.start_timestamp + rtp_config.sequence_number = random.randint(0, 0xFFFF) + packetizer = OpusRtpPacketizer(rtp_config) + packetizer.add_to_chain(RtcpSrReporter(rtp_config)) + packetizer.add_to_chain(RtcpNackResponder()) + rtc_track.set_media_handler(packetizer) + self._audio_track_state.append((rtc_track, producer, rtp_config)) + + def _add_messaging_channel(self, channel: Optional[DataChannel] = None): + if channel is None: + channel = self.peer_connection.create_data_channel("data") + self.messaging_channel = channel + + def on_message(message: Union[bytes, str]): + for handler in list(self.incoming_message_handlers): + self._call_soon_threadsafe(handler, message) + + channel.on_message(on_message) + channel.on_open(lambda: self._set_event(self.messaging_channel_ready_event)) + channel.on_closed(lambda: self._set_event(self.connection_stopped_event)) + if channel.is_open(): + self._set_event(self.messaging_channel_ready_event) + self._on_after_media() + + def _on_connectionstatechange(self, state: PeerConnection.State): + self._log_debug("connection state is %s", state) + if state in (PeerConnection.State.Connected, PeerConnection.State.Failed): + self._set_event(self.connection_attempted_event) + if state in (PeerConnection.State.Disconnected, PeerConnection.State.Closed, PeerConnection.State.Failed): + self._set_event(self.connection_stopped_event) + + def _on_gatheringstatechange(self, state: PeerConnection.GatheringState): + self._log_debug("gathering state is %s", state) + if state == PeerConnection.GatheringState.Complete: + self._set_event(self.gathering_complete_event) + + def _on_incoming_track(self, track: Track): + self._log_debug("got track: %s", track.mid()) + media_type = track.description().type() + if media_type == "audio": + if self.expected_incoming_audio: + self.incoming_audio_tracks.append(track) + self._on_after_media() + return + if media_type != "video": + self._on_after_media() + return + try: + camera_type, _ = parse_video_track_id(track.mid()) + except ValueError: + camera_type = track.mid() + if camera_type in self.expected_incoming_camera_types: + self.incoming_camera_tracks[camera_type] = track + self._on_after_media() + + def _on_incoming_datachannel(self, channel: DataChannel): + self._log_debug("got data channel: %s", channel.label()) + if channel.label() == "data" and self.messaging_channel is None: + self._add_messaging_channel(channel) + + def _update_receiver_report(self, camera_type: str, ssrc: int, message: bytes) -> None: + for report in _decode_receiver_reports(message): + if report.ssrc == ssrc: + self._receiver_reports[camera_type] = report + + def _on_after_media(self): + if self.expected_number_of_incoming_media is not None and self._number_of_incoming_media >= self.expected_number_of_incoming_media: + self._set_event(self.incoming_media_ready_event) + + def _parse_incoming_streams(self, remote_sdp: str): + desc = Description(remote_sdp, Description.Type.Offer) + media_count = 0 + for i in range(desc.media_count()): + media = desc.media(i) + if media is None: + continue + direction = media.direction() + if media.type() == "video" and direction in (Description.Direction.SendOnly, Description.Direction.SendRecv): + media_count += 1 + elif media.type() == "audio" and self.expected_incoming_audio and direction in (Description.Direction.SendOnly, Description.Direction.SendRecv): + media_count += 1 + data_media_count = int(desc.has_application()) if not self.should_add_data_channel else 0 + self.expected_number_of_incoming_media = media_count + data_media_count + if self.expected_number_of_incoming_media == 0: + self._set_event(self.incoming_media_ready_event) + + def has_incoming_video_track(self, camera_type: str) -> bool: + return camera_type in self.incoming_camera_tracks + + def has_incoming_audio_track(self) -> bool: + return len(self.incoming_audio_tracks) > 0 + + def has_messaging_channel(self) -> bool: + return self.messaging_channel is not None + + def get_incoming_video_track(self, camera_type: str) -> Track: + assert camera_type in self.incoming_camera_tracks, "Video tracks are not enabled on this stream" + assert self.is_started, "Stream must be started" + return self.incoming_camera_tracks[camera_type] + + def get_incoming_audio_track(self) -> Track: + assert len(self.incoming_audio_tracks) > 0, "Audio tracks are not enabled on this stream" + assert self.is_started, "Stream must be started" + return self.incoming_audio_tracks[0] + + def get_messaging_channel(self) -> DataChannel: + assert self.messaging_channel is not None, "Messaging channel is not enabled on this stream" + assert self.is_started, "Stream must be started" + return self.messaging_channel + + def get_receiver_report_stats(self) -> Dict[str, RtcpReceiverReport]: + return dict(self._receiver_reports) + + def set_message_handler(self, message_handler: MessageHandler): + self.incoming_message_handlers.append(message_handler) + + def add_ice_candidate(self, candidate: dict) -> None: + """Accept post-offer browser candidates for Konn3kt's existing trickle endpoint.""" + candidate_sdp = str(candidate.get("candidate") or "") if isinstance(candidate, dict) else "" + if not candidate_sdp: + return + try: + self.peer_connection.add_remote_candidate(Candidate(candidate_sdp, str(candidate.get("sdpMid") or ""))) + except Exception: + self.logger.warning("Ignoring invalid trickle ICE candidate", exc_info=True) + + @property + def is_started(self) -> bool: + return self.peer_connection is not None and \ + self.peer_connection.local_description() is not None and \ + self.peer_connection.remote_description() is not None and \ + self.peer_connection.state() != PeerConnection.State.Closed + + @property + def is_connected_and_ready(self) -> bool: + return self.peer_connection is not None and \ + self.peer_connection.state() == PeerConnection.State.Connected and \ + (self.expected_number_of_incoming_media == 0 or self.incoming_media_ready_event.is_set()) + + async def _wait_for_gathering_complete(self): + if self.peer_connection.gathering_state() != PeerConnection.GatheringState.Complete: + await self.gathering_complete_event.wait() + + async def _send_track_loop(self, rtc_track: Track, producer_track: TiciVideoStreamTrack, rtp_config: RtpPacketizationConfig): + while True: + if not rtc_track.is_open(): + await asyncio.sleep(0.01) + continue + + try: + packet = await producer_track.recv() + data = bytes(packet) + if not data: + continue + + pts = int(packet.pts or 0) + timestamp = (rtp_config.start_timestamp + pts) & 0xFFFFFFFF + rtc_track.send_frame(data, FrameInfo(timestamp)) + except asyncio.CancelledError: + raise + except Exception: + self.logger.exception("Error in send track loop for track %s", producer_track.id) + self._set_event(self.connection_stopped_event) + break + + async def _receiver_report_loop(self): + while True: + for camera_type, (rtc_track, ssrc) in self._receiver_report_tracks.items(): + for _ in range(32): + try: + message = rtc_track.receive() + if message is None: # go until queue empty (bounded to 32) + break + if isinstance(message, bytes): + self._update_receiver_report(camera_type, ssrc, message) + except asyncio.CancelledError: + raise + except Exception: + self.logger.exception("Error receiving report for %s", camera_type) + break + await asyncio.sleep(0.05) + + async def _send_audio_track_loop(self, rtc_track: Track, producer: Any, rtp_config: RtpPacketizationConfig): + while True: + if not rtc_track.is_open(): + await asyncio.sleep(0.01) + continue + try: + packet = await producer.recv() + if packet is None: + continue + data, pts = packet + if data: + rtc_track.send_frame(data, FrameInfo((rtp_config.start_timestamp + int(pts)) & 0xFFFFFFFF)) + except asyncio.CancelledError: + raise + except Exception: + self.logger.exception("Error in audio send loop") + self._set_event(self.connection_stopped_event) + break + + def _start_sender_tasks(self): + for rtc_track, producer_track, rtp_config in self._track_state: + self._sender_tasks.append(asyncio.create_task(self._send_track_loop(rtc_track, producer_track, rtp_config))) + for rtc_track, producer, rtp_config in self._audio_track_state: + self._sender_tasks.append(asyncio.create_task(self._send_audio_track_loop(rtc_track, producer, rtp_config))) + if self._track_state: + self._sender_tasks.append(asyncio.create_task(self._receiver_report_loop())) + + async def wait_for_connection(self): + assert self.is_started + await self.connection_attempted_event.wait() + if self.peer_connection.state() != PeerConnection.State.Connected: + raise ValueError("Connection failed.") + if self.expected_number_of_incoming_media: + await self.incoming_media_ready_event.wait() + if self.messaging_channel is not None: + await self.messaging_channel_ready_event.wait() + self._start_sender_tasks() + + async def wait_for_disconnection(self): + assert self.is_connected_and_ready, "Stream is not connected/ready yet (make sure wait_for_connection was awaited)" + await self.connection_stopped_event.wait() + + async def stop(self): + for task in self._sender_tasks: + task.cancel() + for task in self._sender_tasks: + with contextlib.suppress(asyncio.CancelledError): + await task + self._sender_tasks.clear() + self.peer_connection.close() + self.peer_connection.reset_callbacks() + self.messaging_channel = None + self.incoming_camera_tracks.clear() + self.incoming_audio_tracks.clear() + self._consumer_tracks.clear() + self._track_state.clear() + self._audio_track_state.clear() + self._receiver_reports.clear() + self._receiver_report_tracks.clear() + + @abc.abstractmethod + async def start(self) -> RTCSessionDescription: + raise NotImplementedError + + +class WebRTCOfferStream(WebRTCBaseStream): + def __init__(self, session_provider: ConnectionProvider, *args, **kwargs): + super().__init__(*args, **kwargs) + self.session_provider = session_provider + + async def start(self) -> RTCSessionDescription: + self._loop = asyncio.get_running_loop() + self._add_consumer_transceivers() + if self.should_add_data_channel: + self._add_messaging_channel() + + self.peer_connection.set_local_description(Description.Type.Offer) + await self._wait_for_gathering_complete() + actual_offer = self.peer_connection.local_description() + + streaming_offer = StreamingOffer( + sdp=str(actual_offer), + video=list(self.expected_incoming_camera_types), + ) + remote_answer = await self.session_provider(streaming_offer) + self._parse_incoming_streams(remote_sdp=remote_answer.sdp) + self.peer_connection.set_remote_description(Description(remote_answer.sdp, Description.Type.Answer)) + self._on_after_media() + actual_answer = self.peer_connection.remote_description() + + return RTCSessionDescription(str(actual_answer), actual_answer.type_string()) + + +class WebRTCAnswerStream(WebRTCBaseStream): + def __init__(self, session: RTCSessionDescription, *args, **kwargs): + super().__init__(*args, **kwargs) + self.session = session + + async def start(self) -> RTCSessionDescription: + self._loop = asyncio.get_running_loop() + assert self.peer_connection.remote_description() is None, "Connection already established" + + self._parse_incoming_streams(remote_sdp=self.session.sdp) + self.peer_connection.set_remote_description(Description(self.session.sdp, Description.Type.Offer)) + self._add_producer_tracks(self.session.sdp) + + self.peer_connection.set_local_description(Description.Type.Answer) + await self._wait_for_gathering_complete() + actual_answer = self.peer_connection.local_description() + + return RTCSessionDescription(str(actual_answer), actual_answer.type_string()) diff --git a/system/webrtc/teleoprtc_ldc/tracks.py b/system/webrtc/teleoprtc_ldc/tracks.py new file mode 100644 index 0000000..32ff2cf --- /dev/null +++ b/system/webrtc/teleoprtc_ldc/tracks.py @@ -0,0 +1,77 @@ +# ruff: noqa: UP006, UP035 + +import fractions +import logging +import uuid +from typing import Any, Tuple + + +VIDEO_CLOCK_RATE = 90000 +VIDEO_TIME_BASE = fractions.Fraction(1, VIDEO_CLOCK_RATE) + + +def video_track_id(camera_type: str, track_id: str) -> str: + return f"{camera_type}:{track_id}" + + +def parse_video_track_id(track_id: str) -> Tuple[str, str]: + parts = track_id.split(":") + if len(parts) != 2: + raise ValueError(f"Invalid video track id: {track_id}") + + camera_type, track_id = parts + return camera_type, track_id + + +class TiciVideoStreamTrack: + """ + Abstract video track which associates video track with camera_type. + """ + kind = "video" + + def __init__(self, camera_type: str, dt: float, time_base: fractions.Fraction = VIDEO_TIME_BASE, clock_rate: int = VIDEO_CLOCK_RATE): + assert camera_type in ["driver", "wideRoad", "road"] + self._id: str = video_track_id(camera_type, str(uuid.uuid4())) + self._time_base: fractions.Fraction = time_base + self._clock_rate: int = clock_rate + self._logger = logging.getLogger("WebRTCStream") + self.readyState = "live" + + @property + def id(self) -> str: + return self._id + + def stop(self) -> None: + self.readyState = "ended" + + def log_debug(self, msg: Any, *args): + self._logger.debug(f"{type(self)}() {msg}", *args) + + async def recv(self): + raise NotImplementedError() + + def request_keyframe(self) -> None: + pass + + +class TiciTrackWrapper(TiciVideoStreamTrack): + """ + Associates a generic video track with camera_type. + """ + def __init__(self, camera_type: str, track: Any): + assert track.kind == "video" + super().__init__(camera_type, getattr(track, "_dt", 0.05)) + try: + parsed_camera, _ = parse_video_track_id(track.id) + self._id = track.id if parsed_camera == camera_type else video_track_id(camera_type, track.id) + except ValueError: + self._id = video_track_id(camera_type, track.id) + self._track = track + + async def recv(self): + return await self._track.recv() + + def stop(self) -> None: + super().stop() + if hasattr(self._track, "stop"): + self._track.stop() diff --git a/system/webrtc/webrtcd.py b/system/webrtc/webrtcd.py index 040c558..af217c7 100755 --- a/system/webrtc/webrtcd.py +++ b/system/webrtc/webrtcd.py @@ -542,6 +542,22 @@ class StreamRequestBody: ui_stream: bool = False +def _new_stream_session(offer_sdp: str, body: StreamRequestBody, debug_mode: bool): + if Params().get_bool("Konn3ktLibdatachannelWebRTC"): + try: + from openpilot.system.webrtc.webrtcd_ldc import StreamSessionLibdatachannel + return StreamSessionLibdatachannel( + offer_sdp, body.cameras, body.bridge_services_in, body.bridge_services_out, body.iceServers, debug_mode, + ui_stream=body.ui_stream, + ) + except Exception: + logging.getLogger("webrtcd").exception("libdatachannel unavailable; falling back to aiortc") + return StreamSession( + offer_sdp, body.cameras, body.bridge_services_in, body.bridge_services_out, body.iceServers, debug_mode, + ui_stream=body.ui_stream, + ) + + async def get_stream(request: 'web.Request'): stream_dict, debug_mode = request.app['streams'], request.app['debug'] logger = logging.getLogger("webrtcd") @@ -561,8 +577,7 @@ async def get_stream(request: 'web.Request'): logger.exception("Failed to stop previous stream session") stream_dict.clear() - session = StreamSession(offer_sdp, body.cameras, body.bridge_services_in, body.bridge_services_out, body.iceServers, debug_mode, - ui_stream=body.ui_stream) + session = _new_stream_session(offer_sdp, body, debug_mode) # Creating an answer can occasionally stall (ICE gathering, codec negotiation, etc). # Bound it so the HTTP request doesn't hang forever and athena can surface a useful error. try: @@ -579,8 +594,7 @@ async def get_stream(request: 'web.Request'): else: logger.info("Retrying with fresh session and original SDP (no mDNS host candidates removed)") - session = StreamSession(retry_offer_sdp, body.cameras, body.bridge_services_in, body.bridge_services_out, body.iceServers, debug_mode, - ui_stream=body.ui_stream) + session = _new_stream_session(retry_offer_sdp, body, debug_mode) answer = await asyncio.wait_for(session.get_answer(), timeout=15.0) session.start() diff --git a/system/webrtc/webrtcd_ldc.py b/system/webrtc/webrtcd_ldc.py new file mode 100644 index 0000000..2e51392 --- /dev/null +++ b/system/webrtc/webrtcd_ldc.py @@ -0,0 +1,244 @@ +import asyncio +import contextlib +import json +import logging +import os +import socket +import uuid +from typing import Any + +from openpilot.common.params import Params +from cereal import messaging + +from openpilot.system.webrtc.webrtcd import CerealIncomingMessageProxy, CerealOutgoingMessageProxy, CerealProxyRunner, DynamicPubMaster + + +def _default_route_ip() -> str | None: + """Use the interface the kernel will actually use for Internet/relay media.""" + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + try: + sock.connect(("8.8.8.8", 53)) + return sock.getsockname()[0] + except OSError: + return None + finally: + sock.close() + + +class LibdatachannelBitrateController: + """Loss-driven bitrate control using native RTCP receiver reports.""" + + bitrates = [500_000, 1_500_000, int(os.environ.get("STREAM_BITRATE", 5_000_000))] + label_to_bitrate = {"low": bitrates[0], "med": bitrates[1], "high": bitrates[2]} + sample_interval = 0.2 + high_loss = 0.10 + sustained_loss = 0.05 + down_samples = 5 + + def __init__(self, get_stats, enabled: bool = True): + self._get_stats = get_stats + self._enabled = enabled + self._auto = True + self._level = 1 + self._counter = 0 + self._up_samples = 5 + self._previous: tuple[Any, ...] | None = None + self._task: asyncio.Task | None = None + self.current_bitrate = self.bitrates[self._level] + self._publish(self.current_bitrate) + + def start(self) -> None: + if self._task is None: + self._task = asyncio.create_task(self.run()) + + def stop(self) -> None: + if self._task is not None: + self._task.cancel() + self._task = None + + def enable(self, enabled: bool) -> None: + self._enabled = enabled + + def set_quality(self, quality: str) -> None: + if quality in self.label_to_bitrate: + self._auto = False + self._publish(self.label_to_bitrate[quality]) + elif quality == "auto": + self._auto = True + + def _publish(self, bitrate: int) -> None: + self.current_bitrate = int(bitrate) + Params().put("LivestreamEncoderBitrate", self.current_bitrate) + + def _sample_loss(self) -> float | None: + report = next(iter(self._get_stats().values()), None) + if report is None: + return None + current = (report.ssrc, report.fraction_lost, report.packets_lost, report.highest_seq_no, report.jitter, report.lsr, report.dlsr) + if current == self._previous: + return None + self._previous = current + return report.fraction_lost / 256.0 + + async def run(self) -> None: + while True: + await asyncio.sleep(self.sample_interval) + if not self._enabled or not self._auto: + continue + loss = self._sample_loss() + if loss is None: + continue + if loss >= self.sustained_loss and self._level > 0: + self._counter += 1 + if loss >= self.high_loss or self._counter >= self.down_samples: + self._level -= 1 + self._up_samples *= 2 + self._counter = 0 + self._publish(self.bitrates[self._level]) + elif loss <= 0 and self._level < len(self.bitrates) - 1: + self._counter -= 1 + if -self._counter >= self._up_samples: + self._level += 1 + self._counter = 0 + self._publish(self.bitrates[self._level]) + + +class StreamSessionLibdatachannel: + """IQ.Pilot's libdatachannel stream path. It preserves Konn3kt signalling and controls.""" + + shared_pub_master = DynamicPubMaster([]) + + def __init__(self, sdp: str, cameras: list[str], incoming_services: list[str], outgoing_services: list[str], + ice_servers: list[dict[str, Any]] | None = None, debug_mode: bool = False, ui_stream: bool = False): + from openpilot.system.webrtc.device.video_ldc import LiveStreamVideoStreamTrack + from openpilot.system.webrtc.teleoprtc_ldc.builder import WebRTCAnswerBuilder + from openpilot.system.webrtc.teleoprtc_ldc.info import parse_info_from_offer + + config = parse_info_from_offer(sdp) + if len(cameras) != config.n_expected_camera_tracks: + raise ValueError("Incoming stream has misconfigured number of video tracks") + if debug_mode: + raise ValueError("libdatachannel debug tracks are not supported") + + builder = WebRTCAnswerBuilder(sdp, bind_address=_default_route_ip(), ice_servers=ice_servers or []) + self.video_tracks = [LiveStreamVideoStreamTrack(camera) for camera in cameras] + for camera, track in zip(cameras, self.video_tracks, strict=True): + builder.add_video_stream(camera, track) + + # The browser uses a single sendrecv audio m-line. libdatachannel's Python binding + # currently cannot negotiate that bidirectional track reliably, so this experimental + # transport deliberately remains video/control-only. The default aiortc path keeps + # both audio directions until the native duplex path passes the same integration test. + self.audio_output = None + self.stream = builder.stream() + + self.identifier = str(uuid.uuid4()) + self.incoming_bridge_services = incoming_services + self.incoming_bridge = CerealIncomingMessageProxy(self.shared_pub_master) if incoming_services else None + self.outgoing_bridge = CerealOutgoingMessageProxy(messaging.SubMaster(outgoing_services)) if outgoing_services else None + self.outgoing_bridge_runner = CerealProxyRunner(self.outgoing_bridge) if self.outgoing_bridge is not None else None + self.ui_stream_requested = ui_stream + self.ui_stream_runner: CerealProxyRunner | None = None + self.audio_input_proxy = None + self.audio_recv_requested = False + self.bitrate_controller = LibdatachannelBitrateController(self.stream.get_receiver_report_stats) + self.run_task: asyncio.Task | None = None + self._cleanup_lock = asyncio.Lock() + self._cleanup_done = False + self.logger = logging.getLogger("webrtcd") + + def start(self) -> None: + self.run_task = asyncio.create_task(self.run()) + + async def get_answer(self): + return await self.stream.start() + + async def stop_async(self) -> None: + if self.run_task is not None and not self.run_task.done() and self.run_task is not asyncio.current_task(): + self.run_task.cancel() + with contextlib.suppress(asyncio.CancelledError): + await self.run_task + self.run_task = None + await self.post_run_cleanup() + + def add_ice_candidate(self, candidate: Any) -> None: + self.stream.add_ice_candidate(candidate) + + def message_handler(self, message: bytes | str) -> None: + try: + payload = json.loads(message) + except (TypeError, ValueError): + return + if not isinstance(payload, dict): + return + message_type = payload.get("type") + if message_type == "timingSei": + for track in self.video_tracks: + track.timing_sei_enabled = bool(payload.get("enabled", False)) + elif message_type == "setQuality": + self.bitrate_controller.set_quality(str(payload.get("quality", "auto"))) + elif message_type == "setAudioEnabled" and self.audio_output is not None: + self.audio_output.enable(bool(payload.get("enabled", True))) + elif message_type == "switchCamera": + for track in self.video_tracks: + track.switch_camera(str(payload.get("camera", ""))) + elif message_type == "setUiStream": + self.set_ui_stream(bool(payload.get("enabled", False))) + elif self.incoming_bridge is not None: + try: + self.incoming_bridge.send(message) + except Exception: + self.logger.exception("Cereal incoming proxy failure") + + def set_ui_stream(self, enabled: bool) -> None: + if enabled: + if self.ui_stream_runner is not None or not self.stream.has_messaging_channel(): + return + from openpilot.system.webrtc.ui_stream import UIStreamMessageProxy + proxy = UIStreamMessageProxy(bitrate_getter=lambda: self.bitrate_controller.current_bitrate) + proxy.add_channel(self.stream.get_messaging_channel()) + self.ui_stream_runner = CerealProxyRunner(proxy) + self.ui_stream_runner.start() + elif self.ui_stream_runner is not None: + self.ui_stream_runner.stop() + self.ui_stream_runner = None + + async def run(self) -> None: + try: + await self.stream.wait_for_connection() + if self.stream.has_messaging_channel(): + self.stream.set_message_handler(self.message_handler) + if self.incoming_bridge is not None: + await self.shared_pub_master.add_services_if_needed(self.incoming_bridge_services) + if self.outgoing_bridge_runner is not None: + self.outgoing_bridge_runner.proxy.add_channel(self.stream.get_messaging_channel()) + self.outgoing_bridge_runner.start() + if self.ui_stream_requested: + self.set_ui_stream(True) + if self.audio_recv_requested and self.stream.has_incoming_audio_track(): + from openpilot.system.webrtc.device.audio_ldc import IncomingOpusCerealProxy + self.audio_input_proxy = IncomingOpusCerealProxy(self.stream.get_incoming_audio_track()) + self.audio_input_proxy.start() + self.bitrate_controller.start() + await self.stream.wait_for_disconnection() + except Exception: + self.logger.exception("libdatachannel stream session failure") + finally: + await self.post_run_cleanup() + + async def post_run_cleanup(self) -> None: + async with self._cleanup_lock: + if self._cleanup_done: + return + self._cleanup_done = True + self.bitrate_controller.stop() + if self.ui_stream_runner is not None: + self.ui_stream_runner.stop() + self.ui_stream_runner = None + if self.outgoing_bridge_runner is not None: + self.outgoing_bridge_runner.stop() + if self.audio_input_proxy is not None: + await self.audio_input_proxy.stop() + for track in self.video_tracks: + track.stop() + await self.stream.stop() diff --git a/tools/cabana/README.md b/tools/cabana/README.md index 7933098..2be92f4 100644 --- a/tools/cabana/README.md +++ b/tools/cabana/README.md @@ -1,6 +1,6 @@ # Cabana -Cabana is a tool developed to view raw CAN data. One use for this is creating and editing [CAN Dictionaries](http://socialledge.com/sjsu/index.php/DBC_Format) (DBC files), and the tool provides direct integration with [commaai/opendbc](https://github.com/commaai/opendbc) (a collection of DBC files), allowing you to load the DBC files direct from source, and save to your fork. In addition, you can load routes from [comma connect](https://connect.comma.ai). +Cabana is a tool developed to view raw CAN data. One use for this is creating and editing [CAN Dictionaries](http://socialledge.com/sjsu/index.php/DBC_Format) (DBC files), and the tool provides direct integration with [commaai/iqdbc](https://github.com/commaai/iqdbc) (a collection of DBC files), allowing you to load the DBC files direct from source, and save to your fork. In addition, you can load routes from [comma connect](https://connect.comma.ai). ## Usage Instructions diff --git a/tools/cabana/SConscript b/tools/cabana/SConscript index 7b58c77..5976f35 100644 --- a/tools/cabana/SConscript +++ b/tools/cabana/SConscript @@ -70,8 +70,8 @@ qt_libs = base_libs cabana_env = qt_env.Clone() cabana_libs = [cereal, messaging, visionipc, replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'zstd', 'curl', 'yuv', 'usb-1.0'] + qt_libs -opendbc_path = '-DOPENDBC_FILE_PATH=\'"%s"\'' % (cabana_env.Dir("../../opendbc/dbc").abspath) -cabana_env['CXXFLAGS'] += [opendbc_path] +iqdbc_path = '-DOPENDBC_FILE_PATH=\'"%s"\'' % (cabana_env.Dir("../../iqdbc/dbc").abspath) +cabana_env['CXXFLAGS'] += [iqdbc_path] # build assets assets = "assets/assets.cc" @@ -95,4 +95,4 @@ generate_dbc = cabana_env.Command('#' + output_json_file, ['dbc/generate_dbc_json.py'], cabana_env.PrettyAction("python3 tools/cabana/dbc/generate_dbc_json.py --out " + output_json_file, 'GEN', logfile='${TARGET}.log')) -cabana_env.Depends(generate_dbc, ["#common", '#opendbc_repo', "#cereal", "#msgq_repo"]) +cabana_env.Depends(generate_dbc, ["#common", '#iqdbc_repo', "#cereal", "#msgq_repo"]) diff --git a/tools/cabana/dbc/generate_dbc_json.py b/tools/cabana/dbc/generate_dbc_json.py index d002a50..68ab566 100755 --- a/tools/cabana/dbc/generate_dbc_json.py +++ b/tools/cabana/dbc/generate_dbc_json.py @@ -2,9 +2,9 @@ import argparse import json -from opendbc.car import Bus -from opendbc.car.fingerprints import MIGRATION -from opendbc.car.values import PLATFORMS +from iqdbc.car import Bus +from iqdbc.car.fingerprints import MIGRATION +from iqdbc.car.values import PLATFORMS def generate_dbc_dict() -> dict[str, str]: diff --git a/tools/cabana/mainwin.cc b/tools/cabana/mainwin.cc index 1ea3733..7d96dbc 100644 --- a/tools/cabana/mainwin.cc +++ b/tools/cabana/mainwin.cc @@ -98,10 +98,10 @@ void MainWindow::createActions() { QObject::connect(open_recent_menu, &QMenu::aboutToShow, this, &MainWindow::updateRecentFileMenu); file_menu->addSeparator(); - QMenu *load_opendbc_menu = file_menu->addMenu(tr("Load DBC from commaai/opendbc")); - // load_opendbc_menu->setStyleSheet("QMenu { menu-scrollable: true; }"); + QMenu *load_iqdbc_menu = file_menu->addMenu(tr("Load DBC from commaai/iqdbc")); + // load_iqdbc_menu->setStyleSheet("QMenu { menu-scrollable: true; }"); for (const auto &dbc_name : QDir(OPENDBC_FILE_PATH).entryList({"*.dbc"}, QDir::Files, QDir::Name)) { - load_opendbc_menu->addAction(dbc_name, [this, name = dbc_name]() { loadDBCFromOpendbc(name); }); + load_iqdbc_menu->addAction(dbc_name, [this, name = dbc_name]() { loadDBCFromOpendbc(name); }); } file_menu->addAction(tr("Load DBC From Clipboard"), [=]() { loadFromClipboard(); }); diff --git a/tools/cabana/tests/test_cabana.cc b/tools/cabana/tests/test_cabana.cc index d9fcae6..48a250b 100644 --- a/tools/cabana/tests/test_cabana.cc +++ b/tools/cabana/tests/test_cabana.cc @@ -142,7 +142,7 @@ CM_ SG_ 162 signal_1 "signal comment with \"escaped quotes\""; REQUIRE(msg->sigs[0]->comment == "signal comment with \"escaped quotes\""); } -TEST_CASE("parse_opendbc") { +TEST_CASE("parse_iqdbc") { QDir dir(OPENDBC_FILE_PATH); QStringList errors; for (auto fn : dir.entryList({"*.dbc"}, QDir::Files, QDir::Name)) { diff --git a/tools/car_porting/auto_fingerprint.py b/tools/car_porting/auto_fingerprint.py index abae8d9..738b4f4 100755 --- a/tools/car_porting/auto_fingerprint.py +++ b/tools/car_porting/auto_fingerprint.py @@ -2,10 +2,10 @@ import argparse from collections import defaultdict -from opendbc.car.debug.format_fingerprints import format_brand_fw_versions +from iqdbc.car.debug.format_fingerprints import format_brand_fw_versions -from opendbc.car.fingerprints import MIGRATION -from opendbc.car.fw_versions import MODEL_TO_BRAND, match_fw_to_car +from iqdbc.car.fingerprints import MIGRATION +from iqdbc.car.fw_versions import MODEL_TO_BRAND, match_fw_to_car from openpilot.tools.lib.logreader import LogReader, ReadMode if __name__ == "__main__": diff --git a/tools/car_porting/examples/find_segments_with_message.ipynb b/tools/car_porting/examples/find_segments_with_message.ipynb index af17bde..f303ddd 100644 --- a/tools/car_porting/examples/find_segments_with_message.ipynb +++ b/tools/car_porting/examples/find_segments_with_message.ipynb @@ -7,10 +7,10 @@ "metadata": {}, "outputs": [], "source": [ - "# Import all cars from opendbc\n", + "# Import all cars from iqdbc\n", "\n", - "from opendbc.car import structs\n", - "from opendbc.car.values import PLATFORMS as TEST_PLATFORMS\n", + "from iqdbc.car import structs\n", + "from iqdbc.car.values import PLATFORMS as TEST_PLATFORMS\n", "\n", "# Example: add additional platforms/segments to test outside of commaCarSegments\n", "\n", diff --git a/tools/car_porting/examples/ford_vin_fingerprint.ipynb b/tools/car_porting/examples/ford_vin_fingerprint.ipynb index 6b806d2..7ad4215 100644 --- a/tools/car_porting/examples/ford_vin_fingerprint.ipynb +++ b/tools/car_porting/examples/ford_vin_fingerprint.ipynb @@ -13,7 +13,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Got 9 Ford cars from opendbc\n" + "Got 9 Ford cars from iqdbc\n" ] } ], @@ -22,12 +22,12 @@ "\n", "from openpilot.tools.lib.logreader import LogReader, comma_car_segments_source\n", "from openpilot.tools.lib.comma_car_segments import get_comma_car_segments_database\n", - "from opendbc.car.ford.values import CAR\n", + "from iqdbc.car.ford.values import CAR\n", "\n", "database = get_comma_car_segments_database()\n", "\n", "platforms = [c.value for c in CAR]\n", - "print(f\"Got {len(platforms)} Ford cars from opendbc\")" + "print(f\"Got {len(platforms)} Ford cars from iqdbc\")" ] }, { diff --git a/tools/car_porting/examples/hkg_canfd_gear_message.ipynb b/tools/car_porting/examples/hkg_canfd_gear_message.ipynb index f0bca8d..1035323 100644 --- a/tools/car_porting/examples/hkg_canfd_gear_message.ipynb +++ b/tools/car_porting/examples/hkg_canfd_gear_message.ipynb @@ -21,9 +21,9 @@ } ], "source": [ - "from opendbc.car import structs\n", - "from opendbc.car.hyundai.values import CAR, HyundaiFlags\n", - "from opendbc.car.hyundai.fingerprints import FW_VERSIONS\n", + "from iqdbc.car import structs\n", + "from iqdbc.car.hyundai.values import CAR, HyundaiFlags\n", + "from iqdbc.car.hyundai.fingerprints import FW_VERSIONS\n", "\n", "TEST_PLATFORMS = set(CAR.with_flags(HyundaiFlags.CANFD)) & set(CAR.with_flags(HyundaiFlags.EV)) # CAN-FD electric vehicles only\n", "#TEST_PLATFORMS = set(CAR.with_flags(HyundaiFlags.CANFD)) - set(CAR.with_flags(HyundaiFlags.EV)) # CAN-FD hybrid and ICE vehicles only\n", @@ -59,7 +59,7 @@ "\n", "from openpilot.tools.lib.logreader import LogReader\n", "from openpilot.tools.lib.comma_car_segments import get_comma_car_segments_database\n", - "from opendbc.car.hyundai.values import CAR\n", + "from iqdbc.car.hyundai.values import CAR\n", "\n", "database = get_comma_car_segments_database()\n", "TEST_SEGMENTS = []\n", @@ -193,9 +193,9 @@ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", - "from opendbc.can.parser import CANParser\n", - "from opendbc.car.hyundai.values import DBC\n", - "from opendbc.car.hyundai.hyundaicanfd import CanBus\n", + "from iqdbc.can.parser import CANParser\n", + "from iqdbc.car.hyundai.values import DBC\n", + "from iqdbc.car.hyundai.hyundaicanfd import CanBus\n", "\n", "from openpilot.selfdrive.pandad import can_capnp_to_list\n", "from openpilot.tools.lib.logreader import LogReader, comma_car_segments_source\n", diff --git a/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb b/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb index 708e558..d1fbd2b 100644 --- a/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb +++ b/tools/car_porting/examples/subaru_fuzzy_fingerprint.ipynb @@ -6,9 +6,9 @@ "metadata": {}, "outputs": [], "source": [ - "from opendbc.car import structs\n", - "from opendbc.car.subaru.values import CAR, SubaruFlags\n", - "from opendbc.car.subaru.fingerprints import FW_VERSIONS\n", + "from iqdbc.car import structs\n", + "from iqdbc.car.subaru.values import CAR, SubaruFlags\n", + "from iqdbc.car.subaru.fingerprints import FW_VERSIONS\n", "\n", "TEST_PLATFORMS = set(CAR) - CAR.with_flags(SubaruFlags.PREGLOBAL)\n", "\n", diff --git a/tools/car_porting/examples/subaru_long_accel.ipynb b/tools/car_porting/examples/subaru_long_accel.ipynb index d4a4705..f818dad 100644 --- a/tools/car_porting/examples/subaru_long_accel.ipynb +++ b/tools/car_porting/examples/subaru_long_accel.ipynb @@ -21,8 +21,8 @@ "import copy\n", "import numpy as np\n", "\n", - "from opendbc.can.parser import CANParser\n", - "from opendbc.car.subaru.values import DBC\n", + "from iqdbc.can.parser import CANParser\n", + "from iqdbc.car.subaru.values import DBC\n", "\n", "from openpilot.selfdrive.pandad import can_capnp_to_list\n", "from openpilot.tools.lib.logreader import LogReader\n", diff --git a/tools/car_porting/examples/subaru_steer_temp_fault.ipynb b/tools/car_porting/examples/subaru_steer_temp_fault.ipynb index 10abe8e..d608e4c 100644 --- a/tools/car_porting/examples/subaru_steer_temp_fault.ipynb +++ b/tools/car_porting/examples/subaru_steer_temp_fault.ipynb @@ -24,8 +24,8 @@ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", - "from opendbc.can.parser import CANParser\n", - "from opendbc.car.subaru.values import CanBus, DBC\n", + "from iqdbc.can.parser import CANParser\n", + "from iqdbc.car.subaru.values import CanBus, DBC\n", "\n", "from openpilot.selfdrive.pandad import can_capnp_to_list\n", "from openpilot.tools.lib.logreader import LogReader\n", diff --git a/tools/car_porting/test_car_model.py b/tools/car_porting/test_car_model.py index dd248f5..3260d1a 100755 --- a/tools/car_porting/test_car_model.py +++ b/tools/car_porting/test_car_model.py @@ -3,7 +3,7 @@ import argparse import sys import unittest # noqa: TID251 -from opendbc.car.tests.routes import CarTestRoute +from iqdbc.car.tests.routes import CarTestRoute from openpilot.selfdrive.car.tests.test_models import TestCarModel from openpilot.tools.lib.route import SegmentRange diff --git a/tools/jotpluggler/SConscript b/tools/jotpluggler/SConscript index 829a8c9..06d5e11 100644 --- a/tools/jotpluggler/SConscript +++ b/tools/jotpluggler/SConscript @@ -8,13 +8,13 @@ if os.path.isdir(venv_site_packages) and venv_site_packages not in sys.path: import imgui import libusb -# IQ.Pilot patch: iqpilot's opendbc fork lacks the upstream `get_generated_dbcs()` +# IQ.Pilot patch: iqpilot's iqdbc fork lacks the upstream `get_generated_dbcs()` # helper. Use the equivalent `create_all(out_dir)` which writes *_generated.dbc # files directly to disk. -from opendbc.dbc.generator.generator import create_all as _opendbc_create_all -from opendbc.car import Bus -from opendbc.car.fingerprints import MIGRATION -from opendbc.car.values import PLATFORMS +from iqdbc.dbc.generator.generator import create_all as _iqdbc_create_all +from iqdbc.car import Bus +from iqdbc.car.fingerprints import MIGRATION +from iqdbc.car.values import PLATFORMS from openpilot.common.basedir import BASEDIR Import('env', 'arch', 'common', 'messaging', 'visionipc', 'cereal', 'replay_lib') @@ -32,10 +32,10 @@ def materialize_generated_dbcs(target, source, env): out_dir = os.path.dirname(str(target[0])) os.makedirs(out_dir, exist_ok=True) - # IQ.Pilot patch: opendbc's create_all writes *_generated.dbc files directly + # IQ.Pilot patch: iqdbc's create_all writes *_generated.dbc files directly # to out_dir (and clears any stale ones first), matching what upstream's # get_generated_dbcs()-based loop produced. - _opendbc_create_all(out_dir) + _iqdbc_create_all(out_dir) with open(str(target[0]), "w") as f: f.write("ok\n") diff --git a/tools/jotpluggler/layout.cc b/tools/jotpluggler/layout.cc index 0d3b82c..fb4df6a 100644 --- a/tools/jotpluggler/layout.cc +++ b/tools/jotpluggler/layout.cc @@ -276,7 +276,7 @@ std::string default_dbc_template() { DbcEditorSource resolve_dbc_editor_source(const std::string &dbc_name) { const fs::path generated_dbc_dir = repo_root() / "tools" / "jotpluggler" / "generated_dbcs"; const std::array candidates = {{ - {.path = repo_root() / "opendbc" / "dbc" / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Opendbc}, + {.path = repo_root() / "iqdbc" / "dbc" / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Opendbc}, {.path = generated_dbc_dir / (dbc_name + ".dbc"), .kind = DbcEditorState::SourceKind::Generated}, }}; for (const DbcEditorSource &candidate : candidates) { @@ -328,7 +328,7 @@ bool save_dbc_editor_contents(AppSession *session, UiState *state) { return false; } if (editor.source_kind == DbcEditorState::SourceKind::Opendbc && editor.save_name == editor.source_name) { - state->error_text = "Save edited opendbc files under a new name"; + state->error_text = "Save edited iqdbc files under a new name"; state->open_error_popup = true; return false; } diff --git a/tools/jotpluggler/layouts/torque-controller.json b/tools/jotpluggler/layouts/torque-controller.json index 7e269e5..fe20c8f 100644 --- a/tools/jotpluggler/layouts/torque-controller.json +++ b/tools/jotpluggler/layouts/torque-controller.json @@ -1 +1 @@ -{"current_tab_index":0,"tabs":[{"name":"Lateral Plan Conformance","root":{"split":"vertical","sizes":[0.250949,0.249051,0.250949,0.249051],"children":[{"title":"desired vs actual lateral acceleration (closer means better conformance to plan)","range":{"left":0.000194,"right":1138.891674,"top":1.858161,"bottom":-1.823407},"curves":[{"name":"/controlsState/lateralControlState/torqueState/actualLateralAccel","color":"#1f77b4"},{"name":"/controlsState/lateralControlState/torqueState/desiredLateralAccel","color":"#d62728"}]},{"title":"desired vs actual lateral acceleration, road-roll factored out (closer means better conformance to plan)","range":{"left":0.000194,"right":1138.891674,"top":2.749816,"bottom":-3.723091},"curves":[{"name":"Actual lateral accel (roll compensated)","color":"#1ac938","custom_python":{"linked_source":"/controlsState/curvature","additional_sources":["/carState/vEgo","/liveParameters/roll"],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value, v1, v2):\n return (value * v1 ** 2) - (v2 * 9.81)\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i], v1[__jotpluggler_i], v2[__jotpluggler_i])\nreturn __jotpluggler_result"}},{"name":"Desired lateral accel (roll compensated)","color":"#ff7f0e","custom_python":{"linked_source":"/controlsState/desiredCurvature","additional_sources":["/carState/vEgo","/liveParameters/roll"],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value, v1, v2):\n return (value * v1 ** 2) - (v2 * 9.81)\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i], v1[__jotpluggler_i], v2[__jotpluggler_i])\nreturn __jotpluggler_result"}}]},{"title":"controller feed-forward vs actuator output (closer means controller prediction is more accurate)","range":{"left":0.000194,"right":1138.891674,"top":1.978032,"bottom":-1.570956},"curves":[{"name":"/carOutput/actuatorsOutput/torque","color":"#9467bd","transform":"scale","scale":-1.0,"offset":0.0},{"name":"/controlsState/lateralControlState/torqueState/f","color":"#1f77b4"},{"name":"/carState/steeringPressed","color":"#ff000f"}]},{"title":"vehicle speed","range":{"left":0.000194,"right":1138.891674,"top":105.981304,"bottom":-2.709314},"curves":[{"name":"carState.vEgo mph","color":"#d62728","custom_python":{"linked_source":"/carState/vEgo","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return value * 2.23694\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}},{"name":"carState.vEgo kmh","color":"#1ac938","custom_python":{"linked_source":"/carState/vEgo","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return value * 3.6\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}},{"name":"/carState/vEgo","color":"#ff7f0e"}]}]}},{"name":"Vehicle Dynamics","root":{"split":"vertical","sizes":[0.334282,0.331437,0.334282],"children":[{"title":"configured-initial vs online-learned steerRatio, set configured value to match learned","range":{"left":0.0,"right":1138.816328,"top":19.665784,"bottom":19.359553},"curves":[{"name":"/carParams/steerRatio","color":"#1f77b4"},{"name":"/liveParameters/steerRatio","color":"#1ac938"}]},{"title":"configured-initial vs online-learned tireStiffnessRatio, set configured value to match learned","range":{"left":0.0,"right":1138.816328,"top":1.11221,"bottom":0.995631},"curves":[{"name":"/carParams/tireStiffnessFactor","color":"#d62728"},{"name":"/liveParameters/stiffnessFactor","color":"#ff7f0e"}]},{"title":"live steering angle offsets for straight-ahead driving, large values here may indicate alignment problems","range":{"left":0.0,"right":1138.816328,"top":-1.081041,"bottom":-4.494133},"curves":[{"name":"/liveParameters/angleOffsetAverageDeg","color":"#f14cc1"},{"name":"/liveParameters/angleOffsetDeg","color":"#9467bd"}]}]}},{"name":"Actuator Performance","root":{"split":"vertical","sizes":[0.333333,0.333333,0.333333],"children":[{"title":"offline-calculated vs online-learned lateral accel scaling factor, accel obtained from 100% actuator output","range":{"left":0.0,"right":1138.920072,"top":1.21611,"bottom":0.539474},"curves":[{"name":"/liveTorqueParameters/latAccelFactorFiltered","color":"#1f77b4"},{"name":"/liveTorqueParameters/latAccelFactorRaw","color":"#d62728"},{"name":"/carParams/lateralTuning/torque/latAccelFactor","color":"#1c9222"}]},{"title":"learned lateral accel offset, vehicle-specific compensation to obtain true zero lateral accel","range":{"left":0.0,"right":1138.920072,"top":-0.304367,"bottom":-0.418688},"curves":[{"name":"/liveTorqueParameters/latAccelOffsetFiltered","color":"#1ac938"},{"name":"/liveTorqueParameters/latAccelOffsetRaw","color":"#ff7f0e"}]},{"title":"offline-calculated vs online-learned EPS friction factor, necessary to start moving the steering wheel","range":{"left":0.0,"right":1138.920072,"top":0.226389,"bottom":0.15805},"curves":[{"name":"/liveTorqueParameters/frictionCoefficientFiltered","color":"#f14cc1"},{"name":"/liveTorqueParameters/frictionCoefficientRaw","color":"#9467bd"},{"name":"/carParams/lateralTuning/torque/friction","color":"#1c9222"}]}]}},{"name":"Actuator Delay","root":{"split":"vertical","sizes":[0.30441,0.358464,0.337127],"children":[{"title":"actuator lag learning state, 0 = learning, 1 = learned/applying, 2 = invalid","range":{"left":0.0,"right":1138.749979,"top":1.025,"bottom":-0.025},"curves":[{"name":"/liveDelay/status","color":"#ff7f0e"}]},{"title":"offline default vs online estimated steering actuator lag","range":{"left":0.0,"right":1138.749979,"top":0.419648,"bottom":0.318362},"curves":[{"name":"/liveDelay/lateralDelay","color":"#1f77b4"},{"name":"/liveDelay/lateralDelayEstimate","color":"#d62728"},{"name":"opendbc default steering lag","color":"#1ac938","custom_python":{"linked_source":"/carParams/steerActuatorDelay","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return value + 0.2\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}}]},{"title":"online estimated steering actuator lag, standard deviation","range":{"left":0.0,"right":1138.749979,"top":0.06732,"bottom":-0.001642},"curves":[{"name":"/liveDelay/lateralDelayEstimateStd","color":"#f14cc1"}]}]}},{"name":"Controls Performance","root":{"split":"vertical","sizes":[0.265655,0.251898,0.245731,0.236717],"children":[{"title":"rate-of-change limits on steering actuator (blue = original, green = rate-limited before CAN output)","range":{"left":0.000194,"right":1138.891921,"top":1.05,"bottom":-1.05},"curves":[{"name":"/carControl/actuators/torque","color":"#0c00f2"},{"name":"/carOutput/actuatorsOutput/torque","color":"#2cd63a"}]},{"title":"controller feed-forward vs actuator output (closer means controller prediction is more accurate)","range":{"left":0.000194,"right":1138.891921,"top":1.978032,"bottom":-1.570956},"curves":[{"name":"/carOutput/actuatorsOutput/torque","color":"#9467bd","transform":"scale","scale":-1.0,"offset":0.0},{"name":"/controlsState/lateralControlState/torqueState/f","color":"#1f77b4"},{"name":"/carState/steeringPressed","color":"#ff000f"}]},{"title":"proportional, integral, and feed-forward terms (actuator output = sum of PIF terms)","range":{"left":0.000194,"right":1138.891921,"top":2.099784,"bottom":-4.027542},"curves":[{"name":"/controlsState/lateralControlState/torqueState/f","color":"#0ab027"},{"name":"/controlsState/lateralControlState/torqueState/p","color":"#d62728"},{"name":"/controlsState/lateralControlState/torqueState/i","color":"#ffaf00"},{"name":"Zero","color":"#756a6a","custom_python":{"linked_source":"/carState/canValid","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return (0)\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}}]},{"title":"road roll angle, from openpilot localizer","range":{"left":0.000194,"right":1138.891921,"top":0.109446,"bottom":-0.045525},"curves":[{"name":"/liveParameters/roll","color":"#f14cc1"}]}]}}]} +{"current_tab_index":0,"tabs":[{"name":"Lateral Plan Conformance","root":{"split":"vertical","sizes":[0.250949,0.249051,0.250949,0.249051],"children":[{"title":"desired vs actual lateral acceleration (closer means better conformance to plan)","range":{"left":0.000194,"right":1138.891674,"top":1.858161,"bottom":-1.823407},"curves":[{"name":"/controlsState/lateralControlState/torqueState/actualLateralAccel","color":"#1f77b4"},{"name":"/controlsState/lateralControlState/torqueState/desiredLateralAccel","color":"#d62728"}]},{"title":"desired vs actual lateral acceleration, road-roll factored out (closer means better conformance to plan)","range":{"left":0.000194,"right":1138.891674,"top":2.749816,"bottom":-3.723091},"curves":[{"name":"Actual lateral accel (roll compensated)","color":"#1ac938","custom_python":{"linked_source":"/controlsState/curvature","additional_sources":["/carState/vEgo","/liveParameters/roll"],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value, v1, v2):\n return (value * v1 ** 2) - (v2 * 9.81)\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i], v1[__jotpluggler_i], v2[__jotpluggler_i])\nreturn __jotpluggler_result"}},{"name":"Desired lateral accel (roll compensated)","color":"#ff7f0e","custom_python":{"linked_source":"/controlsState/desiredCurvature","additional_sources":["/carState/vEgo","/liveParameters/roll"],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value, v1, v2):\n return (value * v1 ** 2) - (v2 * 9.81)\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i], v1[__jotpluggler_i], v2[__jotpluggler_i])\nreturn __jotpluggler_result"}}]},{"title":"controller feed-forward vs actuator output (closer means controller prediction is more accurate)","range":{"left":0.000194,"right":1138.891674,"top":1.978032,"bottom":-1.570956},"curves":[{"name":"/carOutput/actuatorsOutput/torque","color":"#9467bd","transform":"scale","scale":-1.0,"offset":0.0},{"name":"/controlsState/lateralControlState/torqueState/f","color":"#1f77b4"},{"name":"/carState/steeringPressed","color":"#ff000f"}]},{"title":"vehicle speed","range":{"left":0.000194,"right":1138.891674,"top":105.981304,"bottom":-2.709314},"curves":[{"name":"carState.vEgo mph","color":"#d62728","custom_python":{"linked_source":"/carState/vEgo","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return value * 2.23694\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}},{"name":"carState.vEgo kmh","color":"#1ac938","custom_python":{"linked_source":"/carState/vEgo","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return value * 3.6\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}},{"name":"/carState/vEgo","color":"#ff7f0e"}]}]}},{"name":"Vehicle Dynamics","root":{"split":"vertical","sizes":[0.334282,0.331437,0.334282],"children":[{"title":"configured-initial vs online-learned steerRatio, set configured value to match learned","range":{"left":0.0,"right":1138.816328,"top":19.665784,"bottom":19.359553},"curves":[{"name":"/carParams/steerRatio","color":"#1f77b4"},{"name":"/liveParameters/steerRatio","color":"#1ac938"}]},{"title":"configured-initial vs online-learned tireStiffnessRatio, set configured value to match learned","range":{"left":0.0,"right":1138.816328,"top":1.11221,"bottom":0.995631},"curves":[{"name":"/carParams/tireStiffnessFactor","color":"#d62728"},{"name":"/liveParameters/stiffnessFactor","color":"#ff7f0e"}]},{"title":"live steering angle offsets for straight-ahead driving, large values here may indicate alignment problems","range":{"left":0.0,"right":1138.816328,"top":-1.081041,"bottom":-4.494133},"curves":[{"name":"/liveParameters/angleOffsetAverageDeg","color":"#f14cc1"},{"name":"/liveParameters/angleOffsetDeg","color":"#9467bd"}]}]}},{"name":"Actuator Performance","root":{"split":"vertical","sizes":[0.333333,0.333333,0.333333],"children":[{"title":"offline-calculated vs online-learned lateral accel scaling factor, accel obtained from 100% actuator output","range":{"left":0.0,"right":1138.920072,"top":1.21611,"bottom":0.539474},"curves":[{"name":"/liveTorqueParameters/latAccelFactorFiltered","color":"#1f77b4"},{"name":"/liveTorqueParameters/latAccelFactorRaw","color":"#d62728"},{"name":"/carParams/lateralTuning/torque/latAccelFactor","color":"#1c9222"}]},{"title":"learned lateral accel offset, vehicle-specific compensation to obtain true zero lateral accel","range":{"left":0.0,"right":1138.920072,"top":-0.304367,"bottom":-0.418688},"curves":[{"name":"/liveTorqueParameters/latAccelOffsetFiltered","color":"#1ac938"},{"name":"/liveTorqueParameters/latAccelOffsetRaw","color":"#ff7f0e"}]},{"title":"offline-calculated vs online-learned EPS friction factor, necessary to start moving the steering wheel","range":{"left":0.0,"right":1138.920072,"top":0.226389,"bottom":0.15805},"curves":[{"name":"/liveTorqueParameters/frictionCoefficientFiltered","color":"#f14cc1"},{"name":"/liveTorqueParameters/frictionCoefficientRaw","color":"#9467bd"},{"name":"/carParams/lateralTuning/torque/friction","color":"#1c9222"}]}]}},{"name":"Actuator Delay","root":{"split":"vertical","sizes":[0.30441,0.358464,0.337127],"children":[{"title":"actuator lag learning state, 0 = learning, 1 = learned/applying, 2 = invalid","range":{"left":0.0,"right":1138.749979,"top":1.025,"bottom":-0.025},"curves":[{"name":"/liveDelay/status","color":"#ff7f0e"}]},{"title":"offline default vs online estimated steering actuator lag","range":{"left":0.0,"right":1138.749979,"top":0.419648,"bottom":0.318362},"curves":[{"name":"/liveDelay/lateralDelay","color":"#1f77b4"},{"name":"/liveDelay/lateralDelayEstimate","color":"#d62728"},{"name":"iqdbc default steering lag","color":"#1ac938","custom_python":{"linked_source":"/carParams/steerActuatorDelay","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return value + 0.2\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}}]},{"title":"online estimated steering actuator lag, standard deviation","range":{"left":0.0,"right":1138.749979,"top":0.06732,"bottom":-0.001642},"curves":[{"name":"/liveDelay/lateralDelayEstimateStd","color":"#f14cc1"}]}]}},{"name":"Controls Performance","root":{"split":"vertical","sizes":[0.265655,0.251898,0.245731,0.236717],"children":[{"title":"rate-of-change limits on steering actuator (blue = original, green = rate-limited before CAN output)","range":{"left":0.000194,"right":1138.891921,"top":1.05,"bottom":-1.05},"curves":[{"name":"/carControl/actuators/torque","color":"#0c00f2"},{"name":"/carOutput/actuatorsOutput/torque","color":"#2cd63a"}]},{"title":"controller feed-forward vs actuator output (closer means controller prediction is more accurate)","range":{"left":0.000194,"right":1138.891921,"top":1.978032,"bottom":-1.570956},"curves":[{"name":"/carOutput/actuatorsOutput/torque","color":"#9467bd","transform":"scale","scale":-1.0,"offset":0.0},{"name":"/controlsState/lateralControlState/torqueState/f","color":"#1f77b4"},{"name":"/carState/steeringPressed","color":"#ff000f"}]},{"title":"proportional, integral, and feed-forward terms (actuator output = sum of PIF terms)","range":{"left":0.000194,"right":1138.891921,"top":2.099784,"bottom":-4.027542},"curves":[{"name":"/controlsState/lateralControlState/torqueState/f","color":"#0ab027"},{"name":"/controlsState/lateralControlState/torqueState/p","color":"#d62728"},{"name":"/controlsState/lateralControlState/torqueState/i","color":"#ffaf00"},{"name":"Zero","color":"#756a6a","custom_python":{"linked_source":"/carState/canValid","additional_sources":[],"globals_code":"","function_code":"def __jotpluggler_eval_sample(time, value):\n return (0)\n\n__jotpluggler_result = np.empty_like(value, dtype=np.float64)\nfor __jotpluggler_i in range(len(value)):\n __jotpluggler_result[__jotpluggler_i] = __jotpluggler_eval_sample(time[__jotpluggler_i], value[__jotpluggler_i])\nreturn __jotpluggler_result"}}]},{"title":"road roll angle, from openpilot localizer","range":{"left":0.000194,"right":1138.891921,"top":0.109446,"bottom":-0.045525},"curves":[{"name":"/liveParameters/roll","color":"#f14cc1"}]}]}}]} diff --git a/tools/jotpluggler/sketch_layout.cc b/tools/jotpluggler/sketch_layout.cc index c8d7ff0..a8e982d 100644 --- a/tools/jotpluggler/sketch_layout.cc +++ b/tools/jotpluggler/sketch_layout.cc @@ -391,7 +391,7 @@ std::string detect_dbc_for_fingerprint(std::string_view car_fingerprint) { std::vector available_dbc_names_impl() { std::set names; for (const fs::path &dbc_dir : { - repo_root() / "opendbc" / "dbc", + repo_root() / "iqdbc" / "dbc", repo_root() / "tools" / "jotpluggler" / "generated_dbcs", }) { if (fs::exists(dbc_dir) && fs::is_directory(dbc_dir)) { @@ -413,7 +413,7 @@ std::vector available_dbc_names_impl() { fs::path resolve_dbc_path(const std::string &dbc_name) { for (const fs::path &candidate : { - repo_root() / "opendbc" / "dbc" / (dbc_name + ".dbc"), + repo_root() / "iqdbc" / "dbc" / (dbc_name + ".dbc"), repo_root() / "tools" / "jotpluggler" / "generated_dbcs" / (dbc_name + ".dbc"), }) { if (fs::exists(candidate)) return candidate; diff --git a/tools/joystick/joystickd.py b/tools/joystick/joystickd.py index f58df96..f7b1ea4 100755 --- a/tools/joystick/joystickd.py +++ b/tools/joystick/joystickd.py @@ -4,7 +4,7 @@ import math import numpy as np from cereal import messaging, car -from opendbc.car.vehicle_model import VehicleModel +from iqdbc.car.vehicle_model import VehicleModel from openpilot.common.realtime import DT_CTRL, Ratekeeper from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog @@ -15,6 +15,7 @@ MAX_STEERING_ANGLE_DEG = 500.0 ACCEL_RELEASE_THRESHOLD = 0.01 DECEL_REQUEST_THRESHOLD = -0.02 STOPPING_HOLD_SPEED_MARGIN = 0.3 +STOPPING_SPEED = 0.25 def get_lateral_joystick_outputs(CP: car.CarParams, VM: VehicleModel, v_ego: float, roll: float, steer_axis: float) -> tuple[float, float, float]: @@ -83,7 +84,7 @@ def joystickd_thread(): positive_accel_requested = accel_cmd > ACCEL_RELEASE_THRESHOLD negative_accel_requested = accel_cmd < DECEL_REQUEST_THRESHOLD - near_stop = sm['carState'].standstill or sm['carState'].vEgo <= (CP.vEgoStopping + STOPPING_HOLD_SPEED_MARGIN) + near_stop = sm['carState'].standstill or sm['carState'].vEgo <= (STOPPING_SPEED + STOPPING_HOLD_SPEED_MARGIN) if positive_accel_requested: stop_hold_latched = False @@ -95,7 +96,7 @@ def joystickd_thread(): stop_hold_latched = True # If we are moving again and driver is not asking for decel, clear stale hold state. - if stop_hold_latched and sm['carState'].vEgo > (CP.vEgoStopping + STOPPING_HOLD_SPEED_MARGIN) and not negative_accel_requested: + if stop_hold_latched and sm['carState'].vEgo > (STOPPING_SPEED + STOPPING_HOLD_SPEED_MARGIN) and not negative_accel_requested: stop_hold_latched = False decel_intent_latched = False diff --git a/tools/lib/comma_car_segments.py b/tools/lib/comma_car_segments.py index cd19356..8204b26 100644 --- a/tools/lib/comma_car_segments.py +++ b/tools/lib/comma_car_segments.py @@ -8,7 +8,7 @@ COMMA_CAR_SEGMENTS_BRANCH = os.environ.get("COMMA_CAR_SEGMENTS_BRANCH", "main") COMMA_CAR_SEGMENTS_LFS_INSTANCE = os.environ.get("COMMA_CAR_SEGMENTS_LFS_INSTANCE", COMMA_CAR_SEGMENTS_REPO) def get_comma_car_segments_database(): - from opendbc.car.fingerprints import MIGRATION + from iqdbc.car.fingerprints import MIGRATION database = requests.get(get_repo_raw_url("database.json")).json() diff --git a/tools/lib/tests/test_comma_car_segments.py b/tools/lib/tests/test_comma_car_segments.py index 1b0f07e..0952941 100644 --- a/tools/lib/tests/test_comma_car_segments.py +++ b/tools/lib/tests/test_comma_car_segments.py @@ -1,6 +1,6 @@ import pytest import requests -from opendbc.car.fingerprints import MIGRATION +from iqdbc.car.fingerprints import MIGRATION from openpilot.tools.lib.comma_car_segments import get_comma_car_segments_database, get_url from openpilot.tools.lib.logreader import LogReader from openpilot.tools.lib.route import SegmentRange diff --git a/tools/longitudinal_maneuvers/maneuversd.py b/tools/longitudinal_maneuvers/maneuversd.py index 52310b9..f830fe5 100755 --- a/tools/longitudinal_maneuvers/maneuversd.py +++ b/tools/longitudinal_maneuvers/maneuversd.py @@ -2,11 +2,12 @@ import numpy as np from dataclasses import dataclass -from cereal import messaging, car +from cereal import messaging from openpilot.common.constants import CV from openpilot.common.realtime import DT_MDL from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog +from openpilot.selfdrive.controls.lib.drive_helpers import should_stop @dataclass @@ -138,8 +139,8 @@ MANEUVERS = [ def main(): params = Params() - cloudlog.info("joystickd is waiting for CarParams") - CP = messaging.log_from_bytes(params.get("CarParams", block=True), car.CarParams) + cloudlog.info("maneuversd is waiting for CarParams") + params.get("CarParams", block=True) sm = messaging.SubMaster(['carState', 'carControl', 'controlsState', 'selfdriveState', 'modelV2'], poll='modelV2') pm = messaging.PubMaster(['longitudinalPlan', 'iqPlan', 'driverAssistance', 'alertDebug']) @@ -177,7 +178,7 @@ def main(): pm.send('alertDebug', alert_msg) longitudinalPlan.aTarget = accel - longitudinalPlan.shouldStop = v_ego < CP.vEgoStopping and accel < 1e-2 + longitudinalPlan.shouldStop = should_stop(v_ego, accel) longitudinalPlan.allowBrake = True longitudinalPlan.allowThrottle = True diff --git a/tools/plotjuggler/juggle.py b/tools/plotjuggler/juggle.py index 142e640..989c7c4 100755 --- a/tools/plotjuggler/juggle.py +++ b/tools/plotjuggler/juggle.py @@ -10,7 +10,7 @@ import requests import argparse from functools import partial -from opendbc.car.fingerprints import MIGRATION +from iqdbc.car.fingerprints import MIGRATION from openpilot.common.basedir import BASEDIR from openpilot.common.swaglog import cloudlog from openpilot.tools.cabana.dbc.generate_dbc_json import generate_dbc_dict diff --git a/tools/plotjuggler/layouts/torque-controller.xml b/tools/plotjuggler/layouts/torque-controller.xml index 8e9a1a8..69a9a28 100644 --- a/tools/plotjuggler/layouts/torque-controller.xml +++ b/tools/plotjuggler/layouts/torque-controller.xml @@ -123,7 +123,7 @@ - + @@ -233,7 +233,7 @@ /liveParameters/roll - + return value + 0.2 /carParams/steerActuatorDelay diff --git a/tools/sim/bridge/common.py b/tools/sim/bridge/common.py index 69dec17..11fa781 100644 --- a/tools/sim/bridge/common.py +++ b/tools/sim/bridge/common.py @@ -8,7 +8,7 @@ from enum import Enum from multiprocessing import Process, Queue, Value from abc import ABC, abstractmethod -from opendbc.car.honda.values import CruiseButtons +from iqdbc.car.honda.values import CruiseButtons from openpilot.common.params import Params from openpilot.common.realtime import Ratekeeper from openpilot.selfdrive.test.helpers import set_params_enabled diff --git a/tools/sim/lib/simulated_car.py b/tools/sim/lib/simulated_car.py index 68ff305..112f2b2 100644 --- a/tools/sim/lib/simulated_car.py +++ b/tools/sim/lib/simulated_car.py @@ -1,9 +1,9 @@ import traceback import cereal.messaging as messaging -from opendbc.can.packer import CANPacker -from opendbc.can.parser import CANParser -from opendbc.car.honda.values import HondaSafetyFlags +from iqdbc.can.packer import CANPacker +from iqdbc.can.parser import CANParser +from iqdbc.car.honda.values import HondaSafetyFlags from openpilot.common.params import Params from openpilot.selfdrive.pandad.pandad_api_impl import can_list_to_can_capnp from openpilot.tools.sim.lib.common import SimulatorState diff --git a/uv.lock b/uv.lock index 23cfed5..894cb03 100644 --- a/uv.lock +++ b/uv.lock @@ -649,6 +649,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e2/92/5f3068cf15ee5cb624a0c7596e67e2a0bb2adee33f71c379054a491d07da/kiwisolver-1.4.9-cp312-cp312-win_arm64.whl", hash = "sha256:2c1a4f57df73965f3f14df20b80ee29e6a7930a57d2d9e8491a25f676e197c60", size = 64992, upload-time = "2025-08-10T21:26:25.732Z" }, ] +[[package]] +name = "libdatachannel-py" +version = "2026.1.0.dev2" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/46/2f/68e8306327ddef4b2133d2efb163cb05b319759ce8bd50b8b32dcd03dd95/libdatachannel_py-2026.1.0.dev2-cp312-cp312-macosx_15_0_arm64.whl", hash = "sha256:6607fa1439e1b5bfceecd387c433470c9d45e439c3c06fa064f5c4669ad7e582", size = 1213155, upload-time = "2026-05-19T03:37:12.796Z" }, + { url = "https://files.pythonhosted.org/packages/fc/e3/10aed36ffaf1744795322aae612db777991575b72a9f04e2c677c2c022bf/libdatachannel_py-2026.1.0.dev2-cp312-cp312-macosx_26_0_arm64.whl", hash = "sha256:a060b1250f57d1fccb36e3a6b36ac8f4fd34926a6b51c564e787e8b7206458aa", size = 1224706, upload-time = "2026-05-19T03:37:12.679Z" }, + { url = "https://files.pythonhosted.org/packages/09/a9/103fc647a8f9c721ab140fe8d2f8dbd90817e917ca763c4eb0f843fe247e/libdatachannel_py-2026.1.0.dev2-cp312-cp312-manylinux_2_35_aarch64.whl", hash = "sha256:0b8aa3be2fa3654ea24f882756d6599e847de866a44f7a291c60994548a2debb", size = 1638879, upload-time = "2026-05-19T03:37:18.138Z" }, + { url = "https://files.pythonhosted.org/packages/09/a8/0dc7d3fe80fc247ec165dbd455bc2a1a307ef65702a43e24473202c2bf42/libdatachannel_py-2026.1.0.dev2-cp312-cp312-manylinux_2_35_x86_64.whl", hash = "sha256:339a79fcbc8c6caf91c620f6e4a0f1b8ccb6a941a966d10a3135c980ae4651a6", size = 1718006, upload-time = "2026-05-19T03:37:11.891Z" }, + { url = "https://files.pythonhosted.org/packages/6d/86/30904a8753e9db60d8c3cf8efda09585fc68f2004d3d7aa2910c93a8eed5/libdatachannel_py-2026.1.0.dev2-cp312-cp312-manylinux_2_38_aarch64.whl", hash = "sha256:b9f476cb065b50856ab2e53bf774ccca9c6a66454b7ce903aaf6dfcdef2a4482", size = 1643757, upload-time = "2026-05-19T03:37:12.207Z" }, + { url = "https://files.pythonhosted.org/packages/d7/9d/1e10131396d28e84a8088a63c14978cc215f6677dc85acdd96b6068f0664/libdatachannel_py-2026.1.0.dev2-cp312-cp312-manylinux_2_38_x86_64.whl", hash = "sha256:1f31db7347549edcd69fcc1ecb8b31e7183894808ccf9387afc49a4d68debaae", size = 1751748, upload-time = "2026-05-19T03:37:06.98Z" }, +] + [[package]] name = "libusb" version = "1.0.29" @@ -1027,6 +1040,7 @@ dependencies = [ { name = "inputs" }, { name = "jeepney" }, { name = "json-rpc" }, + { name = "libdatachannel-py" }, { name = "libusb1" }, { name = "mapbox-earcut" }, { name = "numpy" }, @@ -1116,6 +1130,7 @@ requires-dist = [ { name = "jeepney" }, { name = "jinja2", marker = "extra == 'docs'" }, { name = "json-rpc" }, + { name = "libdatachannel-py", specifier = ">=2026.1.0.dev2" }, { name = "libusb", marker = "extra == 'tools'", git = "https://git.konn3kt.com/IQ.Lvbs/dependencies.git?subdirectory=libusb&rev=release-libusb" }, { name = "libusb1" }, { name = "mapbox-earcut" },