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

Fixup ford radar #1408

Closed
wants to merge 16 commits into from
Closed

Fixup ford radar #1408

wants to merge 16 commits into from

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Oct 23, 2024

  • MRR_Header_InformationDetections->CAN_NUMBER_OF_DET exactly matches our parsed points using CAN_DET_VALID_LEVEL_xx when assuming the scan index signal is a sync signal
  • Each track message's CAN_SCAN_INDEX_2LSB_xx signal matches the header's when triggered on the header message
  • Every cycle we now receive exactly 65 track updates when triggered on the header message

@github-actions github-actions bot added car related to opendbc/car/ ford gm honda toyota labels Oct 23, 2024
@@ -68,6 +71,10 @@ def update(self, can_strings):
self._update_delphi_esr()
elif self.radar == RADAR.DELPHI_MRR:
self._update_delphi_mrr()
print('pts', len(self.pts), self.rcp.vl['MRR_Header_InformationDetections']['CAN_NUMBER_OF_DET'])
Copy link
Contributor Author

@sshane sshane Oct 23, 2024

Choose a reason for hiding this comment

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

CAN_NUMBER_OF_DET was always lower by 3-6 times from our number of points, now they match exactly!

It was originally thought that CAN_SCAN_INDEX_2LSB_xx was a sort of multiplexing signal, but it makes more sense that along with the header message it's used to ensure that the latest updates are kept up to sync.

Will have to look into the flickering that was noticed in the original PR (commaai/openpilot#24296) though, perhaps some more robust track switching logic is needed, or maybe it's not a problem since Harald added it after the original PR.

if self.trigger_msg not in self.updated_messages:
# print('updated_messages:', self.updated_messages)
# if self.trigger_msg not in self.updated_messages:
if 368 not in self.updated_messages:
Copy link
Contributor Author

@sshane sshane Oct 23, 2024

Choose a reason for hiding this comment

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

All track message's LSB scan index signals always match the header counter's 2 LSB when waiting for it now, before it would usually have a few messages that mismatched every cycle (so we should have waited a bit longer for the header message to have the most up to date detection/track messages)

@sshane
Copy link
Contributor Author

sshane commented Oct 23, 2024

I colored scan indexes of 0 and 2 as green, and 1 and 3 as purple. They're grouped into close range tracks and far away/less accurate tracks.

CAN_SCAN_INDEX and CAN_LOOK_INDEX always match (16 bit numbers). And CAN_LOOK_ID always follows this mapping to the 2 LSB of the indexes: ID 0 = INDEX 1, ID 1 = INDEX 3, ID 2 = INDEX 0, and ID 3 = INDEX 2. This means we can use any one of these signals to group the points, and the original logic was correct.

ford-radar-sorted-by-scan-index.mp4

This is very clearly seen here:

View

image

@sshane
Copy link
Contributor Author

sshane commented Oct 23, 2024

I then filtered for only CAN_DET_SUPER_RES_TARGET_xx=1 tracks. Fewer points, and they don't capture obvious objects like the lead.

ford-radar-only-super-res.mp4

@sshane
Copy link
Contributor Author

sshane commented Oct 23, 2024

I also just realized the groups are explainable with these two signals:

image

I had some false tracks on the road with the long-range detection mode, probably can filter them out with this:

image

Here is a line at ~45m:

ford-radar-40m.mp4

And filtered out long range points < 35m:

image

@sshane
Copy link
Contributor Author

sshane commented Oct 24, 2024

mostly in

@sshane sshane closed this Oct 24, 2024
@sshane sshane deleted the fixup-ford-radar branch October 24, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car related to opendbc/car/ ford gm honda toyota
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant