|
|
|
@ -4,7 +4,7 @@ import numpy as np |
|
|
|
|
import tomllib |
|
|
|
|
from abc import abstractmethod, ABC |
|
|
|
|
from enum import StrEnum |
|
|
|
|
from typing import Any, Dict, Optional, Tuple, List, Callable, NamedTuple |
|
|
|
|
from typing import Any, Dict, Optional, Tuple, List, Callable, NamedTuple, cast |
|
|
|
|
|
|
|
|
|
from cereal import car |
|
|
|
|
from openpilot.common.basedir import BASEDIR |
|
|
|
@ -12,7 +12,7 @@ from openpilot.common.conversions import Conversions as CV |
|
|
|
|
from openpilot.common.simple_kalman import KF1D, get_kalman_gain |
|
|
|
|
from openpilot.common.numpy_fast import clip |
|
|
|
|
from openpilot.common.realtime import DT_CTRL |
|
|
|
|
from openpilot.selfdrive.car import apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG |
|
|
|
|
from openpilot.selfdrive.car import PlatformConfig, apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG |
|
|
|
|
from openpilot.selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, get_friction |
|
|
|
|
from openpilot.selfdrive.controls.lib.events import Events |
|
|
|
|
from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel |
|
|
|
@ -111,6 +111,14 @@ class CarInterfaceBase(ABC): |
|
|
|
|
ret = CarInterfaceBase.get_std_params(candidate) |
|
|
|
|
ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs) |
|
|
|
|
|
|
|
|
|
if hasattr(candidate, "config"): |
|
|
|
|
platform_config = cast(PlatformConfig, candidate.config) |
|
|
|
|
if platform_config.specs is not None: |
|
|
|
|
ret.mass = platform_config.specs.mass |
|
|
|
|
ret.wheelbase = platform_config.specs.wheelbase |
|
|
|
|
ret.steerRatio = platform_config.specs.steerRatio |
|
|
|
|
ret.centerToFront = ret.wheelbase * 0.5 |
|
|
|
|
|
|
|
|
|
# Vehicle mass is published curb weight plus assumed payload such as a human driver; notCars have no assumed payload |
|
|
|
|
if not ret.notCar: |
|
|
|
|
ret.mass = ret.mass + STD_CARGO_KG |
|
|
|
|