Skip to content
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

Ford: add F150 Lightning and Mach-E #30444

Closed

Conversation

coffee-cake-isaac
Copy link
Contributor

@coffee-cake-isaac coffee-cake-isaac commented Nov 11, 2023

Checklist

  • added entry to CarInfo in selfdrive/car/*/values.py and ran selfdrive/car/docs.py to generate new docs
  • test route added to routes.py
  • route with openpilot:
  • route with stock system:

This PR is contingent on the merge of this PR: commaai/panda#1524

The FW responses cannot be obtained otherwise.

Additionally, the CAN-FD platform has not been injection tested so the vehicles added (F150 Lightning and Mach E) are in dashcam only.

I will install this later today and provide routes, however, they will not be able to be stock routes since I can't test this in upstream.

Update carstate.py

Update interface.py

Update override.yaml
@github-actions github-actions bot added the car vehicle-specific label Nov 11, 2023
@coffee-cake-isaac
Copy link
Contributor Author

@sshane This is the better PR I spoke about from here: #30163 (comment)

This now puts the Mach E and F150 Lightning in it's own grouping to allow us to bypass the hybrid checksums as we do have the flags but the CAN-FD platform has resolved the checksum issues.

selfdrive/car/ford/values.py Outdated Show resolved Hide resolved
selfdrive/car/ford/carstate.py Outdated Show resolved Hide resolved
selfdrive/car/ford/interface.py Outdated Show resolved Hide resolved
selfdrive/car/ford/values.py Outdated Show resolved Hide resolved
Comment on lines +249 to +287
(Ecu.abs, 0x760, None): [
b'PL38-2D053-AA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x706, None): [
b'ML3T-14H102-ABT\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x764, None): [
b'ML3T-14D049-AL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7E0, None): [
b'NL3A-14C204-BAR\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
},
CAR.MUSTANG_MACH_E_MK1: {
(Ecu.eps, 0x730, None): [
b'LJ9C-14D003-AK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'LJ9C-14D003-AM\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'LJ9C-14D003-CC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'LJ9C-14D003-EA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.abs, 0x760, None): [
b'LK9C-2D053-CC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'LK9C-2D053-CD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'LK9C-2D053-CK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdRadar, 0x764, None): [
b'ML3T-14D049-AK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'ML3T-14D049-AL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.fwdCamera, 0x706, None): [
b'ML3T-14H102-ABS\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'ML3T-14H102-ABP\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PJ6T-14H102-ABK\x00\x00\x00\x00\x00\x00\x00\x00\x00',
],
(Ecu.engine, 0x7E0, None): [
b'MJ98-14C204-BBP\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'MJ98-14C204-AXD\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'NJ98-14C204-VE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
b'PJ98-14C204-BE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start by adding FW for known dongle IDs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I can grab Dongle IDs from folks that have added their FWs. But do you want to just start with the one for my Dongle ID or do you me to grab the rest of the Dongle IDs as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can post the dongle IDs, all is fine

Copy link
Contributor Author

@coffee-cake-isaac coffee-cake-isaac Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e36b272d5679115f - '23 ICE F150
112e4d6e0cad05e1 - '22 F150 Lightning
24574459dd7fb3e0 - '22 Hybrid ICE F150
42f08a29af3699f4 - '22 Mach E GT
09136c309ba9461e - '23 ICE F150
83a4e056c7072678 - '22 Mach E

I'll continue to edit this comment with the known dongle IDs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know there was a hybrid F150, does that have the hybrid checksum problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not. Seems to be entirely specific to the Q3 harness.

@sshane
Copy link
Contributor

sshane commented Nov 14, 2023

  • Test route or add to non-tested cars
  • Update docs

@coffee-cake-isaac
Copy link
Contributor Author

So, without the panda merges I can't get an actual test route with the above changes. I do have a branch with the merged panda changes. I can provide that route but it's technically not the same branch. Will that be a problem?

And I think the docs have been updated by one of the latest commits. Correct me if I'm wrong. I'm looking at your other comments now.

Comment on lines 87 to 90
if CP.carFingerprint in (CAR.F_150_LIGHTNING_MK1):
self.car_parts = CarParts([Device.threex_angled_mount, CarHarness.ford_q4])
if CP.carFingerprint in (CAR.MUSTANG_MACH_E_MK1):
self.car_parts = CarParts([CarHarness.ford_q4])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we don't set Q4 for F150?! Let's just check if CANFD car to add the q4 harness. Also probably want to add angled mount to ICE F150, no?

@sshane
Copy link
Contributor

sshane commented Nov 14, 2023

test_models skips certain tests for routes that are dashcamOnly, but add to non_tested_routes if that doesn't work for whatever reason. Mainly this would test panda state and rx checks, doesn't need to be the same branch, CAN data is most important.

Addresses a few suggestions recommended by @sshane
@coffee-cake-isaac
Copy link
Contributor Author

coffee-cake-isaac commented Nov 14, 2023

Routes updated. I ran ./selfdrive/cars/docs.py and it's not changing anything so I believe I have that updated?

I did add F150 ICE to 8 degree mount and set all CANFD cars to Q4. I might have done that wrong, though.

Edit: docs didn't get updated because I'm a dummy and didn't push the change. Updating shortly

@coffee-cake-isaac
Copy link
Contributor Author

@sshane

So, I went to gather a route that's in dash cam mode but the red panda doesn't open and the relay is blocked if the vehicle doesn't come out of dash cam mode. As a result, a lot of can data is missing.

See this for more info: #30302

I've been in touch with @vanillagorillaa briefly on discord but I don't think we've made a lot of progress yet.

I've placed the vehicles in the non_tested_routes first. Hopefully we can figure out 30302 because it does prevent a seamless experience with the Lightnings.

@coffee-cake-isaac
Copy link
Contributor Author

Docs updated.

@sshane
Copy link
Contributor

sshane commented Nov 14, 2023

Let's add a test route, we're trying to remove non_tested_cars

@coffee-cake-isaac
Copy link
Contributor Author

coffee-cake-isaac commented Nov 14, 2023

I added a route but the test is failing saying

Exception: Route: '112e4d6e0cad05e1|2023-11-14--08-21-43' with segments: (2, 1, 0) not found or no CAN msgs found. Is it uploaded?

I've uploaded the route and all the files. I've preserved it and marked it as public. I'm not sure why it's saying it can't find it. I've checked and there's definitely CAN messages as well.

Edit: Docs are not updated due to the new vehicles being placed in dashcam mode. Took me forever to figure this out lol

@sshane
Copy link
Contributor

sshane commented Nov 14, 2023

I'll need to upload the route for it to find it (it checks another, public, Azure bucket). You can run test_models on your own routes with selfdrive/car/debug/test_car_model.py to test if it succeeds. And yes, we're just preparing for when it's out of dashcam

@coffee-cake-isaac
Copy link
Contributor Author

image

Seems like it worked.

@adeebshihadeh adeebshihadeh changed the title Ford EV Support Ford: add F150 Lightning and Mach-E Nov 19, 2023
@coffee-cake-isaac coffee-cake-isaac changed the title Ford: add F150 Lightning and Mach-E Ford: CAN-FD improvements Nov 19, 2023
@sshane
Copy link
Contributor

sshane commented Nov 28, 2023

I like that we have the final changes ready to go in one PR, at this point we usually split individual changes out into separate PRs. Such as adding the Mach E and F150 Lightning platforms as their own PRs, docs updates as its own PR, etc. That way we can merge changes that are ready to go now, rather than holding everything up. For example, I'd already have merged the docs updates.

@coffee-cake-isaac
Copy link
Contributor Author

I'll break it out tonight. Thanks @sshane

@coffee-cake-isaac coffee-cake-isaac changed the title Ford: CAN-FD improvements Ford: add F150 Lightning and Mach-E Nov 29, 2023
@sshane
Copy link
Contributor

sshane commented Dec 11, 2023

@coffee-cake-isaac any updates?

@coffee-cake-isaac
Copy link
Contributor Author

coffee-cake-isaac commented Dec 11, 2023 via email

This was referenced Dec 12, 2023
sshane added a commit to coffee-cake-studios/openpilot that referenced this pull request Dec 13, 2023
42f08a29af3699f4
83a4e056c7072678

from commaai#30444
@sshane
Copy link
Contributor

sshane commented Dec 13, 2023

Done in #30692 and #30691

@sshane sshane closed this Dec 13, 2023
sshane added a commit that referenced this pull request Dec 13, 2023
* Update interface.py

* Update values.py

* Update routes.py

* Update override.yaml

* Update selfdrive/car/ford/values.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update interface.py

* order

* only have dongles for these

42f08a29af3699f4
83a4e056c7072678

from #30444

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car vehicle-specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants