-
Notifications
You must be signed in to change notification settings - Fork 368
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
RGB-D image from ROS on Unity #152
Comments
Hi @dvargasfr , a SensorPointCloud2 intro is a pure ROS topic again. Please place questions like this better on ROS Answers in the future... There are also many examples, mainly in python, explaining in detail how a PointCloud2 is (de-)composed, e.g. here. I used these lines of code to unpack a PointCloud2:
For better performance, rather than point clouds, I'd suggest to communicate (depth and color) compressed images or even streams and compose a 3d point cloud in Unity yourself. Please don't forget to close this issue if it answers your question. |
Thanks @MartinBischoff for your time and help. Adapting the code above to mine I could correctly unpack PointCloud2. Just a detail, As you suggest, I´ll try to compose a 3D point cloud in Unity by myself. |
@dvargasfr Hey buddy, have you made any progress on your project? I am on the same topic. How for are your through? |
Dear @stevensu1838 ,
|
Hi!
I am trying to visualize RGB-D images from Asus Xtion Pro on Unity using ROS#.
Main problem is to understand and correctly process data structure of PointCloud2 messages.
An example of a message:
Data is uint array, and point step is 16, so every 16 uints of data correspond to XYZ coordinates of a pointcloud point (each coordinate represented by 4 uints).
First step is do is to convert these uint data to hexadecimal.
Due to
is_bigendian=False
data reversing is needed. As shown above, last four uints of each point are zeros, so I am reversing each uint[4] data array corresponding to XYZ coordinates, not uint[16] data array corresponding to each point.And last step consist of convert that hexa string to float and get float values for every XYZ points.
But after that I am not getting reasonable values to display a pointcloud corresponding to the real one. I'd like to know if the methon I followed is correct, if there is any simpler way, or if anyone have some function code or clue which could guide me.
Thanks a lot!
The text was updated successfully, but these errors were encountered: