Skip to content

Commit

Permalink
Merge pull request commaai#65 from AskAlice/HKG_community
Browse files Browse the repository at this point in the history
door detection.
  • Loading branch information
xx979xx authored Mar 7, 2020
2 parents 41ab12d + a66f0ec commit 4c21ba2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions selfdrive/car/hyundai/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ def get_can_parser(CP):

("CF_Gway_DrvSeatBeltInd", "CGW4", 1),

("CF_Gway_DrvSeatBeltSw", "CGW1", 0),
("CF_Gway_DrvSeatBeltSw", "CGW1", 0), # Driver Seatbelt
("CF_Gway_DrvDrSw", "CGW1", 0), # Driver Door is open
("CF_Gway_AstDrSw", "CGW1", 0), # Passenger door is open
("CF_Gway_RLDrSw", "CGW2", 0), # Rear reft door is open
("CF_Gway_RRDrSw", "CGW2", 0), # Rear right door is open
("CF_Gway_TSigLHSw", "CGW1", 0),
("CF_Gway_TurnSigLh", "CGW1", 0),
("CF_Gway_TSigRHSw", "CGW1", 0),
("CF_Gway_TurnSigRh", "CGW1", 0),
("CF_Gway_ParkBrakeSw", "CGW1", 0),
("CF_Gway_ParkBrakeSw", "CGW1", 0), # Parking Brake

("BRAKE_ACT", "EMS12", 0),
("PV_AV_CAN", "EMS12", 0),
Expand Down Expand Up @@ -298,8 +302,9 @@ def update(self, cp, cp2, cp_cam):
# update prevs, update must run once per Loop
self.prev_left_blinker_on = self.left_blinker_on
self.prev_right_blinker_on = self.right_blinker_on

self.door_all_closed = True

self.door_all_closed = not any([cp.vl["CGW1"]['CF_Gway_DrvDrSw'],cp.vl["CGW1"]['CF_Gway_AstDrSw'],
cp.vl["CGW2"]['CF_Gway_RLDrSw'], cp.vl["CGW2"]['CF_Gway_RRDrSw']])
self.seatbelt = cp.vl["CGW1"]['CF_Gway_DrvSeatBeltSw']

self.brake_pressed = cp.vl["TCS13"]['DriverBraking']
Expand Down

0 comments on commit 4c21ba2

Please sign in to comment.