Skip to content

Commit

Permalink
v_cruise_cluster_kph with an offset
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed Sep 21, 2024
1 parent e573387 commit ffa16e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion selfdrive/car/bmw/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def update(self, cp_PT, cp_F, cp_aux):
ret.steeringAngleDeg = cp_PT.vl['SteeringWheelAngle']['SteeringPosition']
ret.cruiseState.speed = cp_PT.vl["CruiseControlStatus"]['CruiseControlSetpointSpeed'] * (CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS)
ret.cruiseState.enabled = cp_PT.vl["CruiseControlStatus"]['CruiseCoontrolActiveFlag'] != 0
ret.cruiseState.speedCluster = ret.cruiseState.speed + CruiseSettings.CLUSTER_OFFSET * CV.KPH_TO_MS #For logging. Doesn't do anything with pcmCruise = False
ret.cruiseState.speedCluster = ret.cruiseState.speed + CruiseSettings.CLUSTER_OFFSET * CV.KPH_TO_MS
if cruise_control_stal_msg['plus1'] != 0:
self.cruise_stalk_speed = 1
elif cruise_control_stal_msg['minus1'] != 0:
Expand Down
3 changes: 1 addition & 2 deletions selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ def update_v_cruise(self, CS, enabled, is_metric):
if not self.CP.pcmCruise:
# if stock cruise is completely disabled, then we can use our own set speed logic
self._update_v_cruise_non_pcm(CS, enabled, is_metric)
self.v_cruise_cluster_kph = self.v_cruise_kph
self.update_button_timers(CS, enabled)
else:
self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH
self.v_cruise_cluster_kph = CS.cruiseState.speedCluster * CV.MS_TO_KPH
self.v_cruise_cluster_kph = CS.cruiseState.speedCluster * CV.MS_TO_KPH
else:
self.v_cruise_kph = V_CRUISE_UNSET
self.v_cruise_cluster_kph = V_CRUISE_UNSET
Expand Down

0 comments on commit ffa16e5

Please sign in to comment.