IQ.Pilot Release Commit @ f82ff4d

This commit is contained in:
IQ.Lvbs CI [bot]
2026-07-21 13:43:46 -05:00
parent 7b20edda67
commit b712a31728
717 changed files with 4347 additions and 3060 deletions

View File

@@ -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

View File

@@ -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"])

View File

@@ -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]:

View File

@@ -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(); });

View File

@@ -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)) {

View File

@@ -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__":

View File

@@ -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",

View File

@@ -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\")"
]
},
{

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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

View File

@@ -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")

View File

@@ -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<DbcEditorSource, 2> 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;
}

File diff suppressed because one or more lines are too long

View File

@@ -391,7 +391,7 @@ std::string detect_dbc_for_fingerprint(std::string_view car_fingerprint) {
std::vector<std::string> available_dbc_names_impl() {
std::set<std::string> 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<std::string> 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;

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -123,7 +123,7 @@
<limitY/>
<curve name="/liveDelay/lateralDelay" color="#1f77b4"/>
<curve name="/liveDelay/lateralDelayEstimate" color="#d62728"/>
<curve name="opendbc default steering lag" color="#1ac938"/>
<curve name="iqdbc default steering lag" color="#1ac938"/>
</plot>
</DockArea>
<DockArea name="online estimated steering actuator lag, standard deviation">
@@ -233,7 +233,7 @@
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
<snippet name="opendbc default steering lag">
<snippet name="iqdbc default steering lag">
<global></global>
<function>return value + 0.2</function>
<linked_source>/carParams/steerActuatorDelay</linked_source>

View File

@@ -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

View File

@@ -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

View File

@@ -92,11 +92,12 @@ class SimulatedSensors:
# dmonitoringd output
dat = messaging.new_message('driverMonitoringState', valid=True)
dat.driverMonitoringState = {
"faceDetected": True,
"isDistracted": False,
"awarenessStatus": 1.,
}
dm = dat.driverMonitoringState
dm.alertLevel = log.DriverMonitoringState.AlertLevel.none
dm.activePolicy = log.DriverMonitoringState.MonitoringPolicy.vision
dm.visionPolicyState.faceDetected = True
dm.visionPolicyState.isDistracted = False
dm.visionPolicyState.awarenessPercent = 100
self.pm.send('driverMonitoringState', dat)
def send_camera_images(self, world: 'World'):