Skip to content

Commit

Permalink
docs: don't support multi-type car info (#31875)
Browse files Browse the repository at this point in the history
don't support multi-type car info
  • Loading branch information
sshane authored Mar 15, 2024
1 parent d5852ab commit bdae188
Show file tree
Hide file tree
Showing 15 changed files with 149 additions and 155 deletions.
5 changes: 1 addition & 4 deletions selfdrive/car/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ def update(self, current_value, current_counter):
return self.rate


CarInfos = CarInfo | list[CarInfo] | None


@dataclass(frozen=True, kw_only=True)
class CarSpecs:
mass: float # kg, curb weight
Expand All @@ -265,7 +262,7 @@ def override(self, **kwargs):
@dataclass(order=True)
class PlatformConfig(Freezable):
platform_str: str
car_info: CarInfos
car_info: list[CarInfo]
specs: CarSpecs

dbc_dict: DbcDict
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/body/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, CP):
class CAR(Platforms):
BODY = PlatformConfig(
"COMMA BODY",
CarInfo("comma body", package="All"),
[CarInfo("comma body", package="All")],
CarSpecs(mass=9, wheelbase=0.406, steerRatio=0.5, centerToFrontRatio=0.44),
dbc_dict('comma_body', None),
)
Expand Down
16 changes: 8 additions & 8 deletions selfdrive/car/chrysler/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ class CAR(Platforms):
# Chrysler
PACIFICA_2017_HYBRID = ChryslerPlatformConfig(
"CHRYSLER PACIFICA HYBRID 2017",
ChryslerCarInfo("Chrysler Pacifica Hybrid 2017"),
[ChryslerCarInfo("Chrysler Pacifica Hybrid 2017")],
ChryslerCarSpecs(mass=2242., wheelbase=3.089, steerRatio=16.2),
)
PACIFICA_2018_HYBRID = ChryslerPlatformConfig(
"CHRYSLER PACIFICA HYBRID 2018",
ChryslerCarInfo("Chrysler Pacifica Hybrid 2018"),
[ChryslerCarInfo("Chrysler Pacifica Hybrid 2018")],
PACIFICA_2017_HYBRID.specs,
)
PACIFICA_2019_HYBRID = ChryslerPlatformConfig(
"CHRYSLER PACIFICA HYBRID 2019",
ChryslerCarInfo("Chrysler Pacifica Hybrid 2019-23"),
[ChryslerCarInfo("Chrysler Pacifica Hybrid 2019-23")],
PACIFICA_2017_HYBRID.specs,
)
PACIFICA_2018 = ChryslerPlatformConfig(
"CHRYSLER PACIFICA 2018",
ChryslerCarInfo("Chrysler Pacifica 2017-18"),
[ChryslerCarInfo("Chrysler Pacifica 2017-18")],
PACIFICA_2017_HYBRID.specs,
)
PACIFICA_2020 = ChryslerPlatformConfig(
Expand All @@ -64,27 +64,27 @@ class CAR(Platforms):
# Dodge
DODGE_DURANGO = ChryslerPlatformConfig(
"DODGE DURANGO 2021",
ChryslerCarInfo("Dodge Durango 2020-21"),
[ChryslerCarInfo("Dodge Durango 2020-21")],
PACIFICA_2017_HYBRID.specs,
)

# Jeep
JEEP_GRAND_CHEROKEE = ChryslerPlatformConfig( # includes 2017 Trailhawk
"JEEP GRAND CHEROKEE V6 2018",
ChryslerCarInfo("Jeep Grand Cherokee 2016-18", video_link="https://www.youtube.com/watch?v=eLR9o2JkuRk"),
[ChryslerCarInfo("Jeep Grand Cherokee 2016-18", video_link="https://www.youtube.com/watch?v=eLR9o2JkuRk")],
ChryslerCarSpecs(mass=1778., wheelbase=2.71, steerRatio=16.7),
)

JEEP_GRAND_CHEROKEE_2019 = ChryslerPlatformConfig( # includes 2020 Trailhawk
"JEEP GRAND CHEROKEE 2019",
ChryslerCarInfo("Jeep Grand Cherokee 2019-21", video_link="https://www.youtube.com/watch?v=jBe4lWnRSu4"),
[ChryslerCarInfo("Jeep Grand Cherokee 2019-21", video_link="https://www.youtube.com/watch?v=jBe4lWnRSu4")],
JEEP_GRAND_CHEROKEE.specs,
)

# Ram
RAM_1500 = ChryslerPlatformConfig(
"RAM 1500 5TH GEN",
ChryslerCarInfo("Ram 1500 2019-24", car_parts=CarParts.common([CarHarness.ram])),
[ChryslerCarInfo("Ram 1500 2019-24", car_parts=CarParts.common([CarHarness.ram]))],
ChryslerCarSpecs(mass=2493., wheelbase=3.88, steerRatio=16.3, minSteerSpeed=14.5),
dbc_dict('chrysler_ram_dt_generated', None),
)
Expand Down
5 changes: 1 addition & 4 deletions selfdrive/car/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ def get_all_car_info() -> list[CarInfo]:
CP = interfaces[model][0].get_params(platform, fingerprint=gen_empty_fingerprint(),
car_fw=[car.CarParams.CarFw(ecu="unknown")], experimental_long=True, docs=True)

if CP.dashcamOnly or car_info is None:
if CP.dashcamOnly or not len(car_info):
continue

# A platform can include multiple car models
if not isinstance(car_info, list):
car_info = [car_info,]

for _car_info in car_info:
if not hasattr(_car_info, "row"):
_car_info.init_make(CP)
Expand Down
6 changes: 3 additions & 3 deletions selfdrive/car/ford/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def init(self):
class CAR(Platforms):
BRONCO_SPORT_MK1 = FordPlatformConfig(
"FORD BRONCO SPORT 1ST GEN",
FordCarInfo("Ford Bronco Sport 2021-23"),
[FordCarInfo("Ford Bronco Sport 2021-23")],
CarSpecs(mass=1625, wheelbase=2.67, steerRatio=17.7),
)
ESCAPE_MK4 = FordPlatformConfig(
Expand Down Expand Up @@ -121,7 +121,7 @@ class CAR(Platforms):
)
F_150_LIGHTNING_MK1 = FordCANFDPlatformConfig(
"FORD F-150 LIGHTNING 1ST GEN",
FordCarInfo("Ford F-150 Lightning 2021-23", "Co-Pilot360 Active 2.0"),
[FordCarInfo("Ford F-150 Lightning 2021-23", "Co-Pilot360 Active 2.0")],
CarSpecs(mass=2948, wheelbase=3.70, steerRatio=16.9),
)
FOCUS_MK4 = FordPlatformConfig(
Expand All @@ -144,7 +144,7 @@ class CAR(Platforms):
)
MUSTANG_MACH_E_MK1 = FordCANFDPlatformConfig(
"FORD MUSTANG MACH-E 1ST GEN",
FordCarInfo("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0"),
[FordCarInfo("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0")],
CarSpecs(mass=2200, wheelbase=2.984, steerRatio=17.0), # TODO: check steer ratio
)

Expand Down
24 changes: 12 additions & 12 deletions selfdrive/car/gm/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,52 +92,52 @@ class GMPlatformConfig(PlatformConfig):
class CAR(Platforms):
HOLDEN_ASTRA = GMPlatformConfig(
"HOLDEN ASTRA RS-V BK 2017",
GMCarInfo("Holden Astra 2017"),
[GMCarInfo("Holden Astra 2017")],
GMCarSpecs(mass=1363, wheelbase=2.662, steerRatio=15.7, centerToFrontRatio=0.4),
)
VOLT = GMPlatformConfig(
"CHEVROLET VOLT PREMIER 2017",
GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ"),
[GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ")],
GMCarSpecs(mass=1607, wheelbase=2.69, steerRatio=17.7, centerToFrontRatio=0.45, tireStiffnessFactor=0.469),
)
CADILLAC_ATS = GMPlatformConfig(
"CADILLAC ATS Premium Performance 2018",
GMCarInfo("Cadillac ATS Premium Performance 2018"),
[GMCarInfo("Cadillac ATS Premium Performance 2018")],
GMCarSpecs(mass=1601, wheelbase=2.78, steerRatio=15.3),
)
MALIBU = GMPlatformConfig(
"CHEVROLET MALIBU PREMIER 2017",
GMCarInfo("Chevrolet Malibu Premier 2017"),
[GMCarInfo("Chevrolet Malibu Premier 2017")],
GMCarSpecs(mass=1496, wheelbase=2.83, steerRatio=15.8, centerToFrontRatio=0.4),
)
ACADIA = GMPlatformConfig(
"GMC ACADIA DENALI 2018",
GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"),
[GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo")],
GMCarSpecs(mass=1975, wheelbase=2.86, steerRatio=14.4, centerToFrontRatio=0.4),
)
BUICK_LACROSSE = GMPlatformConfig(
"BUICK LACROSSE 2017",
GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2"),
[GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2")],
GMCarSpecs(mass=1712, wheelbase=2.91, steerRatio=15.8, centerToFrontRatio=0.4),
)
BUICK_REGAL = GMPlatformConfig(
"BUICK REGAL ESSENCE 2018",
GMCarInfo("Buick Regal Essence 2018"),
[GMCarInfo("Buick Regal Essence 2018")],
GMCarSpecs(mass=1714, wheelbase=2.83, steerRatio=14.4, centerToFrontRatio=0.4),
)
ESCALADE = GMPlatformConfig(
"CADILLAC ESCALADE 2017",
GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"),
[GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package")],
GMCarSpecs(mass=2564, wheelbase=2.95, steerRatio=17.3),
)
ESCALADE_ESV = GMPlatformConfig(
"CADILLAC ESCALADE ESV 2016",
GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"),
[GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS")],
GMCarSpecs(mass=2739, wheelbase=3.302, steerRatio=17.3, tireStiffnessFactor=1.0),
)
ESCALADE_ESV_2019 = GMPlatformConfig(
"CADILLAC ESCALADE ESV 2019",
GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"),
[GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS")],
ESCALADE_ESV.specs,
)
BOLT_EUV = GMPlatformConfig(
Expand All @@ -158,12 +158,12 @@ class CAR(Platforms):
)
EQUINOX = GMPlatformConfig(
"CHEVROLET EQUINOX 2019",
GMCarInfo("Chevrolet Equinox 2019-22"),
[GMCarInfo("Chevrolet Equinox 2019-22")],
GMCarSpecs(mass=1588, wheelbase=2.72, steerRatio=14.4, centerToFrontRatio=0.4),
)
TRAILBLAZER = GMPlatformConfig(
"CHEVROLET TRAILBLAZER 2021",
GMCarInfo("Chevrolet Trailblazer 2021-22"),
[GMCarInfo("Chevrolet Trailblazer 2021-22")],
GMCarSpecs(mass=1345, wheelbase=2.64, steerRatio=16.8, centerToFrontRatio=0.4, tireStiffnessFactor=1.0),
)

Expand Down
36 changes: 18 additions & 18 deletions selfdrive/car/honda/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class CAR(Platforms):
)
CIVIC_BOSCH_DIESEL = HondaBoschPlatformConfig(
"HONDA CIVIC SEDAN 1.6 DIESEL 2019",
None, # don't show in docs
[], # don't show in docs
CIVIC_BOSCH.specs,
dbc_dict('honda_accord_2018_can_generated', None),
)
Expand All @@ -154,106 +154,106 @@ class CAR(Platforms):
)
CRV_5G = HondaBoschPlatformConfig(
"HONDA CR-V 2017",
HondaCarInfo("Honda CR-V 2017-22", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda CR-V 2017-22", min_steer_speed=12. * CV.MPH_TO_MS)],
# steerRatio: 12.3 is spec end-to-end
CarSpecs(mass=3410 * CV.LB_TO_KG, wheelbase=2.66, steerRatio=16.0, centerToFrontRatio=0.41, tireStiffnessFactor=0.677),
dbc_dict('honda_crv_ex_2017_can_generated', None, body_dbc='honda_crv_ex_2017_body_generated'),
flags=HondaFlags.BOSCH_ALT_BRAKE,
)
CRV_HYBRID = HondaBoschPlatformConfig(
"HONDA CR-V HYBRID 2019",
HondaCarInfo("Honda CR-V Hybrid 2017-20", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda CR-V Hybrid 2017-20", min_steer_speed=12. * CV.MPH_TO_MS)],
# mass: mean of 4 models in kg, steerRatio: 12.3 is spec end-to-end
CarSpecs(mass=1667, wheelbase=2.66, steerRatio=16, centerToFrontRatio=0.41, tireStiffnessFactor=0.677),
dbc_dict('honda_accord_2018_can_generated', None),
)
HRV_3G = HondaBoschPlatformConfig(
"HONDA HR-V 2023",
HondaCarInfo("Honda HR-V 2023", "All"),
[HondaCarInfo("Honda HR-V 2023", "All")],
CarSpecs(mass=3125 * CV.LB_TO_KG, wheelbase=2.61, steerRatio=15.2, centerToFrontRatio=0.41, tireStiffnessFactor=0.5),
dbc_dict('honda_civic_ex_2022_can_generated', None),
flags=HondaFlags.BOSCH_RADARLESS | HondaFlags.BOSCH_ALT_BRAKE,
)
ACURA_RDX_3G = HondaBoschPlatformConfig(
"ACURA RDX 2020",
HondaCarInfo("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
[HondaCarInfo("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS)],
CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41, tireStiffnessFactor=0.677), # as spec
dbc_dict('acura_rdx_2020_can_generated', None),
flags=HondaFlags.BOSCH_ALT_BRAKE,
)
INSIGHT = HondaBoschPlatformConfig(
"HONDA INSIGHT 2019",
HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
[HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS)],
CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.0, centerToFrontRatio=0.39, tireStiffnessFactor=0.82), # as spec
dbc_dict('honda_insight_ex_2019_can_generated', None),
)
HONDA_E = HondaBoschPlatformConfig(
"HONDA E 2020",
HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS),
[HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS)],
CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71, tireStiffnessFactor=0.82),
dbc_dict('acura_rdx_2020_can_generated', None),
)

# Nidec Cars
ACURA_ILX = HondaNidecPlatformConfig(
"ACURA ILX 2016",
HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS),
[HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS)],
CarSpecs(mass=3095 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=18.61, centerToFrontRatio=0.37, tireStiffnessFactor=0.72), # 15.3 is spec end-to-end
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
CRV = HondaNidecPlatformConfig(
"HONDA CR-V 2016",
HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS)],
CarSpecs(mass=3572 * CV.LB_TO_KG, wheelbase=2.62, steerRatio=16.89, centerToFrontRatio=0.41, tireStiffnessFactor=0.444), # as spec
dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
CRV_EU = HondaNidecPlatformConfig(
"HONDA CR-V EU 2016",
None, # Euro version of CRV Touring, don't show in docs
[], # Euro version of CRV Touring, don't show in docs
CRV.specs,
dbc_dict('honda_crv_executive_2016_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
FIT = HondaNidecPlatformConfig(
"HONDA FIT 2018",
HondaCarInfo("Honda Fit 2018-20", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda Fit 2018-20", min_steer_speed=12. * CV.MPH_TO_MS)],
CarSpecs(mass=2644 * CV.LB_TO_KG, wheelbase=2.53, steerRatio=13.06, centerToFrontRatio=0.39, tireStiffnessFactor=0.75),
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
FREED = HondaNidecPlatformConfig(
"HONDA FREED 2020",
HondaCarInfo("Honda Freed 2020", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda Freed 2020", min_steer_speed=12. * CV.MPH_TO_MS)],
CarSpecs(mass=3086. * CV.LB_TO_KG, wheelbase=2.74, steerRatio=13.06, centerToFrontRatio=0.39, tireStiffnessFactor=0.75), # mostly copied from FIT
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
HRV = HondaNidecPlatformConfig(
"HONDA HRV 2019",
HondaCarInfo("Honda HR-V 2019-22", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda HR-V 2019-22", min_steer_speed=12. * CV.MPH_TO_MS)],
HRV_3G.specs,
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
ODYSSEY = HondaNidecPlatformConfig(
"HONDA ODYSSEY 2018",
HondaCarInfo("Honda Odyssey 2018-20"),
[HondaCarInfo("Honda Odyssey 2018-20")],
CarSpecs(mass=1900, wheelbase=3.0, steerRatio=14.35, centerToFrontRatio=0.41, tireStiffnessFactor=0.82),
dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_PCM_ACCEL,
)
ODYSSEY_CHN = HondaNidecPlatformConfig(
"HONDA ODYSSEY CHN 2019",
None, # Chinese version of Odyssey, don't show in docs
[], # Chinese version of Odyssey, don't show in docs
ODYSSEY.specs,
dbc_dict('honda_odyssey_extreme_edition_2018_china_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
ACURA_RDX = HondaNidecPlatformConfig(
"ACURA RDX 2018",
HondaCarInfo("Acura RDX 2016-18", "AcuraWatch Plus", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Acura RDX 2016-18", "AcuraWatch Plus", min_steer_speed=12. * CV.MPH_TO_MS)],
CarSpecs(mass=3925 * CV.LB_TO_KG, wheelbase=2.68, steerRatio=15.0, centerToFrontRatio=0.38, tireStiffnessFactor=0.444), # as spec
dbc_dict('acura_rdx_2018_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
Expand All @@ -270,14 +270,14 @@ class CAR(Platforms):
)
RIDGELINE = HondaNidecPlatformConfig(
"HONDA RIDGELINE 2017",
HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS),
[HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS)],
CarSpecs(mass=4515 * CV.LB_TO_KG, wheelbase=3.18, centerToFrontRatio=0.41, steerRatio=15.59, tireStiffnessFactor=0.444), # as spec
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
CIVIC = HondaNidecPlatformConfig(
"HONDA CIVIC 2016",
HondaCarInfo("Honda Civic 2016-18", min_steer_speed=12. * CV.MPH_TO_MS, video_link="https://youtu.be/-IkImTe1NYE"),
[HondaCarInfo("Honda Civic 2016-18", min_steer_speed=12. * CV.MPH_TO_MS, video_link="https://youtu.be/-IkImTe1NYE")],
CarSpecs(mass=1326, wheelbase=2.70, centerToFrontRatio=0.4, steerRatio=15.38), # 10.93 is end-to-end spec
dbc_dict('honda_civic_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
)
Expand Down
Loading

0 comments on commit bdae188

Please sign in to comment.