From 7708634f70baca228a696cb58afa1cefbd5c12e9 Mon Sep 17 00:00:00 2001 From: Autumn60 Date: Sun, 3 Dec 2023 13:33:33 +0900 Subject: [PATCH] Update VelodyneMsgSerializer.cs --- .../Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs index bba6f0d9..7c1a6607 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs @@ -64,7 +64,11 @@ public VelodyneScanMsg Serialize(float time) _msg.header = _header.header; - uint sec = _header.header.stamp.sec; +#if ROS2 + int sec = (int)_header.header.stamp.sec; +#else + uint sec = (uint)_header.header.stamp.sec; +# endif uint nanosec = _header.header.stamp.nanosec; for (int i = 0; i < _msg.packets.Length; i++)