Skip to content

Commit

Permalink
fix bug in published point timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Feb 18, 2024
1 parent 457f4ad commit c3dc1fc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,13 @@ void ParisLucoDataset::load_lidar(timestep_t step) const
obs->sensorLabel = "lidar";
obs->pointcloud = pts;

const double shiftTime = -0.5 * lidarPeriod_;
auto* Ts = pts->getPointsBufferRef_timestamp();
auto* Ts = pts->getPointsBufferRef_timestamp();
ASSERT_(Ts);
std::transform(Ts->begin(), Ts->end(), Ts->begin(), [=](double t) {
return t - shiftTime;
const float earliestTime = *std::min_element(Ts->cbegin(), Ts->cend());
const float shiftTime = -earliestTime - 0.5 * lidarPeriod_;

std::transform(Ts->cbegin(), Ts->cend(), Ts->begin(), [=](double t) {
return t + shiftTime;
});

// Fix missing RING_ID: ParisLuco does not have a RING_ID field,
Expand Down

0 comments on commit c3dc1fc

Please sign in to comment.