-
Notifications
You must be signed in to change notification settings - Fork 53
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
Reduce lidar data discretization #296
Conversation
Signed-off-by: Ian Chen <[email protected]>
I did some profiling to see the impact of increasing to use 4096 sized textures and found that there is some noticeable changes. For the case of a 360 degrees lidar with 4K textures (worst case), the VRAM usage went up by around 1.5GB. Manual calculation seems to be consistent with observations: 4096:
1024:
There is also some noticeable performance hit in the
I did one more test with a texture size limit of 2048 and the results are:
Here's the lidar visualization of using 2048 sized textures: |
Based on the profiling results above, I'm leaning towards capping the texture size to 2048 (or keeping in as 1024) instead of 4096 to avoid a significant change in performance in a released version of ign-rendering |
Signed-off-by: Ian Chen <[email protected]>
After some discussion offline, we decided to keep the limit to So the changes here would no longer reduce lidar discretization for sensors with high sample count. I think the changes are still worth getting int because it makes the 1st pass texture resolution configurable based on sample size and so reduces VRAM usage for lidars with low sample count. |
Codecov Report
@@ Coverage Diff @@
## ign-rendering4 #296 +/- ##
==================================================
+ Coverage 53.48% 53.53% +0.05%
==================================================
Files 145 145
Lines 13760 13776 +16
==================================================
+ Hits 7359 7375 +16
Misses 6401 6401
Continue to review full report at Codecov.
|
Signed-off-by: Ian Chen [email protected]
🦟 Bug fix
Summary
For lidars with high sample count, there is apparent discretization in the data generated. The discretization effect is more evident at long distances. This is mainly due to the resolution of the textures used in the 1st pass, which were hardcoded to 1024x1024. For a lidar with high sample count, e.g. 10000, the 1024 texture size is too low. The 2nd pass uses a texture with the actual sample count (10000) but it's just sampling from this 1024x1024 texture.
This PR changes the way the 1st pass texture size is set - It is now based on the sample count and field of view of the lidar. Lidars with low sample count will now also use smaller textures to save memory. The max texture size is capped to 4K in order to run on most graphics cards.
Here is a before and after comparison of point cloud visualization in RVIZ showing the discretization effect for a 360 degrees lidar with 10000 horizontal samples.
Before: 1st pass texture resolution fixed to 1024

After: 1st pass texture resolution capped to 4096

Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge
Note to maintainers: Remember to use Squash-Merge