Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/cereal/car.capnp b/cereal/car.capnp
- index be31f66..8e81926 100644
- --- a/cereal/car.capnp
- +++ b/cereal/car.capnp
- @@ -98,6 +98,8 @@ struct CarState {
- leftBlinker @20 :Bool;
- rightBlinker @21 :Bool;
- genericToggle @23 :Bool;
- + distanceToggle @26 :Bool;
- + laneDepartureToggle @27 :Bool;
- # lock info
- doorOpen @24 :Bool;
- diff --git a/opendbc/toyota_rav4_2017_pt_generated.dbc b/opendbc/toyota_rav4_2017_pt_generated.dbc
- index 3301bc0..911cc87 100644
- --- a/opendbc/toyota_rav4_2017_pt_generated.dbc
- +++ b/opendbc/toyota_rav4_2017_pt_generated.dbc
- @@ -57,6 +57,9 @@ BO_ 180 SPEED: 8 XXX
- SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
- SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX
- +BO_ 352 NEW_MSG_1: 8 XXX
- + SG_ LANE_DEPARTURE_BUTTON : 39|1@0+ (1,0) [0|1] "" XXX
- +
- BO_ 466 PCM_CRUISE: 8 XXX
- SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX
- SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX
- @@ -97,6 +100,7 @@ BO_ 742 LEAD_INFO: 8 DSU
- BO_ 835 ACC_CONTROL: 8 DSU
- SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
- + SG_ ACC_DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
- BO_ 1556 STEERING_LEVERS: 8 XXX
- SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX
- diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py
- index 3fd19f9..40417d8 100644
- --- a/selfdrive/car/toyota/carcontroller.py
- +++ b/selfdrive/car/toyota/carcontroller.py
- @@ -76,6 +76,20 @@ class CarController(object):
- def update(self, sendcan, enabled, CS, frame, actuators,
- pcm_cancel_cmd, hud_alert, audible_alert):
- +
- + # init Button Tests
- + if CS.distance_toggle:
- + actuators.steer = 1.0
- + with open("/distance.log", "a") as distance:
- + distance.write("pressed once")
- + if CS.lane_departure_toggle:
- + actuators.steer = 1.0
- + with open("/lane.log", "a") as lane:
- + lane.write("pressed once")
- + if CS.generic_toggle:
- + actuators.steer = 1.0
- + with open("/generic.log", "a") as generic:
- + generic.write("pressed once")
- # *** compute control surfaces ***
- diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py
- index 24fc852..ee74889 100644
- --- a/selfdrive/car/toyota/carstate.py
- +++ b/selfdrive/car/toyota/carstate.py
- @@ -77,6 +77,8 @@ def get_can_parser(CP):
- ("LKA_STATE", "EPS_STATUS", 0),
- ("BRAKE_LIGHTS_ACC", "ESP_CONTROL", 0),
- ("AUTO_HIGH_BEAM", "LIGHT_STALK", 0),
- + ("ACC_DISTANCE", "ACC_CONTROL", 0),
- + ("LANE_DEPARTURE_BUTTON", "NEW_MSG_1", 0),
- ]
- checks = [
- @@ -171,3 +173,5 @@ class CarState(object):
- self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]['LOW_SPEED_LOCKOUT'] == 2
- self.brake_lights = bool(cp.vl["ESP_CONTROL"]['BRAKE_LIGHTS_ACC'] or self.brake_pressed)
- self.generic_toggle = bool(cp.vl["LIGHT_STALK"]['AUTO_HIGH_BEAM'])
- + self.lane_departure_toggle = bool(cp.vl["NEW_MSG_1"]['LANE_DEPARTURE_BUTTON'])
- + self.distance_toggle = bool(cp.vl["ACC_CONTROL"]['ACC_DISTANCE'])
- diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py
- index 53cfbb1..9bf07d4 100755
- --- a/selfdrive/car/toyota/interface.py
- +++ b/selfdrive/car/toyota/interface.py
- @@ -239,7 +239,15 @@ class CarInterface(object):
- ret.seatbeltUnlatched = not self.CS.seatbelt
- ret.genericToggle = self.CS.generic_toggle
- -
- + ret.laneDepartureToggle = self.CS.lane_departure_toggle
- + ret.distanceToggle = self.CS.distance_toggle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement