Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(velodyne_decoder): overflow handling in vls128 #111

Merged
merged 6 commits into from
Jan 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,17 @@ void Vls128Decoder::reset_overflow(double time_stamp)
}

// Add the overflow buffer points
for (size_t i = 0; i < overflow_pc_->points.size(); i++) {
auto overflow_point = overflow_pc_->points[i];
while (overflow_pc_->points.size() > 0) {
auto overflow_point = overflow_pc_->points.back();
bgilby59 marked this conversation as resolved.
Show resolved Hide resolved

// The overflow points had the stamps from the previous pointcloud. These need to be changed to
// be relative to the overflow's packet timestamp
double new_timestamp_seconds =
scan_timestamp_ + 1e-9 * overflow_point.time_stamp - last_block_timestamp_;
overflow_point.time_stamp = 1e9 * new_timestamp_seconds;
overflow_point.time_stamp = new_timestamp_seconds < 0.0 ? 0.0 : 1e9 * new_timestamp_seconds;
knzo25 marked this conversation as resolved.
Show resolved Hide resolved

scan_pc_->points.emplace_back(overflow_point);
overflow_pc_->points.pop_back();
}

// When there is overflow, the timestamp becomes the overflow packets' one
Expand Down
Loading