Skip to content

Commit

Permalink
Fix conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
benemer committed Nov 15, 2024
1 parent 944856e commit 2807f97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ros/src/kinematic_icp_ros/server/LidarOdometryServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,10 @@ void LidarOdometryServer::RegisterFrame(const sensor_msgs::msg::PointCloud2::Con
// Get scan duration and current stamp
const auto begin_scan_time = min_it != timestamps.cend() ? *min_it : toTime(last_stamp);
const auto end_scan_time = max_it != timestamps.cend() ? *max_it : toTime(msg->header.stamp);
const double scan_duration = end_scan_stamp - begin_scan_stamp;
current_stamp_ = begin_scan_time < toTime(last_stamp) ? toStamp(last_stamp_) + scan_duration
: toStamp(end_scan_stamp);
const double scan_duration = std::abs(end_scan_stamp - begin_scan_stamp);
current_stamp_ = begin_scan_time < toTime(last_stamp)
? toStamp(toTime(last_stamp_) + scan_duration)
: end_scan_stamp;

// Get the initial guess from the wheel odometry
const auto delta = LookupDeltaTransform(base_frame_, last_stamp_, base_frame_, current_stamp_,
Expand Down

0 comments on commit 2807f97

Please sign in to comment.