PointCloudLibrary / PointCloudLibrary/pcl

pcl::HDLGrabber::toPointClouds: wrong timestamp format?

Open
#685 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind: bug status: stale
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

This is just something minor that I noticed while trying to figure out the timestamp semantics (Pull Request #684). Someone who has used the HDLGrabber might be able to comment on this better than I can.

The PCLHeader timestamp field is apparently supposed to represent microseconds since the UNIX Epoch. pcl::HDLGrabber::toPointClouds sets the timestamp as follows:

time_t  time_;
time(&time_);
time_t velodyneTime = (time_ & 0x00000000ffffffffl) << 32 | dataPacket->gpsTimestamp;
current_scan_xyz_->header.stamp = velodyneTime;

Whatever this produces, I strongly doubt it is a valid timestamp -- it uses the upper 32 bits of the 64-bit timestamp field to hold the seconds, and the lower 32 bits to hold the Velodyne scanner's gpsTimestamp. According to the Velodyne HDL-32E manual, this value "represents microseconds from the top of the hour to the first laser firing
in the packet." So, in any case, the timestamp calculation here appears grossly wrong.

I myself don't use Velodyne scanners at the moment, and I don't have the time to work on this myself. But someone else might be interested in fixing this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at pcl::HDLGrabber::toPointClouds and inspect how dataPacket->gpsTimestamp is combined with the current time before assigning PCLHeader::stamp. Check the Velodyne HDL-32E timestamp semantics against PCL's expected units. Done means the resulting timestamp has a valid, documented representation and is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.