mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 18:53:55 +08:00
Hyundai: common CAN-FD brake pressed signal (#26170)
* Hyundai: common CAN-FD brake pressed signal * new name * bump panda * bump opendbc to master * bump opendbc * bump panda * bump panda Co-authored-by: Shane Smiskol <shane@smiskol.com>
This commit is contained in:
2
opendbc
2
opendbc
Submodule opendbc updated: 8f245e6ef5...7bd94e3ff4
2
panda
2
panda
Submodule panda updated: 54f9390ff5...fcb1a5a8e2
@@ -159,7 +159,7 @@ class CarState(CarStateBase):
|
||||
elif self.CP.carFingerprint in HYBRID_CAR:
|
||||
ret.gas = cp.vl["ACCELERATOR_ALT"]["ACCELERATOR_PEDAL"] / 1023.
|
||||
ret.gasPressed = ret.gas > 1e-5
|
||||
ret.brakePressed = cp.vl["BRAKE"]["BRAKE_PRESSED"] == 1
|
||||
ret.brakePressed = cp.vl["TCS"]["DriverBraking"] == 1
|
||||
|
||||
ret.doorOpen = cp.vl["DOORS_SEATBELTS"]["DRIVER_DOOR_OPEN"] == 1
|
||||
ret.seatbeltUnlatched = cp.vl["DOORS_SEATBELTS"]["DRIVER_SEATBELT_LATCHED"] == 0
|
||||
@@ -415,7 +415,6 @@ class CarState(CarStateBase):
|
||||
("WHEEL_SPEED_4", "WHEEL_SPEEDS"),
|
||||
|
||||
("GEAR", "GEAR_SHIFTER"),
|
||||
("BRAKE_PRESSED", "BRAKE"),
|
||||
|
||||
("STEERING_RATE", "STEERING_SENSORS"),
|
||||
("STEERING_ANGLE", "STEERING_SENSORS"),
|
||||
@@ -423,7 +422,8 @@ class CarState(CarStateBase):
|
||||
("STEERING_OUT_TORQUE", "MDPS"),
|
||||
("LKA_FAULT", "MDPS"),
|
||||
|
||||
("CRUISE_ACTIVE", "SCC1"),
|
||||
("DriverBraking", "TCS"),
|
||||
|
||||
("COUNTER", cruise_btn_msg),
|
||||
("CRUISE_BUTTONS", cruise_btn_msg),
|
||||
("ADAPTIVE_CRUISE_MAIN_BTN", cruise_btn_msg),
|
||||
@@ -443,7 +443,7 @@ class CarState(CarStateBase):
|
||||
("BRAKE", 100),
|
||||
("STEERING_SENSORS", 100),
|
||||
("MDPS", 100),
|
||||
("SCC1", 50),
|
||||
("TCS", 50),
|
||||
(cruise_btn_msg, 50),
|
||||
("CLUSTER_INFO", 4),
|
||||
("BLINKERS", 4),
|
||||
|
||||
@@ -54,6 +54,7 @@ def can_printer(bus=0, init_msgs=None, new_msgs=None, table=False):
|
||||
update(new_msgs, bus, dat, low_to_high, high_to_low)
|
||||
else:
|
||||
# Live mode
|
||||
print(f"Waiting for messages on bus {bus}")
|
||||
try:
|
||||
while 1:
|
||||
can_recv = messaging.drain_sock(logcan)
|
||||
@@ -89,14 +90,17 @@ if __name__ == "__main__":
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("--bus", type=int, help="CAN bus to print out", default=0)
|
||||
parser.add_argument("--table", action="store_true", help="Print a cabana-like table")
|
||||
parser.add_argument("init", type=str, nargs='?', help="Route or segment to initialize with")
|
||||
parser.add_argument("init", type=str, nargs='?', help="Route or segment to initialize with. Use empty quotes to compare against all zeros.")
|
||||
parser.add_argument("comp", type=str, nargs='?', help="Route or segment to compare against init")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
init_lr, new_lr = None, None
|
||||
if args.init:
|
||||
init_lr = logreader_from_route_or_segment(args.init)
|
||||
if args.init == '':
|
||||
init_lr = []
|
||||
else:
|
||||
init_lr = logreader_from_route_or_segment(args.init)
|
||||
if args.comp:
|
||||
new_lr = logreader_from_route_or_segment(args.comp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user