Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 84

printing kinect point cloud data alone gives garbage

$
0
0
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.

Viewing all articles
Browse latest Browse all 84

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>