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

reading VelodyneScan from bagfile - offline

$
0
0
I am trying to read a bagfile containing multiple velodyne data. I want to do this preferably without rosbag play as sometimes from my prev experience due to computation issues it may skip reading a node and lose than info. so now, I have a rosbag file, containing VelodyneScan msgs from a v64 topic I am using python2. from past few hours googling and figuring out on my own, i understand that it contains a main header and then subheader and data in perhaps uint32 format. Lets say i read a message - msg for topic, msg, t in bag.read_messages() msg.header is: seq: 6309 stamp: secs: 1513822001 nsecs: 291831017 frame_id: velodyne msg.packets is a list len = 579 type( msg.packets[0]) = < class 'tmpbWvooI._velodyne_msgs__VelodynePacket'> Thus there are 579 such packets. One way i could read the data is to go through one by one and append a np.arr with the data i am reading. Even if i do that, how do i get X Y Z data from it? will it always be X1 Y1 Z1 X2 Y2 Z2 and so on? my first packet doesnt even have 3x numbers.. but that could be because it saved the remaining in following packets. But there should be a prebuild method to do this right? How can I read the data from a VelodyneScan in python (using ros and cv2) WITHOUT using rosbag play to listen to a different node.

Viewing all articles
Browse latest Browse all 475

Trending Articles



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