ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Extract frame time from historic Velodyne PCAP

asked 2019-08-27 14:17:26 -0500

shaky gravatar image


Is there a method to extract the collected POSIX time from each frame in a PCAP file (collected on VLP-16) and not the current wall time? Using rospy to examine the nodes' headers provides the current wall time in POSIX and not the time which the frame was recorded.

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-08-30 12:36:35 -0500

shaky gravatar image

updated 2019-08-30 12:38:09 -0500

I found a solution to extracting the acquisition time from a PCAP file acquired by a Velodyne VLP-16 LIDAR in an older question by changing the packet stamp time in the file within the velodyne_driver package. The follow steps were borrowed from the older question, but I will place here as well.

To accomplish this, git clone velodyne package into the catkin_workspace/src


and navigated to


and changed the following line in the file (line 320 on mine)

  • FROM: pkt->stamp = ros::Time::now();
  • TO: pkt->stamp = ros::Time(header->ts.tv_sec, header->ts.tv_usec * 1000);

Then run catkin_make in /home/user/catkin_ws (and, don't forget to source the /home/user/catkin_ws/devel/setup.bash) and I printed the timestamps for each packet, which matched the acquired time.


edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-08-27 14:17:26 -0500

Seen: 493 times

Last updated: Aug 30 '19