Skip to content

Commit

Permalink
Merge pull request #3 from bitshop/sr_KphVsMph_Cruise_Display
Browse files Browse the repository at this point in the history
Sr kph vs mph cruise display
  • Loading branch information
bitshop authored Jun 21, 2018
2 parents 4b10a64 + 119ef49 commit d3a20ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion selfdrive/car/tesla/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def get_can_signals(CP):
("TSL_P_Psd_StW","SBW_RQ_SCCM" , 0),
("TurnIndLvr_Stat", "STW_ACTN_RQ", 0),
("DI_motorRPM", "DI_torque1", 0),
("DI_speedUnits", "DI_state", 0),

]

Expand Down Expand Up @@ -219,7 +220,10 @@ def update(self, cp):

self.user_brake = cp.vl["DI_torque2"]['DI_brakePedal']
self.standstill = cp.vl["DI_torque2"]['DI_vehicleSpeed'] == 0
self.v_cruise_pcm = cp.vl["DI_state"]['DI_cruiseSet']
if cp.vl["DI_state"]['DI_speedUnits'] == 0:
self.v_cruise_pcm = (cp.vl["DI_state"]['DI_cruiseSet'])*1.609 # Reported in MPH, expected in KPH??
else:
self.v_cruise_pcm = cp.vl["DI_state"]['DI_cruiseSet']
self.pcm_acc_status = cp.vl["DI_state"]['DI_cruiseState']
self.hud_lead = 0 #JCT

Expand Down

0 comments on commit d3a20ff

Please sign in to comment.