Skip to content

Commit

Permalink
CC_STEP
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed Aug 21, 2024
1 parent d9d976c commit f649e5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions selfdrive/car/bmw/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

VisualAlert = car.CarControl.HUDControl.VisualAlert

CC_STEP = 1 # cruise single click jump - either km or miles
CC_STEP = 1 # cruise single click jump - always 1 - interpreted as km or miles depending on DSC or DME set units

# Accel limits
ACCEL_HYST_GAP = 0.02 # don't change accel command for small oscilalitons within this value
ACCEL_MAX = 4 # cruise control rapid clicking
Expand Down Expand Up @@ -122,12 +123,12 @@ def update(self, CC, CS, now_nanos):
self.tx_cruise_stalk_counter = self.tx_cruise_stalk_counter + 1
can_sends.append(bmwcan.create_accel_command(self.packer, CruiseStalk.plus1, self.cruise_bus, self.tx_cruise_stalk_counter))
self.last_cruise_cmd_timestamp = now_nanos
self.last_cruise_speed_delta_req = +1
self.last_cruise_speed_delta_req = +CC_STEP
elif CC.enabled and speed_diff_req < -CC_STEP/2 and CS.out.cruiseState.enabled and time_since_cruise_sent > cruise_tick and not CS.out.gasPressed:
self.tx_cruise_stalk_counter = self.tx_cruise_stalk_counter + 1
can_sends.append(bmwcan.create_accel_command(self.packer, CruiseStalk.minus1, self.cruise_bus, self.tx_cruise_stalk_counter))
self.last_cruise_cmd_timestamp = now_nanos
self.last_cruise_speed_delta_req = -1
self.last_cruise_speed_delta_req = -CC_STEP



Expand Down

0 comments on commit f649e5c

Please sign in to comment.