Importing rgbd data from bag file into matlab [closed]
I'm trying to plot the points measured from a microsoft kinect sensor in matlab. I connected to my sensor using the freenect_launch package, I can visualize the sensor output in rviz, and i recorded the topic /camera/depth_registered/points into a bag file. Unfortunately i dont have the ROS tools for matlab, but i did find this open source solution to read the bag file into matlab:
https://github.com/unl-nimbus-lab/bag...
I can see that the data from the bag file is imported. A single frame looks something like this:
- rosbagTimestamp 1.49246E+18
- header
- seq 205
- stamp
- secs 1492455101
- nsecs 150824989
- frame_id camera_rgb_optical_frame
- height 480
- width 640
- fields
- name x; offset 0; datatype 7; count 1
- name y; offset 4; datatype 7; count 1
- name z; offset 8; datatype 7; count 1
- name rgb; offset 16; datatype 7; count 1
- is_bigendian false
- point_step 32
- row_step 20480
- data [0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 0, 0, 68, 84, 124, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
My question is how do i convert the values in "data" to xyz points? If i'm interpreting this correctly, each data point is 32 bytes, bytes 0 - 3 correspond to X, bytes 4 - 7 correspond to Y, bytes 8 - 15 correspond to Z, and bytes 16 - 31 correspond to "rgb" (though i dont see how thats an rgb value). I dont know what "datatype 7" means, but it appears that the data is little endian. I'm wondering what datatype X, Y, Z and RGB are (unit32? float?) So that I can make the conversion. Has anyone ever dealt with this before?
Thanks!