CarInfo: detail sentence exception for Toyota stock longitudinal (#25331)

* Exception for 2022 RAV4

* Exception for all stock long Toyota

Exception for all stock long Toyota

* fix exception

fix

fix

fix
pull/25334/head
Shane Smiskol 3 years ago committed by GitHub
parent d810d45421
commit 35338196ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      selfdrive/car/docs_definitions.py
  2. 8
      selfdrive/debug/print_docs_diff.py

@ -147,11 +147,12 @@ class CarInfo:
else: else:
alc = "" alc = ""
# Exception for Nissan and Subaru which do not auto-resume yet # Exception for Nissan, Subaru, and stock long Toyota which do not auto-resume yet
if CP.carName not in ("nissan", "subaru"):
acc = f" <strong>while driving above {self.min_enable_speed * CV.MS_TO_MPH:.0f} mph</strong>" if self.min_enable_speed > 0 else " <strong>that automatically resumes from a stop</strong>"
else:
acc = "" acc = ""
if self.min_enable_speed > 0:
acc = f" <strong>while driving above {self.min_enable_speed * CV.MS_TO_MPH:.0f} mph</strong>"
elif CP.carName not in ("nissan", "subaru", "toyota") or (CP.carName == "toyota" and CP.openpilotLongitudinalControl):
acc = " <strong>that automatically resumes from a stop</strong>"
if self.row[Column.STEERING_TORQUE] != Star.FULL: if self.row[Column.STEERING_TORQUE] != Star.FULL:
sentence_builder += " This car may not be able to take tight turns on its own." sentence_builder += " This car may not be able to take tight turns on its own."

@ -83,7 +83,7 @@ def print_car_info_diff(path):
for new_car, base_car in car_changes: for new_car, base_car in car_changes:
# Tier changes # Tier changes
if base_car.tier != new_car.tier: if base_car.tier != new_car.tier:
changes["tier"].append(f"- Tier for {base_car.make} {base_car.name} changed! ({base_car.tier.name.title()} {ARROW_SYMBOL} {new_car.tier.name.title()})") changes["tier"].append(f"- Tier for {base_car.name} changed! ({base_car.tier.name.title()} {ARROW_SYMBOL} {new_car.tier.name.title()})")
# Column changes # Column changes
row_diff = build_column_diff(base_car, new_car) row_diff = build_column_diff(base_car, new_car)
@ -92,10 +92,10 @@ def print_car_info_diff(path):
# Detail sentence changes # Detail sentence changes
if base_car.detail_sentence != new_car.detail_sentence: if base_car.detail_sentence != new_car.detail_sentence:
changes["detail"].append(f"- Sentence for {base_car.make} {base_car.name} changed!\n" + changes["detail"].append(f"- Sentence for {base_car.name} changed!\n" +
" ```diff\n" + " ```diff\n" +
f" + {base_car.detail_sentence}\n" + f" - {base_car.detail_sentence}\n" +
f" - {new_car.detail_sentence}\n" + f" + {new_car.detail_sentence}\n" +
" ```") " ```")
# Print diff # Print diff

Loading…
Cancel
Save