-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kia Sorento and future Multi-Car Support #346
Merged
Merged
Changes from 17 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
bea839c
hyundai WIP
rbiasini 7376209
steer_driver_factor is 1
rbiasini 4314efa
removed unnecessary file
rbiasini 3f3075e
removed unnecessary code
rbiasini 95b7919
Update carcontroller.py
rbiasini 5e76750
safety tuning and fixed interface stiffness
rbiasini c92c08f
better lateral tuning, some fixes
rbiasini 26c36df
Fix set speed
rbiasini 2ca147f
Merge branch 'devel' of github.com:commaai/openpilot into hyundai-rea…
rbiasini 96f54e3
added camera state reading, autoresume from stop, cancel on accel, hu…
rbiasini 22688e0
WIP
emmertex 07a8b3a
Updated for Kia Sorento *WIP*
emmertex 9c02498
Cleanup
emmertex 87d7549
clean2
emmertex c4a6506
Bug Fixes
emmertex 119f48d
pre-merge
emmertex 3df5a09
Merge remote-tracking branch 'upstream/devel' into hyundai-dev
emmertex 9f1bba6
Add all the cars!
emmertex c08d305
Panda to auto-detect Camera Bus
emmertex d7ca4ce
Move Checksum Check
emmertex bb27195
Final Sorento Tuning
emmertex 1fddd38
Make CAN3 for Cam default
emmertex 6b51095
Update README.md
emmertex e6b0432
update panda, minor aesthetic updates
rbiasini ad17983
few other minor changes
rbiasini 7980457
added steer not allowed alert
rbiasini 1d67a26
bup panda version to force panda update
rbiasini f4e8926
fixed camera alerts
rbiasini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,23 @@ | |
|
||
hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf) | ||
|
||
<<<<<<< HEAD | ||
|
||
emmertex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
def make_can_msg(addr, dat, alt): | ||
return [addr, 0, dat, alt] | ||
|
||
def create_lkas11(packer, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert, keep_stock=False): | ||
def create_lkas11(packer, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert, checksum_type, keep_stock=False): | ||
values = { | ||
"CF_Lkas_Icon": 3 if enabled else 0, | ||
"CF_Lkas_LdwsSysState": lkas11["CF_Lkas_LdwsSysState"] if keep_stock else 1, | ||
"CF_Lkas_LdwsSysState": 3 if steer_req else 1, | ||
"CF_Lkas_SysWarning": hud_alert, | ||
"CF_Lkas_LdwsLHWarning": lkas11["CF_Lkas_LdwsLHWarning"] if keep_stock else 0, | ||
"CF_Lkas_LdwsRHWarning": lkas11["CF_Lkas_LdwsRHWarning"] if keep_stock else 0, | ||
"CF_Lkas_HbaLamp": lkas11["CF_Lkas_HbaLamp"] if keep_stock else 0, | ||
"CF_Lkas_FcwBasReq": lkas11["CF_Lkas_FcwBasReq"] if keep_stock else 0, | ||
"CR_Lkas_StrToqReq": apply_steer, | ||
"CF_Lkas_ActToi": steer_req, | ||
"CF_Lkas_ToiFlt": lkas11["CF_Lkas_ToiFlt"] if keep_stock else 0, | ||
"CF_Lkas_ToiFlt": 0, | ||
"CF_Lkas_HbaSysState": lkas11["CF_Lkas_HbaSysState"] if keep_stock else 1, | ||
"CF_Lkas_FcwOpt": lkas11["CF_Lkas_FcwOpt"] if keep_stock else 0, | ||
"CF_Lkas_HbaOpt": lkas11["CF_Lkas_HbaOpt"] if keep_stock else 3, | ||
|
@@ -30,9 +32,20 @@ def create_lkas11(packer, apply_steer, steer_req, cnt, enabled, lkas11, hud_aler | |
} | ||
|
||
dat = packer.make_can_msg("LKAS11", 0, values)[2] | ||
dat = dat[:6] + dat[7] | ||
checksum = hyundai_checksum(dat) | ||
|
||
# CRC Checksum as seen on 2019 Hyundai Santa Fe | ||
if checksum_type == 0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please review now, I now pass fingerprint and imported values.py |
||
dat = dat[:6] + dat[7] | ||
checksum = hyundai_checksum(dat) | ||
# Checksum of first 6 Bytes, as seen on 2018 Kia Sorento | ||
if checksum_type == 6: | ||
dat = [ord(i) for i in dat] | ||
checksum = sum(dat[:6]) % 256 | ||
# Checksum of first 6 Bytes and last Byte as seen on 2018 Kia Stinger | ||
if checksum_type == 7: | ||
dat = [ord(i) for i in dat] | ||
checksum = (sum(dat[:6]) + dat[7]) % 256 | ||
|
||
values["CF_Lkas_Chksum"] = checksum | ||
|
||
return packer.make_can_msg("LKAS11", 0, values) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm... I think keep supporting the connection with camera on bus 1 will be hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to leave this as 2, and update locally, unless I can figure out a clean way of doing this (like I did for panda)
I will fix this for the PR