From 6c9c4a4e2a05ad7599ffa91cb689735f49f79218 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Thu, 21 Nov 2024 09:40:46 +0100 Subject: [PATCH] Include timestamps from the projected laser --- ros/src/kinematic_icp_ros/utils/TimeStampHandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ros/src/kinematic_icp_ros/utils/TimeStampHandler.cpp b/ros/src/kinematic_icp_ros/utils/TimeStampHandler.cpp index d8ce8bb..f1c5bf8 100644 --- a/ros/src/kinematic_icp_ros/utils/TimeStampHandler.cpp +++ b/ros/src/kinematic_icp_ros/utils/TimeStampHandler.cpp @@ -42,13 +42,14 @@ using Header = std_msgs::msg::Header; std::optional GetTimestampField(const PointCloud2::ConstSharedPtr msg) { PointField timestamp_field; for (const auto &field : msg->fields) { - if ((field.name == "t" || field.name == "timestamp" || field.name == "time")) { + if ((field.name == "t" || field.name == "timestamp" || field.name == "time" || + field.name == "stamps")) { timestamp_field = field; } } if (timestamp_field.count) return timestamp_field; RCLCPP_WARN_ONCE(rclcpp::get_logger("kinematic_icp_ros"), - "Field 't', 'timestamp', or 'time' does not exist. " + "Field 't', 'timestamp', 'time', or 'stamps' does not exist. " "Disabling scan deskewing"); return {}; }