-
Notifications
You must be signed in to change notification settings - Fork 203
Is there an error in the minimum-maximum frustum distance? #164
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
Comments
Right now I am super busy, so I don't have time to prepare a proper pull request, but I refactored from the ground up the depth camera frustum and the code is much easier to read. Feel free to use this if you want: https://bitbucket.org/snippets/df-bor/9nM868/frustum-calculation-fast-and-simple |
I think you are correct, it should be max (or min) * cos(phi/2) by that math, but it is a little convoluted. The ranges are wrong then by ~15% for some depth cameras. Curious - what are you up to with this refactored code? |
I wanted to use your frustum code to filter more efficiently a point cloud, when I realized the very same math could be written in a more simple way 😅 |
Yeah. I wasn't too concerned with the complexity on this since it is cached on startup. Once it worked, it worked, and I moved on. I was also trying to use the openVDB tools since I was learning that at the same time. It could be simplified for sure. |
I love this library, you did a great job... And you game me an excuse to learn OpenVDB 🤗 |
I barely touched the surface of what its really good at. If you actually set it up as a signed distance field, you can get all the raycasting speeds ups too. However, I really never figured out a way to do that reliably with "real" data from "real" sensors since the surface of obstacles with noisy sensors isnt going to be consistent. Maybe it doesn't matter if I guestimate the surface but the overall the raycasting without the signed distance speed ups weren't enough for my needs. I needed something to drop CPU a bunch so I could process 8+ depth cameras. If I were to start from scratch again, I'd probably take another crack at it. Then have frustum and raycasting based clearing. But still using it as a sparse volumetric grid anyhow is very useful and very fast random access. |
Of course it is not about CPU, it is just for readability purposes. If the code is readable, it is easier to find bugs or fault in the reasoning... like min/max distance ! |
In thoery, this modification is just about readability. It should give EXACTLY the same result, but... In practice, we fixed also a problem about mini/max distance, as reported in SteveMacenski#164
Resolving here shortly for Noetic and Foxy + newer in ROS2. |
Hi,
when I was inspecting the code, I found something quite suspicious.
https://github.com/SteveMacenski/spatio_temporal_voxel_layer/blob/eloquent-devel/src/frustum_models/depth_camera_frustum.cpp#L97-L98
According to this mathematical formula, min and max distance refer to the distance between the origin and the eight corners of the frustum.
But I think this is NOT what you wanted.
If I don't mistake, _min_d and _max_d should refer to the distance of the planes parallel to the XY plane and perpendicular to the Z one.
The text was updated successfully, but these errors were encountered: