openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

Hyundai: Car Port for Tucson Hybrid 2022 (#25276) * Hyundai: Car Port for Tucson Hybrid 2022 * Update RELEASES.md * Init gear_msg at the top * FW versions from script * Button send attempt * start with some cleanup * Send button fixed bits * Define all bytes and only send PAUSE/RESUME * Use CRUISE_INFO to cancel cruise and resume * 8-bit counter * Cleanup ish * 8 bit counter * Send at 20ms * Disengage bits * Revert bump submodules * Allow tx on 0x1a0 * Fix byte counts * Send LFA and HDA icons based on engageability * Send cruise buttons only on HDA2 cars for now * Add comments * Add FLAG_HYUNDAI_CANFD_HDA2 flag * Update interface.py * Update carstate.py * Update carstate.py * Update carstate.py * Bump submodules * Bump panda * Bump opendbc * Allow tx with CRUISE_INACTIVE * GEAR has 24 bytes only * Generate car docs * Fix CRUISE_INFO copy * Remove unused class * Add CAN-FD busses to unit test * Bump opendbc * Revert "Add CAN-FD busses to unit test" This reverts commit 2f751640408a7f73a9100947cbd95ea13fbb8a48. * Remove duplicate * New tune based on data * Panda safety cleanup * Include bus 0 in rx checks * Missed one * bus 6 check * Remove redundant check * Add comments * Bump opendbc * Sync with DBC * Hide LFA icon when disengaged * Little endian * fix comment * more conditions in carcontroller * update pedal signal * update tuning * cleanup carcontroller * bump panda * fix mismatch * alt buttons * little more cleanup * update refs for EV6 new safety param * bump panda Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: bd5e28909f4576699717f8a2f6751f0d9fdfecc0
3 years ago
from selfdrive.car.hyundai.values import HyundaiFlags
def create_lkas(packer, CP, enabled, lat_active, apply_steer):
values = {
"LKA_MODE": 2,
"LKA_ICON": 2 if enabled else 1,
"TORQUE_REQUEST": apply_steer,
"LKA_ASSIST": 0,
"STEER_REQ": 1 if lat_active else 0,
"STEER_MODE": 0,
"SET_ME_1": 0,
"NEW_SIGNAL_1": 0,
"NEW_SIGNAL_2": 0,
}
Hyundai: Car Port for Tucson Hybrid 2022 (#25276) * Hyundai: Car Port for Tucson Hybrid 2022 * Update RELEASES.md * Init gear_msg at the top * FW versions from script * Button send attempt * start with some cleanup * Send button fixed bits * Define all bytes and only send PAUSE/RESUME * Use CRUISE_INFO to cancel cruise and resume * 8-bit counter * Cleanup ish * 8 bit counter * Send at 20ms * Disengage bits * Revert bump submodules * Allow tx on 0x1a0 * Fix byte counts * Send LFA and HDA icons based on engageability * Send cruise buttons only on HDA2 cars for now * Add comments * Add FLAG_HYUNDAI_CANFD_HDA2 flag * Update interface.py * Update carstate.py * Update carstate.py * Update carstate.py * Bump submodules * Bump panda * Bump opendbc * Allow tx with CRUISE_INACTIVE * GEAR has 24 bytes only * Generate car docs * Fix CRUISE_INFO copy * Remove unused class * Add CAN-FD busses to unit test * Bump opendbc * Revert "Add CAN-FD busses to unit test" This reverts commit 2f751640408a7f73a9100947cbd95ea13fbb8a48. * Remove duplicate * New tune based on data * Panda safety cleanup * Include bus 0 in rx checks * Missed one * bus 6 check * Remove redundant check * Add comments * Bump opendbc * Sync with DBC * Hide LFA icon when disengaged * Little endian * fix comment * more conditions in carcontroller * update pedal signal * update tuning * cleanup carcontroller * bump panda * fix mismatch * alt buttons * little more cleanup * update refs for EV6 new safety param * bump panda Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: bd5e28909f4576699717f8a2f6751f0d9fdfecc0
3 years ago
msg = "LKAS" if CP.flags & HyundaiFlags.CANFD_HDA2 else "LFA"
return packer.make_can_msg(msg, 4, values)
def create_cam_0x2a4(packer, camera_values):
camera_values.update({
"BYTE7": 0,
})
return packer.make_can_msg("CAM_0x2a4", 4, camera_values)
def create_buttons(packer, cnt, btn):
values = {
"COUNTER": cnt,
"SET_ME_1": 1,
"CRUISE_BUTTONS": btn,
}
return packer.make_can_msg("CRUISE_BUTTONS", 5, values)
Hyundai: Car Port for Tucson Hybrid 2022 (#25276) * Hyundai: Car Port for Tucson Hybrid 2022 * Update RELEASES.md * Init gear_msg at the top * FW versions from script * Button send attempt * start with some cleanup * Send button fixed bits * Define all bytes and only send PAUSE/RESUME * Use CRUISE_INFO to cancel cruise and resume * 8-bit counter * Cleanup ish * 8 bit counter * Send at 20ms * Disengage bits * Revert bump submodules * Allow tx on 0x1a0 * Fix byte counts * Send LFA and HDA icons based on engageability * Send cruise buttons only on HDA2 cars for now * Add comments * Add FLAG_HYUNDAI_CANFD_HDA2 flag * Update interface.py * Update carstate.py * Update carstate.py * Update carstate.py * Bump submodules * Bump panda * Bump opendbc * Allow tx with CRUISE_INACTIVE * GEAR has 24 bytes only * Generate car docs * Fix CRUISE_INFO copy * Remove unused class * Add CAN-FD busses to unit test * Bump opendbc * Revert "Add CAN-FD busses to unit test" This reverts commit 2f751640408a7f73a9100947cbd95ea13fbb8a48. * Remove duplicate * New tune based on data * Panda safety cleanup * Include bus 0 in rx checks * Missed one * bus 6 check * Remove redundant check * Add comments * Bump opendbc * Sync with DBC * Hide LFA icon when disengaged * Little endian * fix comment * more conditions in carcontroller * update pedal signal * update tuning * cleanup carcontroller * bump panda * fix mismatch * alt buttons * little more cleanup * update refs for EV6 new safety param * bump panda Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: bd5e28909f4576699717f8a2f6751f0d9fdfecc0
3 years ago
def create_cruise_info(packer, cruise_info_copy, cancel):
values = cruise_info_copy
if cancel:
values["CRUISE_STATUS"] = 0
values["CRUISE_INACTIVE"] = 1
return packer.make_can_msg("CRUISE_INFO", 4, values)
def create_lfahda_cluster(packer, enabled):
values = {
"HDA_ICON": 1 if enabled else 0,
"LFA_ICON": 2 if enabled else 0,
}
return packer.make_can_msg("LFAHDA_CLUSTER", 4, values)