{ “scan_0000.pcd”: “1970-01-01 05:30:00”,
“scan_0001.pcd”: “2025-05-15 18:31:03.836641”,
“scan_0002.pcd”: “2025-05-15 18:31:03.936679”,
“scan_0003.pcd”: “2025-05-15 18:31:04.036767”,
“scan_0004.pcd”: “2025-05-15 18:31:04.136839”,
“scan_0005.pcd”: “2025-05-15 18:31:04.236961”,
“scan_0006.pcd”: “2025-05-15 18:31:04.336999”,
“scan_0007.pcd”: “2025-05-15 18:31:04.436982”,
“scan_0008.pcd”: “2025-05-15 18:31:04.536951”,
“scan_0009.pcd”: “2025-05-15 18:31:04.636932”}
This is the timestamp I got when I converted the .pcap to .pcd along with timestamp for each pcd files. why is there a discrepancy in the timestamp for first .pcd file. The below code is I used for conversion, correct me if anything is wrong.
info = client.SensorInfo(open(meta_path).read())
source = pcap.Pcap(pcap_path, info)
scans = client.Scans(source)
xyzlut = client.XYZLut(info)
timestamps = {}
for i, scan in enumerate(scans):
xyz = xyzlut(scan.field(client.ChanField.RANGE))
points = xyz.reshape(-1, 3)
timestamp_ns = scan.timestamp # timestamp: nanoseconds
if isinstance(timestamp_ns, np.ndarray):
timestamp_ns = timestamp_ns[0]
timestamps[f"scan_{i:04d}.pcd"] = str(datetime.datetime.fromtimestamp(timestamp_ns / 1e9))