printing kinect point cloud data alone gives garbage
I have subscribed to /camera/depth/points to get the PointCloud2 data from kinect. When I try to print the PointCloud2 data alone leaving out the headers, height and width etc i get a pool of garbage values. How do i print the 'data' field alone.? I am able to get the output without any garbage if i print the entire msg.
Here is my code.
#!/usr/bin/env python
import roslib
import rospy
from sensor_msgs.msg import PointCloud2
def callback(msg):
print len((data.data))
print msg.data
listener.unregister()
def kinect_depth():
rospy.init_node('kinect_depth', anonymous=True)
global listener
listener = rospy.Subscriber("/camera/depth/points", PointCloud2, callback)
rospy.spin()
if __name__=='__main__':
kinect_depth()
Thanks in advance.