From ae6e6740e0c7c5e7481b18fdc3e0dcf4829d441a Mon Sep 17 00:00:00 2001 From: AiVerisimilitude <133206333+AiVerisimilitude@users.noreply.github.com> Date: Fri, 3 Oct 2025 11:15:37 +0200 Subject: [PATCH] Use constructor of rclcpp::Time instead of conversion. (#91) Signed-off-by: Guilherme Rodrigues Co-authored-by: Alejandro Hernandez Cordero --- src/laser_geometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/laser_geometry.cpp b/src/laser_geometry.cpp index e56a4fb..e78d2fd 100644 --- a/src/laser_geometry.cpp +++ b/src/laser_geometry.cpp @@ -421,8 +421,8 @@ void LaserProjection::transformLaserScanToPointCloud_( double range_cutoff, int channel_options) { - rclcpp::Time start_time = scan_in.header.stamp; - rclcpp::Time end_time = scan_in.header.stamp; + rclcpp::Time start_time(scan_in.header.stamp, RCL_ROS_TIME); + rclcpp::Time end_time(scan_in.header.stamp, RCL_ROS_TIME); // TODO(anonymous): reconcile all the different time constructs if (!scan_in.ranges.empty()) { end_time = start_time + rclcpp::Duration::from_seconds(