From 170369aeb804e173d45c7f351387e2411b097962 Mon Sep 17 00:00:00 2001 From: A-Harada <37181352+Autumn60@users.noreply.github.com> Date: Tue, 5 Dec 2023 03:24:28 +0900 Subject: [PATCH] Update VelodyneMsgSerializer.cs (#70) --- .../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++)