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++)