Skip to content

Commit

Permalink
steering responds to the model
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Sep 18, 2023
1 parent 39b9fef commit b2f9c8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions selfdrive/car/ocelot/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from selfdrive.config import Conversions as CV
from selfdrive.car.ocelot.values import DBC, BUTTON_STATES

GearShifter = car.CarState.GearShifter

class CarState(CarStateBase):
def __init__(self, CP):
Expand Down Expand Up @@ -35,7 +36,7 @@ def update(self, cp, cp_body):
ret.wheelSpeeds.rl = 60 * CV.KPH_TO_MS
ret.wheelSpeeds.rr = 60 * CV.KPH_TO_MS
ret.brakeLights = False
ret.gearShifter = 'D'
ret.gearShifter = GearShifter.drive

# iBooster data
ret.brakePressed = False
Expand Down Expand Up @@ -67,7 +68,7 @@ def update(self, cp, cp_body):
ret.steeringPressed = False #abs(ret.steeringTorque) > STEER_THRESHOLD
ret.steerWarning = False #cp.vl["STEERING_STATUS"]['STEERING_OK'] != 0

main_on = bool(cp.vl["CRUISE_BUTTONS"]['MAIN_ON'])
main_on = bool(cp.vl["CRUISE_STATE"]['ENABLE'])

ret.cruiseState.available = main_on
ret.cruiseState.standstill = False
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/ocelot/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class CarInterface(CarInterfaceBase):
@staticmethod
def come_gb(accel, speed):
def compute_gb(accel, speed):
return float(accel) / 3.0

@staticmethod
Expand Down

0 comments on commit b2f9c8b

Please sign in to comment.