-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Car Port: Kia Carnival 2025 {HEV,ICE} {HDA1,HDA2} #1580
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
Conversation
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.
Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:
- Convert your PR to a draft unless it's ready to review
- Read the contributing docs
- Before marking as "ready for review", ensure:
- the goal is clearly stated in the description
- all the tests are passing
- include a route or your device' dongle ID if relevant
63f9308 to
a89a450
Compare
|
This PR is a duplicate of #1558. |
|
Disclaimer: While I have the ability to merge one of these PRs, I don't set bounty policy or make bounty decisions. @ccdunder: Welcome to opendbc and openpilot! We like having new contributors. That said, if you're aware there are other potentially duplicate PRs, it's good practice to explicitly mention them and explain why it's necessary to file a separate one. I wouldn't really call that other PR stale, conversations and testing are clearly in progress. @sunnyhaibin: Haven't reviewed these in depth, but there are definitely differences between these PRs, starting with the existence of Panda changes in this one. Neither of these PRs are ready to merge. To get one of them merge-ready, this would be a great time to onboard and collaborate with a first-time contributor and HKG owner. |
|
@sunnyhaibin my sincere apologies for my overly critical reply. I heard what sounded like "we don't want your work" and got confused and defensive. My sincere thanks @jyoung8607 for the warm welcome and cool moderation 🙏 Jason and I are collaborating in discord now. To avoid duplicating efforts, I'm going to focus this set of PRs on the HEV specifically (i.e. drop the ICE fingerprints). There is an additional issue that only affects the ICE model and I only have an HEV to verify with anyhow. |
6b73dc8 to
300e557
Compare
This is necessary in order to support the 2025 Kia Carnival w/ HDA2, which uses ALT_BUTTONS. This seems exceedingly unlikely to cause a regression. If any car wasn't hitting this branch and now does, it means it was already broken (trying to use BUTTONS when they don't exist).
This is needed for the Kia Caravan '25.
This is needed for the Kia Caravan '25.
300e557 to
d7a1032
Compare
1523991 to
398e585
Compare
9c093d5 to
e6d3a5b
Compare
TODO: Minimize changes to create_adrv_messages and make the rest conditional. Credit to royjr@ for MSG_161 & MSG_162 signal mapping.
As a newish contributor to this codebase, I should make clear up front that I haven't taken up this refactoring lightly or without good reason. I would love to avoid it but it seems necessary and less bad than all the other options. If there is another way to accomplish these goals I'm all ears. Root problem: HKG flags combine to produce combinatoric configurations. Supporting this requires tradeoffs between maintainability, convention, and quality. Alternatives considered: 1. Continue making RX & TX allowlists overly permissive. This seems antithetical to the whole point of safety flags. 2. Continue Copy-pasting nested branches with 1-line differences. It seems like this has already been done to the limit of reasonable maintainability (3-4 conditions deep). Also, to support the new conditions here would mean duplicating the code 8x. Callout: MISRA I am not a MISRA expert but AFAIU this conforms. Happy to discuss and iterate if this is incorrect. There are other options that trade readability for reduced dynamism. But at a certain point making everything static for the sake of MISRA seems to miss the forest for the trees. LMK what you think. I'd love to hear if there's a better way to solve this.
This was removed when safety was moved from panda to opendbc. This is needed in order for memcpy to be available for safety tests as it is in production.
e6d3a5b to
d950f67
Compare
|
Plan is to land this as part of #1625 |
adeebshihadeh
left a comment
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.
This is quite big. Can we break this up at all into smaller self-contained PRs? At least break out the two different car models
| left_blinker_sig, right_blinker_sig = ( | ||
| ("LEFT_LAMP_ALT", "RIGHT_LAMP_ALT") | ||
| if cp.vl['BLINKERS']['USE_ALT_LAMP'] | ||
| else ("LEFT_LAMP", "RIGHT_LAMP") | ||
| ) |
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 think the old way this was written is more readable
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.
bad merge?
| if candidate == CAR.KIA_OPTIMA_G4_FL: | ||
| ret.steerActuatorDelay = 0.2 | ||
| elif candidate == CAR.KIA_CARNIVAL_HEV_4TH_GEN: | ||
| ret.steerActuatorDelay = 0.35 |
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.
this is incredibly high. are you sure? how'd you determine this?
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.
wanna split this out? we can just merge this to reduce the diff a bit
| printf("i %d seen %d lagging %d valid checksum %d wrong counters %d valid quality flag %d\n", | ||
| i, addr.status.msg_seen, addr.status.lagging, addr.status.valid_checksum, addr.status.wrong_counters, addr.status.valid_quality_flag); | ||
| for (int j = 0; j < MAX_ADDR_CHECK_MSGS; j++) { | ||
| const CanMsgCheck msg = addr.msg[j]; | ||
| if (msg.addr == 0) { | ||
| break; | ||
| } | ||
| printf("i %d j %d bus %d addr 0x%x len %d\n", | ||
| i, j, msg.bus, msg.addr, msg.len); | ||
| } |
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.
if you split this out and put it behind an environment variable (like LOGPRINT=debug), we can merge this
FW for 2025 HDA2 (KOR)
|
This PR has had no activity for 60 days. It will be automatically closed in 7 days if there is no activity. |
|
This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes. |
|
This PR has had no activity for 60 days. It will be automatically closed in 7 days if there is no activity. |
|
This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes. |
Checklist
selfdrive/car/docs.pyto generate new docs6c0069dcd5bbb6c1/00000020--6b95507969481f55600340bebb/00000095--49fb7431a06c0069dcd5bbb6c1/00000021--e6c25dde2df1a99071580b5733/00000007--260128fdabDependencies:
Changes:
KIA_CARNIVAL_HEV_4TH_GEN. This is the first year the Carnival is available as a hybrid.KIA_CARNIVAL_2025. While it's ostensibly "4th gen", it's very different from previous 4th gen Carnivals. In terms of static flags alone, it doesn't have RADAR_SCC, has ccNC, and gets incorrectly dynamically flagged HYBRID.i. Adds a static ICE flag to prevent incorrect dynamic detection as HYBRID.
Alternative considered: We could check if not 0x100 in fingerprint[CAN.ECAN]. That passed testing on all routes, but explicit configuration is much easier to maintain (case in point).
ii. Changes safety RX check config to add only the relevant accelerator check (rather than all 3 (GAS, HYBRID, EV)).
TODO (before final review, but there's a lot I'd like to get an initial review on before dotting I's and crossing T's):
Parent PR: commaai/openpilot#34662