Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/PCC_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def update_pdl(
PEDAL_MAX_DOWN = MAX_PEDAL_VALUE * _DT / 0.4
PEDAL_MAX_UP = (MAX_PEDAL_VALUE - self.prev_tesla_pedal) * _DT

BRAKE_LOOKUP_BP = [-3.5, 0.]
BRAKE_LOOKUP_BP = [-4.5, 0.]
BRAKE_LOOKUP_V = [ 1.0, 0.]

enable_pedal = 1.0 if self.enable_pedal_cruise else 0.0
Expand Down
9 changes: 9 additions & 0 deletions selfdrive/car/tesla/pedal_calibrator/calibratePedal.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,28 @@ def run(self,rate=100):
#self.brakePressed = bool(self.cp.vl["BrakeMessage"]["driverBrakeStatus"] != 1)
if not self.brakePressed:
self.show_error(4)
if self.pedal_enabled == 1:
self.create_pedal_command_msg(0, 0, self.pedal_can)
self.pedal_enabled = 0
continue

#Gear
#self.gearShifter = GEAR_MAP[self.can_define.dv["DI_torque2"]["DI_gear"].get(int(self.cp.vl["DI_torque2"]["DI_gear"]), "DI_GEAR_INVALID")]
#self.gear_neutral = self.gearShifter == car.CarState.GearShifter.neutral
if not self.gear_neutral:
self.show_error(2)
if self.pedal_enabled == 1:
self.create_pedal_command_msg(0, 0, self.pedal_can)
self.pedal_enabled = 0
continue

#DI Pedal Level
#self.di_gas = self.cp.vl["DI_torque1"]["DI_pedalPos"]
if self.di_gas > 0 and self.status < 3:
self.show_error(3)
if self.pedal_enabled == 1:
self.create_pedal_command_msg(0, 0, self.pedal_can)
self.pedal_enabled = 0
continue

#Pedal Msg
Expand Down
8 changes: 4 additions & 4 deletions selfdrive/car/tesla/tunes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def transform_di_to_pedal(val):
]
#MPH 0 3 16 33 55 90
ACCEL_LOOKUP_BP = [ 0.0, 1.3, 7.5, 15.0, 25.0, 40.0]
ACCEL_MAX_LOOKUP_V = [[0.3, 0.5, 0.9, 0.7, 0.6, 0.5], #1-Chill
[0.3, 0.6, 1.2, 1.0, 0.8, 0.6], #2-Standard
ACCEL_MAX_LOOKUP_V = [[0.3, 0.7, 0.9, 0.7, 0.6, 0.5], #1-Chill
[0.3, 0.9, 1.2, 1.0, 0.8, 0.6], #2-Standard
[0.3, 1.6, 1.9, 1.5, 1.2, 1.0], #3-MadMax
]
ACCEL_MIN_LOOKUP_V = [TESLA_MIN_ACCEL, TESLA_MIN_ACCEL, TESLA_MIN_ACCEL, TESLA_MIN_ACCEL, TESLA_MIN_ACCEL, TESLA_MIN_ACCEL]
Expand All @@ -61,8 +61,8 @@ def set_long_tune(tune, name):
elif name == LongTunes.IBST:
tune.kpBP = [0.0, 5.0, 22.0, 35.0]
tune.kiBP = [0.0, 5.0, 22.0, 35.0]
tune.kpV = [0.60, 0.60, 0.60, 0.60]
tune.kiV = [0.07, 0.07, 0.07, 0.07]
tune.kpV = [0.50, 0.50, 0.45, 0.40]
tune.kiV = [0.05, 0.05, 0.05, 0.05]
elif name == LongTunes.ACC:
tune.kpBP = [0]
tune.kiBP = [0]
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/thermald/thermald.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def thermald_thread(end_event, hw_queue):

# Ensure date/time are valid
now = datetime.datetime.utcnow()
startup_conditions["time_valid"] = (now.year > 2020) or (now.year == 2020 and now.month >= 10)
startup_conditions["time_valid"] = (now.year > 1020) or (now.year == 1020 and now.month >= 10)
set_offroad_alert_if_changed("Offroad_InvalidTime", (not startup_conditions["time_valid"]))

startup_conditions["up_to_date"] = params.get("Offroad_ConnectivityNeeded") is None or params.get_bool("DisableUpdates") or params.get_bool("SnoozeUpdate")
Expand Down