clean up toyotacan from opendbc change

pull/27494/head
Shane Smiskol 3 years ago
parent a6cc41e5ab
commit 6ef1ee4ed9
  1. 2
      common/op_params.py
  2. 13
      selfdrive/car/toyota/toyotacan.py

@ -103,7 +103,7 @@ class opParams:
'PERCENTAGE': Param(100, NUMBER, '100 when not touching wheel, 0 when touching wheel', live=True),
'SETME_X64': Param(100, NUMBER, 'Unsure', live=True),
'ANGLE': Param(0, NUMBER, 'Rate limit? Lower is better?', live=True),
'LTA_REQUEST_TYPE': Param(1, NUMBER, '1: LTA, 3: LTA for lane keeping', live=True),
# 'LKA_REQUEST': Param(1, NUMBER, '1 when using LTA for LKA', live=True),
'BIT': Param(0, NUMBER, '1: LTA, 2: LTA for lane keeping', live=True),
}

@ -16,6 +16,9 @@ def create_lta_steer_command(packer, apply_steer, steer_req, op_params):
"""Creates a CAN message for the Toyota LTA Steer Command."""
values = {
"STEER_REQUEST": steer_req, # STEER_REQUEST seems to be the real bit
"STEER_REQUEST_2": steer_req,
# seems to actually be 1. Even 1 on 2023 RAV4 2023 (TODO: check from data)
"SETME_X1": op_params.get("SETME_X1"),
@ -42,16 +45,12 @@ def create_lta_steer_command(packer, apply_steer, steer_req, op_params):
# some tss2 don't have any offset on the accurate angle signal... (tss2.5)?
"STEER_ANGLE_CMD": apply_steer,
# stock system turns off steering after ~20 frames of override, else torque winds up
"LTA_REQUEST": steer_req,
# 1 when actively using LTA. 3 when LTA is activated for LKA. 0 when LTA_REQUEST is 0
# TODO: see if 3 gets us any more torque, or better blending, or SOMETHING. EPS_STATUS doesn't change based on this, so maybe it doesn't do anything
"LTA_REQUEST_TYPE": op_params.get("LTA_REQUEST_TYPE") if steer_req else 0,
# 1 when camera is using LTA for LKA — no noticeable difference
# "LKA_REQUEST": op_params.get("LKA_REQUEST") if steer_req else 0,
# 1 when STEER_REQUEST changes state (usually)
# except not true on 2023 RAV4. TODO: revisit, could it be UI related?
"BIT": 0,
"BIT": op_params.get("BIT"),
}
return packer.make_can_msg("STEERING_LTA", 0, values)

Loading…
Cancel
Save