loam_velodyne icon indicating copy to clipboard operation
loam_velodyne copied to clipboard

Questions about the interpolation of laser point.

Open cpkingw opened this issue 3 years ago • 3 comments

It seems that _scanTime is the timestamp of the previous laser frame, because the update of the _scanTime or _sweepStart in the reset() is behind the the interpolation of laser point via projectPointToStartOfSweep(). When doing interpolation of point in current laser frame, Shouldn't it be the timestamp of the current frame?

void BasicScanRegistration::interpolateIMUStateFor(const float &relTime, IMUState &outputState)
{
  double timeDiff = toSec(_scanTime - _imuHistory[_imuIdx].stamp) + relTime;
  while (_imuIdx < _imuHistory.size() - 1 && timeDiff > 0) {
    _imuIdx++;
    timeDiff = toSec(_scanTime - _imuHistory[_imuIdx].stamp) + relTime;
  }
  ...
}
void BasicScanRegistration::reset(const Time& scanTime)
{
  _scanTime = scanTime;

  // re-initialize IMU start index and state
  _imuIdx = 0;
  if (hasIMUData()) {
    interpolateIMUStateFor(0, _imuStart);
  }

  // clear internal cloud buffers at the beginning of a sweep
  if (true/*newSweep*/) {
    _sweepStart = scanTime;
    ...
  }
}

cpkingw avatar Sep 28 '20 14:09 cpkingw

I think it is a mistake.

arshhhly avatar Jan 08 '21 08:01 arshhhly

Have you solved the problem? I have the same doubt. @cpkingw

gackes avatar Jul 26 '21 13:07 gackes

Have you solved the problem? I have the same doubt. @cpkingw

I think you can try to update the _scanTime in projectPointToStartOfSweep() firstly by adding scanTime as a new argument like processScanlines(scanTime, _laserCloudScans)

cpkingw avatar Aug 03 '21 07:08 cpkingw