-
Notifications
You must be signed in to change notification settings - Fork 85
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
help getting voxel grid back from device #57
Comments
Hi Jake, The whole idea behind GPU-Voxels is, that you keep the data on the GPU most of the time and do all the relevant calculations there. And only copy back a leight-weight result, like a single Boolean "collision"/"no collision". So your conversion into a char-array will not work. Of course you could copy the whole map back onto your Host-RAM, and read out the Bits, but there is not point in doing that. Here is a bit of code that shows you, how to read the BitVector which you get as a collisions result:
Hope that helps. If not, please explain your use case briefly, so I can give you a hint, on how to achieve your goals. Cheers, |
Just adding my experiences, I have run into several cases where syncing back to the host has been useful:
I implemented the robot::syncToHost(), as I don't believe there is a way to get the (private) device pointer to the robot link point clouds. The above cudaMemcpy works, but requires compiling with nvcc, adding additional overhead to using the library. |
Thanks Brad, @ 2) Why do you need to get the pointclouds back to the host for that? There are getters in the MetaPointCloud to access and transform sub-clouds of the robot. Still this requires some extra lines of code in the robot class. @ 3) CUDA offers you a special construct to pass mapped pointers on device memory via several host processes. We use this already to share the device data between the main program and the visualizer program via Boost inter-process-communication, so that we do not need to download data just to upoad it again with the visualizer process. |
Oh, BTW: @ 2) Always think about the discretization errors, if you work with models, that you download from a Voxel-datastructure instead of the original pointcloud. |
Thanks for the suggestions. I still support the syncToHost methods, as when I don't care about fast execution I prefer to avoid editing gpu_voxels directly, and also I am much slower at writing GPU code. |
Hi,
I want to use your library to perform several operations on a voxel grid, after completion, I want to pull the voxel grid back of the device and pass it back to some other code I have. I was trying the following for a 40^3 voxel grid.
When I run the above code, my buffer is of size 32 * 40 * 40 * 40 how do I convert this data to a 40^3 bool array representing occupancy? I don't understand why there are 32 bits per voxel.
Thanks,
Jake
The text was updated successfully, but these errors were encountered: