mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-20 13:32:04 +08:00
interfaces: add common STD_CARGO_KG to mass (#29416)
* cleanup std_cargo_kg * fix Sonata mass * remove snowflake construct --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.chrysler.values import CAR, RAM_HD, RAM_DT, RAM_CARS, ChryslerFlags
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
|
||||
@@ -35,7 +35,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
# Chrysler
|
||||
if candidate in (CAR.PACIFICA_2017_HYBRID, CAR.PACIFICA_2018, CAR.PACIFICA_2018_HYBRID, CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020):
|
||||
ret.mass = 2242. + STD_CARGO_KG
|
||||
ret.mass = 2242.
|
||||
ret.wheelbase = 3.089
|
||||
ret.steerRatio = 16.2 # Pacifica Hybrid 2017
|
||||
|
||||
@@ -46,7 +46,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
# Jeep
|
||||
elif candidate in (CAR.JEEP_CHEROKEE, CAR.JEEP_CHEROKEE_2019):
|
||||
ret.mass = 1778 + STD_CARGO_KG
|
||||
ret.mass = 1778
|
||||
ret.wheelbase = 2.71
|
||||
ret.steerRatio = 16.7
|
||||
ret.steerActuatorDelay = 0.2
|
||||
@@ -61,7 +61,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerActuatorDelay = 0.2
|
||||
ret.wheelbase = 3.88
|
||||
ret.steerRatio = 16.3
|
||||
ret.mass = 2493. + STD_CARGO_KG
|
||||
ret.mass = 2493.
|
||||
ret.minSteerSpeed = 14.5
|
||||
# Older EPS FW allow steer to zero
|
||||
if any(fw.ecu == 'eps' and fw.fwVersion[:4] <= b"6831" for fw in car_fw):
|
||||
@@ -71,7 +71,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerActuatorDelay = 0.2
|
||||
ret.wheelbase = 3.785
|
||||
ret.steerRatio = 15.61
|
||||
ret.mass = 3405. + STD_CARGO_KG
|
||||
ret.mass = 3405.
|
||||
ret.minSteerSpeed = 16
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, 1.0, False)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from common.conversions import Conversions as CV
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.ford.fordcan import CanBus
|
||||
from selfdrive.car.ford.values import CANFD_CAR, CAR, Ecu
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
@@ -39,33 +39,33 @@ class CarInterface(CarInterfaceBase):
|
||||
if candidate == CAR.BRONCO_SPORT_MK1:
|
||||
ret.wheelbase = 2.67
|
||||
ret.steerRatio = 17.7
|
||||
ret.mass = 1625 + STD_CARGO_KG
|
||||
ret.mass = 1625
|
||||
|
||||
elif candidate == CAR.ESCAPE_MK4:
|
||||
ret.wheelbase = 2.71
|
||||
ret.steerRatio = 16.7
|
||||
ret.mass = 1750 + STD_CARGO_KG
|
||||
ret.mass = 1750
|
||||
|
||||
elif candidate == CAR.EXPLORER_MK6:
|
||||
ret.wheelbase = 3.025
|
||||
ret.steerRatio = 16.8
|
||||
ret.mass = 2050 + STD_CARGO_KG
|
||||
ret.mass = 2050
|
||||
|
||||
elif candidate == CAR.F_150_MK14:
|
||||
# required trim only on SuperCrew
|
||||
ret.wheelbase = 3.69
|
||||
ret.steerRatio = 17.0
|
||||
ret.mass = 2000 + STD_CARGO_KG
|
||||
ret.mass = 2000
|
||||
|
||||
elif candidate == CAR.FOCUS_MK4:
|
||||
ret.wheelbase = 2.7
|
||||
ret.steerRatio = 15.0
|
||||
ret.mass = 1350 + STD_CARGO_KG
|
||||
ret.mass = 1350
|
||||
|
||||
elif candidate == CAR.MAVERICK_MK1:
|
||||
ret.wheelbase = 3.076
|
||||
ret.steerRatio = 17.0
|
||||
ret.mass = 1650 + STD_CARGO_KG
|
||||
ret.mass = 1650
|
||||
|
||||
else:
|
||||
raise ValueError(f"Unsupported car: {candidate}")
|
||||
|
||||
@@ -4,7 +4,7 @@ from math import fabs, exp
|
||||
from panda import Panda
|
||||
|
||||
from common.conversions import Conversions as CV
|
||||
from selfdrive.car import STD_CARGO_KG, create_button_event, get_safety_config
|
||||
from selfdrive.car import create_button_event, get_safety_config
|
||||
from selfdrive.car.gm.radar_interface import RADAR_HEADER_MSG
|
||||
from selfdrive.car.gm.values import CAR, CruiseButtons, CarControllerParams, EV_CAR, CAMERA_ACC_CAR, CanBus
|
||||
from selfdrive.car.interfaces import CarInterfaceBase, TorqueFromLateralAccelCallbackType, FRICTION_THRESHOLD
|
||||
@@ -135,7 +135,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.longitudinalActuatorDelayUpperBound = 0.5 # large delay to initially start braking
|
||||
|
||||
if candidate == CAR.VOLT:
|
||||
ret.mass = 1607. + STD_CARGO_KG
|
||||
ret.mass = 1607.
|
||||
ret.wheelbase = 2.69
|
||||
ret.steerRatio = 17.7 # Stock 15.7, LiveParameters
|
||||
ret.tireStiffnessFactor = 0.469 # Stock Michelin Energy Saver A/S, LiveParameters
|
||||
@@ -149,13 +149,13 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerActuatorDelay = 0.2
|
||||
|
||||
elif candidate == CAR.MALIBU:
|
||||
ret.mass = 1496. + STD_CARGO_KG
|
||||
ret.mass = 1496.
|
||||
ret.wheelbase = 2.83
|
||||
ret.steerRatio = 15.8
|
||||
ret.centerToFront = ret.wheelbase * 0.4 # wild guess
|
||||
|
||||
elif candidate == CAR.HOLDEN_ASTRA:
|
||||
ret.mass = 1363. + STD_CARGO_KG
|
||||
ret.mass = 1363.
|
||||
ret.wheelbase = 2.662
|
||||
# Remaining parameters copied from Volt for now
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
@@ -163,7 +163,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
elif candidate == CAR.ACADIA:
|
||||
ret.minEnableSpeed = -1. # engage speed is decided by pcm
|
||||
ret.mass = 4353. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4353. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.86
|
||||
ret.steerRatio = 14.4 # end to end is 13.46
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
@@ -171,27 +171,27 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
elif candidate == CAR.BUICK_LACROSSE:
|
||||
ret.mass = 1712. + STD_CARGO_KG
|
||||
ret.mass = 1712.
|
||||
ret.wheelbase = 2.91
|
||||
ret.steerRatio = 15.8
|
||||
ret.centerToFront = ret.wheelbase * 0.4 # wild guess
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
elif candidate == CAR.BUICK_REGAL:
|
||||
ret.mass = 3779. * CV.LB_TO_KG + STD_CARGO_KG # (3849+3708)/2
|
||||
ret.mass = 3779. * CV.LB_TO_KG # (3849+3708)/2
|
||||
ret.wheelbase = 2.83 # 111.4 inches in meters
|
||||
ret.steerRatio = 14.4 # guess for tourx
|
||||
ret.centerToFront = ret.wheelbase * 0.4 # guess for tourx
|
||||
|
||||
elif candidate == CAR.CADILLAC_ATS:
|
||||
ret.mass = 1601. + STD_CARGO_KG
|
||||
ret.mass = 1601.
|
||||
ret.wheelbase = 2.78
|
||||
ret.steerRatio = 15.3
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
|
||||
elif candidate == CAR.ESCALADE:
|
||||
ret.minEnableSpeed = -1. # engage speed is decided by pcm
|
||||
ret.mass = 5653. * CV.LB_TO_KG + STD_CARGO_KG # (5552+5815)/2
|
||||
ret.mass = 5653. * CV.LB_TO_KG # (5552+5815)/2
|
||||
ret.wheelbase = 2.95 # 116 inches in meters
|
||||
ret.steerRatio = 17.3
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
@@ -199,7 +199,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
elif candidate == CAR.ESCALADE_ESV:
|
||||
ret.minEnableSpeed = -1. # engage speed is decided by pcm
|
||||
ret.mass = 2739. + STD_CARGO_KG
|
||||
ret.mass = 2739.
|
||||
ret.wheelbase = 3.302
|
||||
ret.steerRatio = 17.3
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
@@ -209,7 +209,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.tireStiffnessFactor = 1.0
|
||||
|
||||
elif candidate == CAR.BOLT_EUV:
|
||||
ret.mass = 1669. + STD_CARGO_KG
|
||||
ret.mass = 1669.
|
||||
ret.wheelbase = 2.63779
|
||||
ret.steerRatio = 16.8
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
@@ -218,7 +218,7 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
elif candidate == CAR.SILVERADO:
|
||||
ret.mass = 2450. + STD_CARGO_KG
|
||||
ret.mass = 2450.
|
||||
ret.wheelbase = 3.75
|
||||
ret.steerRatio = 16.3
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
@@ -231,14 +231,14 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
elif candidate == CAR.EQUINOX:
|
||||
ret.mass = 3500. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3500. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.72
|
||||
ret.steerRatio = 14.4
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
elif candidate == CAR.TRAILBLAZER:
|
||||
ret.mass = 1345. + STD_CARGO_KG
|
||||
ret.mass = 1345.
|
||||
ret.wheelbase = 2.64
|
||||
ret.steerRatio = 16.8
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
|
||||
@@ -5,7 +5,7 @@ from common.conversions import Conversions as CV
|
||||
from common.numpy_fast import interp
|
||||
from selfdrive.car.honda.values import CarControllerParams, CruiseButtons, HondaFlags, CAR, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, \
|
||||
HONDA_BOSCH_ALT_BRAKE_SIGNAL, HONDA_BOSCH_RADARLESS
|
||||
from selfdrive.car import STD_CARGO_KG, create_button_event, get_safety_config
|
||||
from selfdrive.car import create_button_event, get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
from selfdrive.car.disable_ecu import disable_ecu
|
||||
|
||||
@@ -89,7 +89,7 @@ class CarInterface(CarInterfaceBase):
|
||||
eps_modified = True
|
||||
|
||||
if candidate == CAR.CIVIC:
|
||||
ret.mass = 1326. + STD_CARGO_KG
|
||||
ret.mass = 1326.
|
||||
ret.wheelbase = 2.70
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
ret.steerRatio = 15.38 # 10.93 is end-to-end spec
|
||||
@@ -107,7 +107,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[1.1], [0.33]]
|
||||
|
||||
elif candidate in (CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CIVIC_2022):
|
||||
ret.mass = 1326. + STD_CARGO_KG
|
||||
ret.mass = 1326.
|
||||
ret.wheelbase = 2.70
|
||||
ret.centerToFront = ret.wheelbase * 0.4
|
||||
ret.steerRatio = 15.38 # 10.93 is end-to-end spec
|
||||
@@ -115,7 +115,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]]
|
||||
|
||||
elif candidate in (CAR.ACCORD, CAR.ACCORDH):
|
||||
ret.mass = 3279. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3279. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.83
|
||||
ret.centerToFront = ret.wheelbase * 0.39
|
||||
ret.steerRatio = 16.33 # 11.82 is spec end-to-end
|
||||
@@ -128,7 +128,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]]
|
||||
|
||||
elif candidate == CAR.ACURA_ILX:
|
||||
ret.mass = 3095. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3095. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.37
|
||||
ret.steerRatio = 18.61 # 15.3 is spec end-to-end
|
||||
@@ -137,7 +137,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]]
|
||||
|
||||
elif candidate in (CAR.CRV, CAR.CRV_EU):
|
||||
ret.mass = 3572. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3572. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.62
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 16.89 # as spec
|
||||
@@ -147,7 +147,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelSpeedFactor = 1.025
|
||||
|
||||
elif candidate == CAR.CRV_5G:
|
||||
ret.mass = 3410. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3410. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.66
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 16.0 # 12.3 is spec end-to-end
|
||||
@@ -164,7 +164,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelSpeedFactor = 1.025
|
||||
|
||||
elif candidate == CAR.CRV_HYBRID:
|
||||
ret.mass = 1667. + STD_CARGO_KG # mean of 4 models in kg
|
||||
ret.mass = 1667. # mean of 4 models in kg
|
||||
ret.wheelbase = 2.66
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 16.0 # 12.3 is spec end-to-end
|
||||
@@ -174,7 +174,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelSpeedFactor = 1.025
|
||||
|
||||
elif candidate == CAR.FIT:
|
||||
ret.mass = 2644. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 2644. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.53
|
||||
ret.centerToFront = ret.wheelbase * 0.39
|
||||
ret.steerRatio = 13.06
|
||||
@@ -183,7 +183,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]]
|
||||
|
||||
elif candidate == CAR.FREED:
|
||||
ret.mass = 3086. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3086. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.74
|
||||
# the remaining parameters were copied from FIT
|
||||
ret.centerToFront = ret.wheelbase * 0.39
|
||||
@@ -193,7 +193,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]]
|
||||
|
||||
elif candidate in (CAR.HRV, CAR.HRV_3G):
|
||||
ret.mass = 3125 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3125 * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.61
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 15.2
|
||||
@@ -206,7 +206,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] # TODO: can probably use some tuning
|
||||
|
||||
elif candidate == CAR.ACURA_RDX:
|
||||
ret.mass = 3935. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3935. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.68
|
||||
ret.centerToFront = ret.wheelbase * 0.38
|
||||
ret.steerRatio = 15.0 # as spec
|
||||
@@ -215,7 +215,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]]
|
||||
|
||||
elif candidate == CAR.ACURA_RDX_3G:
|
||||
ret.mass = 4068. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4068. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.75
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 11.95 # as spec
|
||||
@@ -224,7 +224,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.tireStiffnessFactor = 0.677
|
||||
|
||||
elif candidate in (CAR.ODYSSEY, CAR.ODYSSEY_CHN):
|
||||
ret.mass = 1900. + STD_CARGO_KG
|
||||
ret.mass = 1900.
|
||||
ret.wheelbase = 3.00
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 14.35 # as spec
|
||||
@@ -236,7 +236,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end
|
||||
|
||||
elif candidate == CAR.PILOT:
|
||||
ret.mass = 4278. * CV.LB_TO_KG + STD_CARGO_KG # average weight
|
||||
ret.mass = 4278. * CV.LB_TO_KG # average weight
|
||||
ret.wheelbase = 2.86
|
||||
ret.centerToFront = ret.wheelbase * 0.428
|
||||
ret.steerRatio = 16.0 # as spec
|
||||
@@ -245,7 +245,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]]
|
||||
|
||||
elif candidate == CAR.RIDGELINE:
|
||||
ret.mass = 4515. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4515. * CV.LB_TO_KG
|
||||
ret.wheelbase = 3.18
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
ret.steerRatio = 15.59 # as spec
|
||||
@@ -254,7 +254,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]]
|
||||
|
||||
elif candidate == CAR.INSIGHT:
|
||||
ret.mass = 2987. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 2987. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.7
|
||||
ret.centerToFront = ret.wheelbase * 0.39
|
||||
ret.steerRatio = 15.0 # 12.58 is spec end-to-end
|
||||
@@ -263,7 +263,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]]
|
||||
|
||||
elif candidate == CAR.HONDA_E:
|
||||
ret.mass = 3338.8 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3338.8 * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.5
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 16.71
|
||||
|
||||
@@ -6,7 +6,7 @@ from selfdrive.car.hyundai.hyundaicanfd import CanBus
|
||||
from selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CANFD_CAR, CAMERA_SCC_CAR, CANFD_RADAR_SCC_CAR, \
|
||||
EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, Buttons
|
||||
from selfdrive.car.hyundai.radar_interface import RADAR_START_ADDR
|
||||
from selfdrive.car import STD_CARGO_KG, create_button_event, get_safety_config
|
||||
from selfdrive.car import create_button_event, get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
from selfdrive.car.disable_ecu import disable_ecu
|
||||
|
||||
@@ -62,180 +62,180 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
if candidate in (CAR.SANTA_FE, CAR.SANTA_FE_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022):
|
||||
ret.mass = 3982. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3982. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.766
|
||||
# Values from optimizer
|
||||
ret.steerRatio = 16.55 # 13.8 is spec end-to-end
|
||||
ret.tireStiffnessFactor = 0.82
|
||||
elif candidate in (CAR.SONATA, CAR.SONATA_HYBRID):
|
||||
ret.mass = 1513. + STD_CARGO_KG
|
||||
ret.mass = 1513.
|
||||
ret.wheelbase = 2.84
|
||||
ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable
|
||||
ret.tireStiffnessFactor = 0.65
|
||||
elif candidate == CAR.SONATA_LF:
|
||||
ret.mass = 1536. + STD_CARGO_KG
|
||||
ret.mass = 1536.
|
||||
ret.wheelbase = 2.804
|
||||
ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable
|
||||
elif candidate == CAR.PALISADE:
|
||||
ret.mass = 1999. + STD_CARGO_KG
|
||||
ret.mass = 1999.
|
||||
ret.wheelbase = 2.90
|
||||
ret.steerRatio = 15.6 * 1.15
|
||||
ret.tireStiffnessFactor = 0.63
|
||||
elif candidate == CAR.ELANTRA:
|
||||
ret.mass = 1275. + STD_CARGO_KG
|
||||
ret.mass = 1275.
|
||||
ret.wheelbase = 2.7
|
||||
ret.steerRatio = 15.4 # 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535
|
||||
ret.tireStiffnessFactor = 0.385 # stiffnessFactor settled on 1.0081302973865127
|
||||
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
|
||||
elif candidate == CAR.ELANTRA_2021:
|
||||
ret.mass = (2800. * CV.LB_TO_KG) + STD_CARGO_KG
|
||||
ret.mass = 2800. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.72
|
||||
ret.steerRatio = 12.9
|
||||
ret.tireStiffnessFactor = 0.65
|
||||
elif candidate == CAR.ELANTRA_HEV_2021:
|
||||
ret.mass = (3017. * CV.LB_TO_KG) + STD_CARGO_KG
|
||||
ret.mass = 3017. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.72
|
||||
ret.steerRatio = 12.9
|
||||
ret.tireStiffnessFactor = 0.65
|
||||
elif candidate == CAR.HYUNDAI_GENESIS:
|
||||
ret.mass = 2060. + STD_CARGO_KG
|
||||
ret.mass = 2060.
|
||||
ret.wheelbase = 3.01
|
||||
ret.steerRatio = 16.5
|
||||
ret.minSteerSpeed = 60 * CV.KPH_TO_MS
|
||||
elif candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022):
|
||||
ret.mass = {CAR.KONA_EV: 1685., CAR.KONA_HEV: 1425., CAR.KONA_EV_2022: 1743.}.get(candidate, 1275.) + STD_CARGO_KG
|
||||
ret.mass = {CAR.KONA_EV: 1685., CAR.KONA_HEV: 1425., CAR.KONA_EV_2022: 1743.}.get(candidate, 1275.)
|
||||
ret.wheelbase = 2.6
|
||||
ret.steerRatio = 13.42 # Spec
|
||||
ret.tireStiffnessFactor = 0.385
|
||||
elif candidate in (CAR.IONIQ, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV_2019, CAR.IONIQ_HEV_2022, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV):
|
||||
ret.mass = 1490. + STD_CARGO_KG # weight per hyundai site https://www.hyundaiusa.com/ioniq-electric/specifications.aspx
|
||||
ret.mass = 1490. # weight per hyundai site https://www.hyundaiusa.com/ioniq-electric/specifications.aspx
|
||||
ret.wheelbase = 2.7
|
||||
ret.steerRatio = 13.73 # Spec
|
||||
ret.tireStiffnessFactor = 0.385
|
||||
if candidate in (CAR.IONIQ, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV_2019):
|
||||
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
|
||||
elif candidate == CAR.VELOSTER:
|
||||
ret.mass = 2917. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 2917. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.80
|
||||
ret.steerRatio = 13.75 * 1.15
|
||||
ret.tireStiffnessFactor = 0.5
|
||||
elif candidate == CAR.TUCSON:
|
||||
ret.mass = 3520. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3520. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.67
|
||||
ret.steerRatio = 14.00 * 1.15
|
||||
ret.tireStiffnessFactor = 0.385
|
||||
elif candidate in (CAR.TUCSON_4TH_GEN, CAR.TUCSON_HYBRID_4TH_GEN):
|
||||
ret.mass = 1630. + STD_CARGO_KG # average
|
||||
ret.mass = 1630. # average
|
||||
ret.wheelbase = 2.756
|
||||
ret.steerRatio = 16.
|
||||
ret.tireStiffnessFactor = 0.385
|
||||
elif candidate == CAR.SANTA_CRUZ_1ST_GEN:
|
||||
ret.mass = 1870. + STD_CARGO_KG # weight from Limited trim - the only supported trim
|
||||
ret.mass = 1870. # weight from Limited trim - the only supported trim
|
||||
ret.wheelbase = 3.000
|
||||
# steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf
|
||||
ret.steerRatio = 14.2
|
||||
|
||||
# Kia
|
||||
elif candidate == CAR.KIA_SORENTO:
|
||||
ret.mass = 1985. + STD_CARGO_KG
|
||||
ret.mass = 1985.
|
||||
ret.wheelbase = 2.78
|
||||
ret.steerRatio = 14.4 * 1.1 # 10% higher at the center seems reasonable
|
||||
elif candidate in (CAR.KIA_NIRO_EV, CAR.KIA_NIRO_EV_2ND_GEN, CAR.KIA_NIRO_PHEV, CAR.KIA_NIRO_HEV_2021, CAR.KIA_NIRO_HEV_2ND_GEN):
|
||||
ret.mass = 3543. * CV.LB_TO_KG + STD_CARGO_KG # average of all the cars
|
||||
ret.mass = 3543. * CV.LB_TO_KG # average of all the cars
|
||||
ret.wheelbase = 2.7
|
||||
ret.steerRatio = 13.6 # average of all the cars
|
||||
ret.tireStiffnessFactor = 0.385
|
||||
if candidate == CAR.KIA_NIRO_PHEV:
|
||||
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
|
||||
elif candidate == CAR.KIA_SELTOS:
|
||||
ret.mass = 1337. + STD_CARGO_KG
|
||||
ret.mass = 1337.
|
||||
ret.wheelbase = 2.63
|
||||
ret.steerRatio = 14.56
|
||||
elif candidate == CAR.KIA_SPORTAGE_5TH_GEN:
|
||||
ret.mass = 1700. + STD_CARGO_KG # weight from SX and above trims, average of FWD and AWD versions
|
||||
ret.mass = 1700. # weight from SX and above trims, average of FWD and AWD versions
|
||||
ret.wheelbase = 2.756
|
||||
ret.steerRatio = 13.6 # steering ratio according to Kia News https://www.kiamedia.com/us/en/models/sportage/2023/specifications
|
||||
elif candidate in (CAR.KIA_OPTIMA_G4, CAR.KIA_OPTIMA_G4_FL, CAR.KIA_OPTIMA_H):
|
||||
ret.mass = 3558. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3558. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.80
|
||||
ret.steerRatio = 13.75
|
||||
ret.tireStiffnessFactor = 0.5
|
||||
if candidate == CAR.KIA_OPTIMA_G4:
|
||||
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
|
||||
elif candidate in (CAR.KIA_STINGER, CAR.KIA_STINGER_2022):
|
||||
ret.mass = 1825. + STD_CARGO_KG
|
||||
ret.mass = 1825.
|
||||
ret.wheelbase = 2.78
|
||||
ret.steerRatio = 14.4 * 1.15 # 15% higher at the center seems reasonable
|
||||
elif candidate == CAR.KIA_FORTE:
|
||||
ret.mass = 2878. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 2878. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.80
|
||||
ret.steerRatio = 13.75
|
||||
ret.tireStiffnessFactor = 0.5
|
||||
elif candidate == CAR.KIA_CEED:
|
||||
ret.mass = 1450. + STD_CARGO_KG
|
||||
ret.mass = 1450.
|
||||
ret.wheelbase = 2.65
|
||||
ret.steerRatio = 13.75
|
||||
ret.tireStiffnessFactor = 0.5
|
||||
elif candidate in (CAR.KIA_K5_2021, CAR.KIA_K5_HEV_2020):
|
||||
ret.mass = 3381. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3381. * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.85
|
||||
ret.steerRatio = 13.27 # 2021 Kia K5 Steering Ratio (all trims)
|
||||
ret.tireStiffnessFactor = 0.5
|
||||
elif candidate == CAR.KIA_EV6:
|
||||
ret.mass = 2055 + STD_CARGO_KG
|
||||
ret.mass = 2055
|
||||
ret.wheelbase = 2.9
|
||||
ret.steerRatio = 16.
|
||||
ret.tireStiffnessFactor = 0.65
|
||||
elif candidate in (CAR.IONIQ_5, CAR.IONIQ_6):
|
||||
ret.mass = 1948 + STD_CARGO_KG
|
||||
ret.mass = 1948
|
||||
ret.wheelbase = 2.97
|
||||
ret.steerRatio = 14.26
|
||||
ret.tireStiffnessFactor = 0.65
|
||||
elif candidate == CAR.KIA_SPORTAGE_HYBRID_5TH_GEN:
|
||||
ret.mass = 1767. + STD_CARGO_KG # SX Prestige trim support only
|
||||
ret.mass = 1767. # SX Prestige trim support only
|
||||
ret.wheelbase = 2.756
|
||||
ret.steerRatio = 13.6
|
||||
elif candidate in (CAR.KIA_SORENTO_4TH_GEN, CAR.KIA_SORENTO_PHEV_4TH_GEN):
|
||||
ret.wheelbase = 2.81
|
||||
ret.steerRatio = 13.5 # average of the platforms
|
||||
if candidate == CAR.KIA_SORENTO_4TH_GEN:
|
||||
ret.mass = 3957 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3957 * CV.LB_TO_KG
|
||||
else:
|
||||
ret.mass = 4537 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4537 * CV.LB_TO_KG
|
||||
elif candidate == CAR.KIA_CARNIVAL_4TH_GEN:
|
||||
ret.mass = 2087. + STD_CARGO_KG
|
||||
ret.mass = 2087.
|
||||
ret.wheelbase = 3.09
|
||||
ret.steerRatio = 14.23
|
||||
|
||||
# Genesis
|
||||
elif candidate == CAR.GENESIS_GV60_EV_1ST_GEN:
|
||||
ret.mass = 2205 + STD_CARGO_KG
|
||||
ret.mass = 2205
|
||||
ret.wheelbase = 2.9
|
||||
# https://www.motor1.com/reviews/586376/2023-genesis-gv60-first-drive/#:~:text=Relative%20to%20the%20related%20Ioniq,5%2FEV6%27s%2014.3%3A1.
|
||||
ret.steerRatio = 12.6
|
||||
elif candidate == CAR.GENESIS_G70:
|
||||
ret.steerActuatorDelay = 0.1
|
||||
ret.mass = 1640.0 + STD_CARGO_KG
|
||||
ret.mass = 1640.0
|
||||
ret.wheelbase = 2.84
|
||||
ret.steerRatio = 13.56
|
||||
elif candidate == CAR.GENESIS_G70_2020:
|
||||
ret.mass = 3673.0 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3673.0 * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.83
|
||||
ret.steerRatio = 12.9
|
||||
elif candidate == CAR.GENESIS_GV70_1ST_GEN:
|
||||
ret.mass = 1950. + STD_CARGO_KG
|
||||
ret.mass = 1950.
|
||||
ret.wheelbase = 2.87
|
||||
ret.steerRatio = 14.6
|
||||
elif candidate == CAR.GENESIS_G80:
|
||||
ret.mass = 2060. + STD_CARGO_KG
|
||||
ret.mass = 2060.
|
||||
ret.wheelbase = 3.01
|
||||
ret.steerRatio = 16.5
|
||||
elif candidate == CAR.GENESIS_G90:
|
||||
ret.mass = 2200. + STD_CARGO_KG
|
||||
ret.mass = 2200.
|
||||
ret.wheelbase = 3.15
|
||||
ret.steerRatio = 12.069
|
||||
elif candidate == CAR.GENESIS_GV80:
|
||||
ret.mass = 2258. + STD_CARGO_KG
|
||||
ret.mass = 2258.
|
||||
ret.wheelbase = 2.95
|
||||
ret.steerRatio = 14.14
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from common.conversions import Conversions as CV
|
||||
from common.kalman.simple_kalman import KF1D
|
||||
from common.numpy_fast import clip
|
||||
from common.realtime import DT_CTRL
|
||||
from selfdrive.car import apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness
|
||||
from selfdrive.car import apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG
|
||||
from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, get_friction
|
||||
from selfdrive.controls.lib.events import Events
|
||||
from selfdrive.controls.lib.vehicle_model import VehicleModel
|
||||
@@ -99,6 +99,10 @@ class CarInterfaceBase(ABC):
|
||||
ret = CarInterfaceBase.get_std_params(candidate)
|
||||
ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs)
|
||||
|
||||
# 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
|
||||
|
||||
# Set params dependent on values set by the car interface
|
||||
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase)
|
||||
ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, ret.tireStiffnessFactor)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from cereal import car
|
||||
from common.conversions import Conversions as CV
|
||||
from selfdrive.car.mazda.values import CAR, LKAS_LIMITS
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
@@ -25,19 +25,19 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
if candidate in (CAR.CX5, CAR.CX5_2022):
|
||||
ret.mass = 3655 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3655 * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.7
|
||||
ret.steerRatio = 15.5
|
||||
elif candidate in (CAR.CX9, CAR.CX9_2021):
|
||||
ret.mass = 4217 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4217 * CV.LB_TO_KG
|
||||
ret.wheelbase = 3.1
|
||||
ret.steerRatio = 17.6
|
||||
elif candidate == CAR.MAZDA3:
|
||||
ret.mass = 2875 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 2875 * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.7
|
||||
ret.steerRatio = 14.0
|
||||
elif candidate == CAR.MAZDA6:
|
||||
ret.mass = 3443 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3443 * CV.LB_TO_KG
|
||||
ret.wheelbase = 2.83
|
||||
ret.steerRatio = 15.5
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
from cereal import car
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
from selfdrive.car.nissan.values import CAR
|
||||
|
||||
@@ -22,17 +22,17 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.radarUnavailable = True
|
||||
|
||||
if candidate in (CAR.ROGUE, CAR.XTRAIL):
|
||||
ret.mass = 1610 + STD_CARGO_KG
|
||||
ret.mass = 1610
|
||||
ret.wheelbase = 2.705
|
||||
ret.centerToFront = ret.wheelbase * 0.44
|
||||
elif candidate in (CAR.LEAF, CAR.LEAF_IC):
|
||||
ret.mass = 1610 + STD_CARGO_KG
|
||||
ret.mass = 1610
|
||||
ret.wheelbase = 2.705
|
||||
ret.centerToFront = ret.wheelbase * 0.44
|
||||
elif candidate == CAR.ALTIMA:
|
||||
# Altima has EPS on C-CAN unlike the others that have it on V-CAN
|
||||
ret.safetyConfigs[0].safetyParam = 1 # EPS is on alternate bus
|
||||
ret.mass = 1492 + STD_CARGO_KG
|
||||
ret.mass = 1492
|
||||
ret.wheelbase = 2.824
|
||||
ret.centerToFront = ret.wheelbase * 0.44
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
from selfdrive.car.subaru.values import CAR, LKAS_ANGLE, GLOBAL_GEN2, PREGLOBAL_CARS, SubaruFlags
|
||||
|
||||
@@ -37,7 +37,7 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
if candidate == CAR.ASCENT:
|
||||
ret.mass = 2031. + STD_CARGO_KG
|
||||
ret.mass = 2031.
|
||||
ret.wheelbase = 2.89
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 13.5
|
||||
@@ -48,7 +48,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.0025, 0.1], [0.00025, 0.01]]
|
||||
|
||||
elif candidate == CAR.IMPREZA:
|
||||
ret.mass = 1568. + STD_CARGO_KG
|
||||
ret.mass = 1568.
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 15
|
||||
@@ -59,7 +59,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2, 0.3], [0.02, 0.03]]
|
||||
|
||||
elif candidate == CAR.IMPREZA_2020:
|
||||
ret.mass = 1480. + STD_CARGO_KG
|
||||
ret.mass = 1480.
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 17 # learned, 14 stock
|
||||
@@ -69,7 +69,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.045, 0.042, 0.20], [0.04, 0.035, 0.045]]
|
||||
|
||||
elif candidate in (CAR.FORESTER, CAR.FORESTER_2022):
|
||||
ret.mass = 1568. + STD_CARGO_KG
|
||||
ret.mass = 1568.
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 17 # learned, 14 stock
|
||||
@@ -79,7 +79,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01, 0.065, 0.2], [0.001, 0.015, 0.025]]
|
||||
|
||||
elif candidate in (CAR.OUTBACK, CAR.LEGACY, CAR.OUTBACK_2023):
|
||||
ret.mass = 1568. + STD_CARGO_KG
|
||||
ret.mass = 1568.
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 17
|
||||
@@ -87,20 +87,20 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
elif candidate in (CAR.FORESTER_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018):
|
||||
ret.safetyConfigs[0].safetyParam = 1 # Outback 2018-2019 and Forester have reversed driver torque signal
|
||||
ret.mass = 1568 + STD_CARGO_KG
|
||||
ret.mass = 1568
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 20 # learned, 14 stock
|
||||
|
||||
elif candidate == CAR.LEGACY_PREGLOBAL:
|
||||
ret.mass = 1568 + STD_CARGO_KG
|
||||
ret.mass = 1568
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 12.5 # 14.5 stock
|
||||
ret.steerActuatorDelay = 0.15
|
||||
|
||||
elif candidate == CAR.OUTBACK_PREGLOBAL:
|
||||
ret.mass = 1568 + STD_CARGO_KG
|
||||
ret.mass = 1568
|
||||
ret.wheelbase = 2.67
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 20 # learned, 14 stock
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from selfdrive.car.tesla.values import CANBUS, CAR
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerActuatorDelay = 0.25
|
||||
|
||||
if candidate in (CAR.AP2_MODELS, CAR.AP1_MODELS):
|
||||
ret.mass = 2100. + STD_CARGO_KG
|
||||
ret.mass = 2100.
|
||||
ret.wheelbase = 2.959
|
||||
ret.centerToFront = ret.wheelbase * 0.5
|
||||
ret.steerRatio = 15.0
|
||||
|
||||
@@ -4,7 +4,7 @@ from common.conversions import Conversions as CV
|
||||
from panda import Panda
|
||||
from selfdrive.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, NO_DSU_CAR, \
|
||||
MIN_ACC_SPEED, EPS_SCALE, EV_HYBRID_CAR, UNSUPPORTED_DSU_CAR, NO_STOP_TIMER_CAR, ANGLE_CONTROL_CAR
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
|
||||
EventName = car.CarEvent.EventName
|
||||
@@ -49,7 +49,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelbase = 2.70
|
||||
ret.steerRatio = 15.74 # unknown end-to-end spec
|
||||
ret.tireStiffnessFactor = 0.6371 # hand-tune
|
||||
ret.mass = 3045. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3045. * CV.LB_TO_KG
|
||||
# Only give steer angle deadzone to for bad angle sensor prius
|
||||
for fw in car_fw:
|
||||
if fw.ecu == "eps" and not fw.fwVersion == b'8965B47060\x00\x00\x00\x00\x00\x00':
|
||||
@@ -61,20 +61,20 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelbase = 2.78
|
||||
ret.steerRatio = 17.4
|
||||
ret.tireStiffnessFactor = 0.5533
|
||||
ret.mass = 3340. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3340. * CV.LB_TO_KG
|
||||
|
||||
elif candidate in (CAR.RAV4, CAR.RAV4H):
|
||||
stop_and_go = True if (candidate in CAR.RAV4H) else False
|
||||
ret.wheelbase = 2.65
|
||||
ret.steerRatio = 16.88 # 14.5 is spec end-to-end
|
||||
ret.tireStiffnessFactor = 0.5533
|
||||
ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid
|
||||
ret.mass = 3650. * CV.LB_TO_KG # mean between normal and hybrid
|
||||
|
||||
elif candidate == CAR.COROLLA:
|
||||
ret.wheelbase = 2.70
|
||||
ret.steerRatio = 18.27
|
||||
ret.tireStiffnessFactor = 0.444 # not optimized yet
|
||||
ret.mass = 2860. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid
|
||||
ret.mass = 2860. * CV.LB_TO_KG # mean between normal and hybrid
|
||||
|
||||
elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RXH, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2):
|
||||
stop_and_go = True
|
||||
@@ -82,28 +82,28 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerRatio = 16. # 14.8 is spec end-to-end
|
||||
ret.wheelSpeedFactor = 1.035
|
||||
ret.tireStiffnessFactor = 0.5533
|
||||
ret.mass = 4481. * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max
|
||||
ret.mass = 4481. * CV.LB_TO_KG # mean between min and max
|
||||
|
||||
elif candidate in (CAR.CHR, CAR.CHRH, CAR.CHR_TSS2, CAR.CHRH_TSS2):
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 2.63906
|
||||
ret.steerRatio = 13.6
|
||||
ret.tireStiffnessFactor = 0.7933
|
||||
ret.mass = 3300. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3300. * CV.LB_TO_KG
|
||||
|
||||
elif candidate in (CAR.CAMRY, CAR.CAMRYH, CAR.CAMRY_TSS2, CAR.CAMRYH_TSS2):
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 2.82448
|
||||
ret.steerRatio = 13.7
|
||||
ret.tireStiffnessFactor = 0.7933
|
||||
ret.mass = 3400. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid
|
||||
ret.mass = 3400. * CV.LB_TO_KG # mean between normal and hybrid
|
||||
|
||||
elif candidate in (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2):
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 2.8194 # average of 109.8 and 112.2 in
|
||||
ret.steerRatio = 16.0
|
||||
ret.tireStiffnessFactor = 0.8
|
||||
ret.mass = 4516. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid
|
||||
ret.mass = 4516. * CV.LB_TO_KG # mean between normal and hybrid
|
||||
|
||||
elif candidate in (CAR.AVALON, CAR.AVALON_2019, CAR.AVALONH_2019, CAR.AVALON_TSS2, CAR.AVALONH_TSS2):
|
||||
# starting from 2019, all Avalon variants have stop and go
|
||||
@@ -112,14 +112,14 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelbase = 2.82
|
||||
ret.steerRatio = 14.8 # Found at https://pressroom.toyota.com/releases/2016+avalon+product+specs.download
|
||||
ret.tireStiffnessFactor = 0.7983
|
||||
ret.mass = 3505. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid
|
||||
ret.mass = 3505. * CV.LB_TO_KG # mean between normal and hybrid
|
||||
|
||||
elif candidate in (CAR.RAV4_TSS2, CAR.RAV4_TSS2_2022, CAR.RAV4H_TSS2, CAR.RAV4H_TSS2_2022,
|
||||
CAR.RAV4_TSS2_2023, CAR.RAV4H_TSS2_2023):
|
||||
ret.wheelbase = 2.68986
|
||||
ret.steerRatio = 14.3
|
||||
ret.tireStiffnessFactor = 0.7933
|
||||
ret.mass = 3585. * CV.LB_TO_KG + STD_CARGO_KG # Average between ICE and Hybrid
|
||||
ret.mass = 3585. * CV.LB_TO_KG # Average between ICE and Hybrid
|
||||
ret.lateralTuning.init('pid')
|
||||
ret.lateralTuning.pid.kiBP = [0.0]
|
||||
ret.lateralTuning.pid.kpBP = [0.0]
|
||||
@@ -140,7 +140,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelbase = 2.67 # Average between 2.70 for sedan and 2.64 for hatchback
|
||||
ret.steerRatio = 13.9
|
||||
ret.tireStiffnessFactor = 0.444 # not optimized yet
|
||||
ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3060. * CV.LB_TO_KG
|
||||
|
||||
elif candidate in (CAR.LEXUS_ES, CAR.LEXUS_ESH, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2):
|
||||
if candidate not in (CAR.LEXUS_ES,): # TODO: LEXUS_ES may have sng
|
||||
@@ -148,53 +148,53 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.wheelbase = 2.8702
|
||||
ret.steerRatio = 16.0 # not optimized
|
||||
ret.tireStiffnessFactor = 0.444 # not optimized yet
|
||||
ret.mass = 3677. * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max
|
||||
ret.mass = 3677. * CV.LB_TO_KG # mean between min and max
|
||||
|
||||
elif candidate == CAR.SIENNA:
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 3.03
|
||||
ret.steerRatio = 15.5
|
||||
ret.tireStiffnessFactor = 0.444
|
||||
ret.mass = 4590. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4590. * CV.LB_TO_KG
|
||||
|
||||
elif candidate in (CAR.LEXUS_IS, CAR.LEXUS_IS_TSS2, CAR.LEXUS_RC):
|
||||
ret.wheelbase = 2.79908
|
||||
ret.steerRatio = 13.3
|
||||
ret.tireStiffnessFactor = 0.444
|
||||
ret.mass = 3736.8 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3736.8 * CV.LB_TO_KG
|
||||
|
||||
elif candidate == CAR.LEXUS_CTH:
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 2.60
|
||||
ret.steerRatio = 18.6
|
||||
ret.tireStiffnessFactor = 0.517
|
||||
ret.mass = 3108 * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max
|
||||
ret.mass = 3108 * CV.LB_TO_KG # mean between min and max
|
||||
|
||||
elif candidate in (CAR.LEXUS_NX, CAR.LEXUS_NXH, CAR.LEXUS_NX_TSS2, CAR.LEXUS_NXH_TSS2):
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 2.66
|
||||
ret.steerRatio = 14.7
|
||||
ret.tireStiffnessFactor = 0.444 # not optimized yet
|
||||
ret.mass = 4070 * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4070 * CV.LB_TO_KG
|
||||
|
||||
elif candidate == CAR.PRIUS_TSS2:
|
||||
ret.wheelbase = 2.70002 # from toyota online sepc.
|
||||
ret.steerRatio = 13.4 # True steerRatio from older prius
|
||||
ret.tireStiffnessFactor = 0.6371 # hand-tune
|
||||
ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 3115. * CV.LB_TO_KG
|
||||
|
||||
elif candidate == CAR.MIRAI:
|
||||
stop_and_go = True
|
||||
ret.wheelbase = 2.91
|
||||
ret.steerRatio = 14.8
|
||||
ret.tireStiffnessFactor = 0.8
|
||||
ret.mass = 4300. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4300. * CV.LB_TO_KG
|
||||
|
||||
elif candidate in (CAR.ALPHARD_TSS2, CAR.ALPHARDH_TSS2):
|
||||
ret.wheelbase = 3.00
|
||||
ret.steerRatio = 14.2
|
||||
ret.tireStiffnessFactor = 0.444
|
||||
ret.mass = 4305. * CV.LB_TO_KG + STD_CARGO_KG
|
||||
ret.mass = 4305. * CV.LB_TO_KG
|
||||
|
||||
ret.centerToFront = ret.wheelbase * 0.44
|
||||
ret.enableBsm = 0x3F6 in fingerprint[0] and candidate in TSS2_CAR
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from cereal import car
|
||||
from panda import Panda
|
||||
from common.conversions import Conversions as CV
|
||||
from selfdrive.car import STD_CARGO_KG, get_safety_config
|
||||
from selfdrive.car import get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
from selfdrive.car.volkswagen.values import CAR, PQ_CARS, CANBUS, NetworkLocation, TransmissionType, GearShifter
|
||||
|
||||
@@ -101,32 +101,32 @@ class CarInterface(CarInterfaceBase):
|
||||
# Per-chassis tuning values, override tuning defaults here if desired
|
||||
|
||||
if candidate == CAR.ARTEON_MK1:
|
||||
ret.mass = 1733 + STD_CARGO_KG
|
||||
ret.mass = 1733
|
||||
ret.wheelbase = 2.84
|
||||
|
||||
elif candidate == CAR.ATLAS_MK1:
|
||||
ret.mass = 2011 + STD_CARGO_KG
|
||||
ret.mass = 2011
|
||||
ret.wheelbase = 2.98
|
||||
|
||||
elif candidate == CAR.CRAFTER_MK2:
|
||||
ret.mass = 2100 + STD_CARGO_KG
|
||||
ret.mass = 2100
|
||||
ret.wheelbase = 3.64 # SWB, LWB is 4.49, TBD how to detect difference
|
||||
ret.minSteerSpeed = 50 * CV.KPH_TO_MS
|
||||
|
||||
elif candidate == CAR.GOLF_MK7:
|
||||
ret.mass = 1397 + STD_CARGO_KG
|
||||
ret.mass = 1397
|
||||
ret.wheelbase = 2.62
|
||||
|
||||
elif candidate == CAR.JETTA_MK7:
|
||||
ret.mass = 1328 + STD_CARGO_KG
|
||||
ret.mass = 1328
|
||||
ret.wheelbase = 2.71
|
||||
|
||||
elif candidate == CAR.PASSAT_MK8:
|
||||
ret.mass = 1551 + STD_CARGO_KG
|
||||
ret.mass = 1551
|
||||
ret.wheelbase = 2.79
|
||||
|
||||
elif candidate == CAR.PASSAT_NMS:
|
||||
ret.mass = 1503 + STD_CARGO_KG
|
||||
ret.mass = 1503
|
||||
ret.wheelbase = 2.80
|
||||
ret.minEnableSpeed = 20 * CV.KPH_TO_MS # ACC "basic", no FtS
|
||||
ret.minSteerSpeed = 50 * CV.KPH_TO_MS
|
||||
@@ -134,86 +134,86 @@ class CarInterface(CarInterfaceBase):
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
|
||||
elif candidate == CAR.POLO_MK6:
|
||||
ret.mass = 1230 + STD_CARGO_KG
|
||||
ret.mass = 1230
|
||||
ret.wheelbase = 2.55
|
||||
|
||||
elif candidate == CAR.SHARAN_MK2:
|
||||
ret.mass = 1639 + STD_CARGO_KG
|
||||
ret.mass = 1639
|
||||
ret.wheelbase = 2.92
|
||||
ret.minSteerSpeed = 50 * CV.KPH_TO_MS
|
||||
ret.steerActuatorDelay = 0.2
|
||||
|
||||
elif candidate == CAR.TAOS_MK1:
|
||||
ret.mass = 1498 + STD_CARGO_KG
|
||||
ret.mass = 1498
|
||||
ret.wheelbase = 2.69
|
||||
|
||||
elif candidate == CAR.TCROSS_MK1:
|
||||
ret.mass = 1150 + STD_CARGO_KG
|
||||
ret.mass = 1150
|
||||
ret.wheelbase = 2.60
|
||||
|
||||
elif candidate == CAR.TIGUAN_MK2:
|
||||
ret.mass = 1715 + STD_CARGO_KG
|
||||
ret.mass = 1715
|
||||
ret.wheelbase = 2.74
|
||||
|
||||
elif candidate == CAR.TOURAN_MK2:
|
||||
ret.mass = 1516 + STD_CARGO_KG
|
||||
ret.mass = 1516
|
||||
ret.wheelbase = 2.79
|
||||
|
||||
elif candidate == CAR.TRANSPORTER_T61:
|
||||
ret.mass = 1926 + STD_CARGO_KG
|
||||
ret.mass = 1926
|
||||
ret.wheelbase = 3.00 # SWB, LWB is 3.40, TBD how to detect difference
|
||||
ret.minSteerSpeed = 14.0
|
||||
|
||||
elif candidate == CAR.TROC_MK1:
|
||||
ret.mass = 1413 + STD_CARGO_KG
|
||||
ret.mass = 1413
|
||||
ret.wheelbase = 2.63
|
||||
|
||||
elif candidate == CAR.AUDI_A3_MK3:
|
||||
ret.mass = 1335 + STD_CARGO_KG
|
||||
ret.mass = 1335
|
||||
ret.wheelbase = 2.61
|
||||
|
||||
elif candidate == CAR.AUDI_Q2_MK1:
|
||||
ret.mass = 1205 + STD_CARGO_KG
|
||||
ret.mass = 1205
|
||||
ret.wheelbase = 2.61
|
||||
|
||||
elif candidate == CAR.AUDI_Q3_MK2:
|
||||
ret.mass = 1623 + STD_CARGO_KG
|
||||
ret.mass = 1623
|
||||
ret.wheelbase = 2.68
|
||||
|
||||
elif candidate == CAR.SEAT_ATECA_MK1:
|
||||
ret.mass = 1900 + STD_CARGO_KG
|
||||
ret.mass = 1900
|
||||
ret.wheelbase = 2.64
|
||||
|
||||
elif candidate == CAR.SEAT_LEON_MK3:
|
||||
ret.mass = 1227 + STD_CARGO_KG
|
||||
ret.mass = 1227
|
||||
ret.wheelbase = 2.64
|
||||
|
||||
elif candidate == CAR.SKODA_FABIA_MK4:
|
||||
ret.mass = 1266 + STD_CARGO_KG
|
||||
ret.mass = 1266
|
||||
ret.wheelbase = 2.56
|
||||
|
||||
elif candidate == CAR.SKODA_KAMIQ_MK1:
|
||||
ret.mass = 1265 + STD_CARGO_KG
|
||||
ret.mass = 1265
|
||||
ret.wheelbase = 2.66
|
||||
|
||||
elif candidate == CAR.SKODA_KAROQ_MK1:
|
||||
ret.mass = 1278 + STD_CARGO_KG
|
||||
ret.mass = 1278
|
||||
ret.wheelbase = 2.66
|
||||
|
||||
elif candidate == CAR.SKODA_KODIAQ_MK1:
|
||||
ret.mass = 1569 + STD_CARGO_KG
|
||||
ret.mass = 1569
|
||||
ret.wheelbase = 2.79
|
||||
|
||||
elif candidate == CAR.SKODA_OCTAVIA_MK3:
|
||||
ret.mass = 1388 + STD_CARGO_KG
|
||||
ret.mass = 1388
|
||||
ret.wheelbase = 2.68
|
||||
|
||||
elif candidate == CAR.SKODA_SCALA_MK1:
|
||||
ret.mass = 1192 + STD_CARGO_KG
|
||||
ret.mass = 1192
|
||||
ret.wheelbase = 2.65
|
||||
|
||||
elif candidate == CAR.SKODA_SUPERB_MK3:
|
||||
ret.mass = 1505 + STD_CARGO_KG
|
||||
ret.mass = 1505
|
||||
ret.wheelbase = 2.84
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user