Pointcloud from Xtion in Matlab with ROS IO package
Hey there,
I'm trying to get a Pointcloud from ROS to MATLAB via ROS IO. Getting the Data works so far with
function pointCloudMessage( message )
pclmsg.width = message.getWidth();
pclmsg.height = message.getHeight();
pclmsg.offset = message.getData().arrayOffset();
pclmsg.pointStep = message.getPointStep();
pclmsg.rowStep = message.getRowStep();
pclmsg.isDense = message.getIsDense();
pclmsg.isBigendian = message.getIsBigendian();
pclmsg.data = uint8(message.getData().array());
numberOfPoints = pclmsg.width*pclmsg.height;
pcl = pclmsg.data(pclmsg.offset+1 : numberOfPoints * pclmsg.pointStep+pclmsg.offset);
pcl = reshape(pcl, pclmsg.pointStep, numberOfPoints );
end
as file, and
>> roscore.RosMasterUri='http://localhost:11311';
>> node = rosmatlab.node('MATLAB', roscore.RosMasterUri);
>> ir_subscriber = rosmatlab.subscriber('/camera/depth_registered/points','sensor_msgs/PointCloud2',1,node);
>> ir_subscriber.setOnNewMessageListeners({@pointCloudMessage});
in the console. This code generates a 32x307200 matrix with uint8 data.
Now I'm stuck at interpreting the resulting data. Is is float (4 byte) data? Is the reshaping of the data correct? What is included in the data? RGBD as floats would be 6*4= 24 byte.
Thanks for the help.