Toyota: 2021+ RAV4 Prime
[!IMPORTANT]
Before trying this PR, ensure theSecOCKeyparam is set with the correct key for your vehicle.echo -n "ffffffffffffffffffffffffffffffff" > /data/params/d/SecOCKey
FW versions from 20ba9ade056a8c7b. Example route: 20ba9ade056a8c7b|2021-02-08--21-57-35.
TODO:
- [x] Read key from param. Added to carParams, otherwise route wouldn't be reproducible without fetching the key from initData.
- [x] Doesn't show up as a supported car
- [ ] Figure out if layout of
PRE_COLLISIONchanged for stock AEB detection. (not a blocked for the port) - [x] Replace missing
GEAR_PACKET- [x] Check if weird
GEAR_PACKET_HYBRID.COUNTERis Rav4 specific.
- [x] Check if weird
- [ ] Replace missing
PCM_CRUISE- [ ] Implement gas pressed from new
GAS_PEDALmessage. (Still missing in panda) - [ ] Find new cruise state signal (e.g. nonAdaptive)
- [ ] Implement gas pressed from new
- [x] Replace missing
BRAKE_MODULE - [ ] Add proper alerts for missing/wrong
SecOCKey - [ ] Add flags for panda safety mode for alternate Brake/Gas messages
- [ ] Ensure tests between panda and CarState match
- [x] Test if ACC Cancel spam works. Looks like the
ACCEL_CMDwas moved to a message with SecOC, but theCANCEL_REQis still in the old message without MAC.
Missing PCM_CRUISE.
There seems to be a new message on 0x1a2 that has a bit that corresponds to ACCEL_CMD_ALT != 0. 0x1a2 seems to be a different message than other TSS2 cars.
Missing GEAR_PACKET/ GEAR_PACKET_HYBRID
There is no GEAR_PACKET, but GEAR_PACKET_HYBRID seems a good replacement. The COUNTER doesn't seem to be a real counter. ~Removed it, but check if this is a Rav4 Prime specific quirk.~ Counter is also fake on a Corolla Hybrid route.
I'm switching to the new message automatically when GEAR_PACKET is missing, but GEAR_PACKET_HYBRID is present. I need to check if this doesn't break any other cars.
Missing BRAKE_MODULE
There seem to be two new messages related to the brakes 0xfc and 0x101. Unfortunately they are not present on other models, so they can't be compared directly. I was only able to reference against PCM_CRUISE_2.BRAKE_PRESSED.
I put the new messages in the SecOC dbc for now. Let's see if all SecOC cars switched to this new message, or if this is a quirk for the RAV4 Prime specifically.
It looks like you didn't use one of the Pull Request templates. Please check the contributing docs. Also make sure that you didn't modify any of the checkboxes or headings within the template.
I added a TODO to make sure this doesn't show up in the docs as supported.
- [ ] Figure out if layout of
PRE_COLLISIONchanged for stock AEB detection.
No need to block the port on this.
What do I need to check to make sure it's not showing up as supported? It's not in the CAR_INFO list, and rerunning docs.py seems to cause no changes.
What do I need to check to make sure it's not showing up as supported? It's not in the
CAR_INFOlist, and rerunningdocs.pyseems to cause no changes.
I think you'll need to set it to None in CarInfo. cc @sshane
Yes None should work. It won't have its fingerprints auto updated with our bot though. We can add a field to hide it if we care about that
Thanks for contributing to openpilot! 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
- the change is something we merge
- include a route or your device' dongle ID if relevant