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

A suggestion for a simpler search algorithm for the interpolation #142

Closed

Conversation

tfoote
Copy link
Collaborator

@tfoote tfoote commented Jan 11, 2022

Here's a suggestion for accelerating/simplifying the search algorithm. It's mostly focused on reducing the complexity of the search. There's now just two slice ranges, followed by a closest neighbor search in each of those slices.

I removed unused parameters: c9130c5

The biggest thing that I don't have an immediate answer to is how to set what is currently a magic number of the width of the slice. My first vale of 1m didn't find anything below. And my second try at 100m finds way to many. We should find a way to query this resolution from the dataset or parameterize it somehow.

Looking at the output it appears that 5m resolution is our current resolution. So I've set it to that.

…slices.

This should be less computationally intensive. In particular the search is across a much smaller segment. And we only have to do two searches.

Signed-off-by: Tully Foote <[email protected]>
Signed-off-by: Tully Foote <[email protected]>
Signed-off-by: Tully Foote <[email protected]>
Signed-off-by: Tully Foote <[email protected]>
@tfoote tfoote requested a review from mabelzhang January 11, 2022 05:23
@tfoote
Copy link
Collaborator Author

tfoote commented Jan 11, 2022

The z slice at 5m worked:

1: [Dbg] [ScienceSensorsSystem.cc:757] 295536 points in full cloud
1: [Dbg] [ScienceSensorsSystem.cc:763] 1st z slice 18471 points
1: [Dbg] [ScienceSensorsSystem.cc:841] Found 4 neighbors.
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (1.39148e-08, -1.1001e-09, -0), distance 1.07004e-06 m
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (-1812.03, 0.184071, -0), distance 1812.03 m
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (1812.03, 0.184071, -0), distance 1812.03 m
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (1.37634e-08, -2218.66, -0), distance 2218.66 m
1: [Dbg] [ScienceSensorsSystem.cc:775] 2nd z slice 18471 points
1: [Dbg] [ScienceSensorsSystem.cc:841] Found 4 neighbors.
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (1.39148e-08, -1.1001e-09, -5), distance 5 m
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (-1812.03, 0.184071, -5), distance 1812.04 m
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (1812.03, 0.184071, -5), distance 1812.04 m
1: [Dbg] [ScienceSensorsSystem.cc:849] Neighbor at (1.37634e-08, -2218.66, -5), distance 2218.66 m
1: [Dbg] [ScienceSensorsSystem.cc:884] diff: 

It's hard to find things in the logs now that they're truncated at 55thousand lines

The CI looks like YoYoCircle failed. I'm guessing this hasn't been rebased recently so is still flakey.

@mabelzhang
Copy link
Collaborator

mabelzhang commented Jan 26, 2022

So, for speedy reviews, I would really like to have new changes be based on #127, instead of #83, because #83 is not meant to work without #127, so it's very hard to judge whether things are correct based on #83. It has a FIXME that's a big problem, which means the results returned in #83 are actually incorrect - the indices of the points aren't mapped back the original point cloud. So everything downstream from FindTrilinearInterpolators in #83 are just undefined behavior.

I would prefer to address the comments in #83 individually, merge that, and then move additional suggestions to #127, where we have actual interpolation algorithms that we trust much more, and have more data to test with. The code has also changed a lot in #127.

There had been so many failing edge cases that we had to address - which #127 addresses with the 2 alternative algorithms, I'm very hesitant to look at one data output and declare things working.

@tfoote
Copy link
Collaborator Author

tfoote commented Jan 28, 2022

Replaced this with #156

@tfoote tfoote closed this Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants