From 425c9b142daba6e556333de2a82ad618c0ec2bd3 Mon Sep 17 00:00:00 2001 From: Ryodo Tanaka Date: Sun, 6 Oct 2024 23:02:37 +0900 Subject: [PATCH] Commonisation of serializers and publishers. (#148) (#163) * Change ROSClock location * Change GroundTruthEditor location * Delete TFEditor from UnitySensor * Separate Data namespace to DataType and Interface * Create UnitySensorsROSEditor.asmdef * Move TF from UnitySensors to UnitySensorsROS * Update GeoCoordinateConverter * Create TFLinkEditor * Delete custom ros msgs * Delete TFMsgSerializer and Publisher * Update Serializer.cs * Update RosMsgPublisher.cs * Update Visualizer.cs * Update UnitySensor.cs * Update GNSS scripts * Update GroundTruth.cs * Update IMUSensor.cs * Update HeaderMsgSerializer * Create PointUtilitites * Delete NMEA serializer and publisher * Update tf scripts * Delete PointCloud2Msg serializer and publisher * Delete PoseStampedMsg serializer and publisher * Delete IMUMsg serializer and Publisher * Delete VelodyneMsg serializer * Delete CameraInfoMsg serializer and publisher * Create IMUMsg serializer and publisher * Delete ImageMsg serializer and publisher * Create camera sensor scripts * Create CameraInfoMsg serializer and publisher * Create CompressedImageMsg serializer and publisher * Delete PointCloud visualizer * Delete CameraTextureVisualizer * Delete old ScanPattern * Create PoseStampedMsg serializer and publisher * Delete NavSatFixMsg serializer and publisher * Delete lidar PointCloud2Msg publisher * Delete ImageMsgPublisher * Create NavSatFixMsg serializer and publisher * Create PointCloud2Msg serializer and publisher * Delete old Livox sensor scripts * Update lidar sensor scripts * Update visualizer scripts * Update IMU prefabs * Update GNSS_ros.prefab * Update camera sensor prefabs * Create RGBDCamera sensor prefabs * Update GroundTruth_ros.prefab * Update lidar prefabs * Delete TF demo scene * Create Interface attribute * Update visualizers * Update serializers and publishers * Update prefabs * Delete clip plane settings from rgb camera * Fix PointCloud visualizers * Fix intensity pointfield name * Fix RGBDCamera color map * Fix MsgSerializer --------- Co-authored-by: A-Harada <37181352+Autumn60@users.noreply.github.com> Co-authored-by: TaroABEJido Co-authored-by: Autumn60 --- .../Editor/Attributes/InterfaceDrawer.cs | 62 ++ .../Attributes/InterfaceDrawer.cs.meta} | 2 +- ...{GroundTruth.meta => CustomInspector.meta} | 2 +- .../GroundTruthEditor.cs | 4 +- .../GroundTruthEditor.cs.meta | 0 .../Editor/{TF.meta => DataType.meta} | 2 +- .../DataType}/LiDAR.meta | 2 +- .../LiDAR/ScanPatternGenerator.cs | 2 +- .../LiDAR/ScanPatternGenerator.cs.meta | 0 Assets/UnitySensors/Editor/TF/TFEditor.cs | 15 - .../Runtime/Prefabs/Camera/DepthCamera.prefab | 22 +- .../Runtime/Prefabs/Camera/RGBCamera.prefab | 8 +- .../Runtime/Prefabs/Camera/RGBDCamera.prefab | 126 +++ .../Prefabs/Camera/RGBDCamera.prefab.meta} | 4 +- .../Runtime/Prefabs/IMU/IMU.prefab | 6 +- .../Prefabs/LiDAR/Livox/Mid-360.prefab | 7 +- .../Prefabs/LiDAR/Velodyne/VLP-16.prefab | 3 +- .../Prefabs/LiDAR/Velodyne/VLP-16HiRes.prefab | 7 +- .../Prefabs/LiDAR/Velodyne/VLP-32.prefab | 7 +- .../Velodyne/VLS-128_with_DepthBuffer.prefab | 7 +- .../Scripts/Attributes/InterfaceAttribute.cs | 15 + .../InterfaceAttribute.cs.meta} | 2 +- .../Data/PointCloud/IPointInterface.cs | 9 - .../Data/PointCloud/IPointXYZInterface.cs | 9 - .../Scripts/Data/PointCloud/PointXYZ.cs | 20 - .../Scripts/Data/PointCloud/PointXYZI.cs | 21 - .../Runtime/Scripts/Data/Texture.meta | 8 - .../Scripts/Data/Texture/ITextureInterface.cs | 9 - .../Scripts/{Data.meta => DataType.meta} | 0 .../Pose.meta => DataType/Geometry.meta} | 2 +- .../Geometry}/GeoCoordinate.cs | 4 +- .../Geometry}/GeoCoordinate.cs.meta | 2 +- .../Scripts/DataType/Geometry/Vector3D.cs | 44 ++ .../Geometry/Vector3D.cs.meta} | 2 +- .../Scripts/DataType}/LiDAR.meta | 2 +- .../LiDAR}/ScanPattern.cs | 3 +- .../LiDAR}/ScanPattern.cs.meta | 0 .../Runtime/Scripts/DataType/Sensor.meta | 8 + .../{Data => DataType/Sensor}/PointCloud.meta | 0 .../Sensor}/PointCloud/PointCloud.cs | 6 +- .../Sensor}/PointCloud/PointCloud.cs.meta | 0 .../DataType/Sensor/PointCloud/PointXYZ.cs | 12 + .../Sensor}/PointCloud/PointXYZ.cs.meta | 0 .../DataType/Sensor/PointCloud/PointXYZI.cs | 14 + .../Sensor}/PointCloud/PointXYZI.cs.meta | 0 .../DataType/Sensor/PointCloud/PointXYZRGB.cs | 23 + .../Sensor/PointCloud/PointXYZRGB.cs.meta} | 2 +- .../Runtime/Scripts/Interfaces.meta | 8 + .../Runtime/Scripts/Interfaces/Geometry.meta | 8 + .../Geometry/IGeoCoordinateInterface.cs | 9 + .../Geometry/IGeoCoordinateInterface.cs.meta | 11 + .../Geometry}/IPoseInterface.cs | 2 +- .../Geometry}/IPoseInterface.cs.meta | 0 .../Runtime/Scripts/Interfaces/Sensor.meta | 8 + .../Interfaces/Sensor/ICameraInterface.cs | 9 + .../Sensor/ICameraInterface.cs.meta | 11 + .../Interfaces/Sensor/IImuDataInterface.cs | 13 + .../Sensor/IImuDataInterface.cs.meta | 11 + .../Sensor}/IPointCloudInterface.cs | 7 +- .../Sensor}/IPointCloudInterface.cs.meta | 2 +- .../Interfaces/Sensor/ITextureInterface.cs | 10 + .../Sensor}/ITextureInterface.cs.meta | 2 +- .../Sensor}/PointCloud.meta | 2 +- .../Sensor/PointCloud/IPointInterface.cs | 10 + .../PointCloud/IPointInterface.cs.meta | 2 +- .../Runtime/Scripts/Interfaces/Std.meta | 8 + .../Scripts/Interfaces/Std/ITimeInterface.cs | 7 + .../Interfaces/Std/ITimeInterface.cs.meta | 11 + .../Scripts/Sensors/Camera/CameraSensor.cs | 66 +- .../Camera/DepthCamera/DepthCameraSensor.cs | 64 +- .../Camera/DepthCamera/ITextureToPointsJob.cs | 6 +- .../Camera/RGBCamera/RGBCameraSensor.cs | 57 +- .../Scripts/Sensors/Camera/RGBDCamera.meta | 8 + .../RGBDCamera/ITextureToColorPointsJob.cs | 47 ++ .../ITextureToColorPointsJob.cs.meta | 11 + .../Camera/RGBDCamera/RGBDCameraSensor.cs | 196 +++++ .../RGBDCamera/RGBDCameraSensor.cs.meta | 11 + .../Scripts/Sensors/GNSS/GNSSSensor.cs | 9 +- .../Sensors/GNSS/GeoCoordinateSystem.cs | 11 +- .../Sensors/GroundTruth/GroundTruth.cs | 2 +- .../Runtime/Scripts/Sensors/IMU/IMUSensor.cs | 3 +- .../DepthBufferLiDARSensor.cs | 6 +- .../DepthBufferLiDAR/ITextureToPointsJob.cs | 7 +- .../Scripts/Sensors/LiDAR/LiDARSensor.cs | 20 +- .../Runtime/Scripts/Sensors/LiDAR/Livox.meta | 8 - .../Sensors/LiDAR/Livox/LivoxSensor.cs | 263 ------- .../RaycastLiDAR/IRaycastHitsToPointsJob.cs | 6 +- .../LiDAR/RaycastLiDAR/RaycastLiDARSensor.cs | 5 +- .../Scripts/Sensors/LiDAR/ScanPattern.meta | 8 - .../Runtime/Scripts/Sensors/UnitySensor.cs | 3 +- .../{GeoCoordinates.meta => Geometry.meta} | 0 .../GeoCoordinateConverter.cs | 64 +- .../GeoCoordinateConverter.cs.meta | 0 .../Runtime/Scripts/Utils}/PointCloud.meta | 2 +- .../Utils/PointCloud/PointUtilities.cs | 25 + .../Utils/PointCloud/PointUtilities.cs.meta | 11 + .../Runtime/Scripts/Visualizers/Camera.meta | 8 - .../Camera/CameraTextureVisualizer.cs | 12 - .../Visualizers/Camera/DepthCamera.meta | 8 - .../DepthCameraPointCloudVisualizer.cs | 13 - .../Visualizers/LiDAR/LiDARVisualizer.cs | 14 - .../Runtime/Scripts/Visualizers/Sensor.meta | 8 + .../Visualizers/Sensor}/PointCloud.meta | 2 +- .../DepthCameraPointCloudVisualizer.cs | 24 + .../DepthCameraPointCloudVisualizer.cs.meta | 2 +- .../PointCloud/LiDARPointCloudVisualizer.cs | 24 + .../LiDARPointCloudVisualizer.cs.meta | 11 + .../RGBDCameraPointCloudVisualizer.cs | 24 + .../RGBDCameraPointCloudVisualizer.cs.meta | 11 + .../PointCloudVisualizer.cs | 53 +- .../PointCloudVisualizer.cs.meta | 0 .../Visualizers/Sensor/TextureVisualizer.cs | 41 + .../TextureVisualizer.cs.meta | 0 .../Runtime/Scripts/Visualizers/Texture.meta | 8 - .../Visualizers/Texture/TextureVisualizer.cs | 23 - .../Runtime/Scripts/Visualizers/Visualizer.cs | 15 +- .../Shaders/PointCloudXYZI.shader.meta | 2 +- .../Runtime/Shaders/PointCloudXYZRGB.shader | 78 ++ .../Shaders/PointCloudXYZRGB.shader.meta | 10 + .../Editor/CustomInspector.meta | 8 + .../Editor/CustomInspector/TFLinkEditor.cs | 15 + .../CustomInspector/TFLinkEditor.cs.meta} | 0 .../Editor/UnitySensorsROSEditor.asmdef | 16 + .../Editor/UnitySensorsROSEditor.asmdef.meta | 7 + .../Prefabs/Camera/DepthCamera_ros.prefab | 32 +- .../Prefabs/Camera/RGBCamera_ros.prefab | 21 +- .../Prefabs/Camera/RGBDCamera_ros.prefab | 176 +++++ .../Camera/RGBDCamera_ros.prefab.meta} | 4 +- .../Runtime/Prefabs/GNSS/GNSS_ros.prefab | 2 + .../GroundTruth/GroundTruth_ros.prefab | 12 +- .../Runtime/Prefabs/IMU/IMU_ros.prefab | 2 + .../Prefabs/LiDAR/Livox/Mid-360_ros.prefab | 10 +- .../Prefabs/LiDAR/Velodyne/VLP-16_ros.prefab | 10 +- .../Runtime/Scripts/Messages.meta | 8 - .../Runtime/Scripts/Messages/Nmea.meta | 8 - .../Runtime/Scripts/Messages/Nmea/LICENSE.txt | 29 - .../Runtime/Scripts/Messages/Nmea/msg.meta | 8 - .../Scripts/Messages/Nmea/msg/SentenceMsg.cs | 70 -- .../Messages/Nmea/msg/SentenceMsg.cs.meta | 11 - .../Runtime/Scripts/Messages/Velodyne.meta | 8 - .../Scripts/Messages/Velodyne/msg.meta | 8 - .../Velodyne/msg/VelodynePacketMsg.cs | 66 -- .../Velodyne/msg/VelodynePacketMsg.cs.meta | 11 - .../Messages/Velodyne/msg/VelodyneScanMsg.cs | 67 -- .../Velodyne/msg/VelodyneScanMsg.cs.meta | 11 - .../Runtime/Scripts/Publishers/Camera.meta | 8 - .../Camera/CameraImageMsgPublisher.cs | 10 - .../Camera/CameraImageMsgPublisher.cs.meta | 11 - .../Camera/CameraInfoMsgPublisher.cs | 12 - .../Publishers/Camera/DepthCamera.meta | 8 - .../DepthCameraPointCloud2MsgPublisher.cs | 11 - .../Runtime/Scripts/Publishers/GNSS.meta | 8 - .../Scripts/Publishers/GNSS/NMEAPublisher.cs | 55 -- .../Publishers/GNSS/NMEAPublisher.cs.meta | 11 - .../Publishers/GNSS/NavSatFixMsgPublisher.cs | 14 - .../Scripts/Publishers/GeometryMsgs.meta | 8 + .../GeometryMsgs/PoseStampedMsgPublisher.cs | 10 + .../PoseStampedMsgPublisher.cs.meta | 11 + .../Scripts/Publishers/GroundTruth.meta | 8 - .../GroundTruth/GroundTruthPublisher.cs | 13 - .../GroundTruth/GroundTruthPublisher.cs.meta | 11 - .../Runtime/Scripts/Publishers/IMU.meta | 8 - .../Scripts/Publishers/IMU/IMUMsgPublisher.cs | 12 - .../Runtime/Scripts/Publishers/Image.meta | 8 - .../Publishers/Image/ImageMsgPublisher.cs | 12 - .../Runtime/Scripts/Publishers/LiDAR.meta | 8 - ...DepthBufferLiDARPointCloud2MsgPublisher.cs | 12 - ...BufferLiDARPointCloud2MsgPublisher.cs.meta | 11 - .../RaycastLiDARPointCloud2MsgPublisher.cs | 12 - ...aycastLiDARPointCloud2MsgPublisher.cs.meta | 11 - .../PointCloud/PointCloud2MsgPublisher.cs | 19 - .../Scripts/Publishers/RosMsgPublisher.cs | 16 +- .../Scripts/Publishers/SensorMsgs.meta | 8 + .../SensorMsgs/CameraInfoMsgPublisher.cs | 9 + .../CameraInfoMsgPublisher.cs.meta | 0 .../SensorMsgs/CompressedImageMsgPublisher.cs | 9 + .../CompressedImageMsgPublisher.cs.meta} | 0 .../Publishers/SensorMsgs/IMUMsgPublisher.cs | 9 + .../IMUMsgPublisher.cs.meta | 0 .../SensorMsgs/NavSatFixMsgPublisher.cs | 10 + .../NavSatFixMsgPublisher.cs.meta | 0 .../Publishers/SensorMsgs/PointCloud2Msg.meta | 8 + .../DepthCameraPointCloud2MsgPublisher.cs | 18 + ...DepthCameraPointCloud2MsgPublisher.cs.meta | 2 +- .../LiDARPointCloud2MsgPublisher.cs | 18 + .../LiDARPointCloud2MsgPublisher.cs.meta | 11 + .../RGBDCameraPointCloud2MsgPublisher.cs | 18 + .../RGBDCameraPointCloud2MsgPublisher.cs.meta | 11 + .../SensorMsgs/PointCloud2MsgPublisher.cs | 11 + .../PointCloud2MsgPublisher.cs.meta | 0 .../Scripts/Publishers/TF/TFMsgPublisher.cs | 16 - .../Publishers/{TF.meta => Tf2Msgs.meta} | 0 .../Tf2Msgs/TFMessageMsgPublisher.cs | 9 + .../TFMessageMsgPublisher.cs.meta} | 0 .../Runtime/Scripts/Sensors.meta | 8 + .../Runtime/Scripts/Sensors/TF.meta | 0 .../Runtime/Scripts/Sensors/TF/TFLink.cs} | 83 +- .../Scripts/Sensors/TF/TFLink.cs.meta} | 0 .../Runtime/Scripts/Serializers/Camera.meta | 8 - .../Camera/CameraInfoMsgSerializer.cs | 26 - .../Runtime/Scripts/Serializers/GNSS.meta | 8 - .../Scripts/Serializers/GNSS/NMEA.meta | 8 - .../Serializers/GNSS/NMEA/Formats.meta | 8 - .../Serializers/GNSS/NMEA/Formats/GPGGA.cs | 74 -- .../GNSS/NMEA/Formats/GPGGA.cs.meta | 11 - .../Serializers/GNSS/NMEA/Formats/GPGSA.cs | 75 -- .../GNSS/NMEA/Formats/GPGSA.cs.meta | 11 - .../Serializers/GNSS/NMEA/Formats/GPRMC.cs | 90 --- .../GNSS/NMEA/Formats/GPRMC.cs.meta | 11 - .../Serializers/GNSS/NMEA/Formats/GPVTG.cs | 62 -- .../GNSS/NMEA/Formats/GPVTG.cs.meta | 11 - .../Serializers/GNSS/NMEA/NMEAFormat.cs | 91 --- .../Serializers/GNSS/NMEA/NMEAFormat.cs.meta | 11 - .../GNSS/NMEA/NMEAFormatManager.cs | 32 - .../GNSS/NMEA/NMEAFormatManager.cs.meta | 11 - .../Serializers/GNSS/NMEASerializer.cs | 51 -- .../Serializers/GNSS/NMEASerializer.cs.meta | 11 - .../Scripts/Serializers/GeometryMsgs.meta | 8 + .../GeometryMsgs/PoseStampedMsgSerializer.cs | 37 + .../PoseStampedMsgSerializer.cs.meta | 0 .../Scripts/Serializers/HeaderSerializer.cs | 40 - .../Runtime/Scripts/Serializers/IMU.meta | 8 - .../Serializers/IMU/IMUMsgSerializer.cs | 29 - .../Runtime/Scripts/Serializers/Image.meta | 8 - .../Serializers/Image/ImageMsgSerializer.cs | 32 - .../Runtime/Scripts/Serializers/LiDAR.meta | 8 - .../Scripts/Serializers/LiDAR/Velodyne.meta | 8 - .../LiDAR/Velodyne/VelodyneMsgSerializer.cs | 153 ---- .../Velodyne/VelodyneMsgSerializer.cs.meta | 11 - .../PointCloud/IPointsToPointCloud2MsgJob.cs | 29 - .../PointCloud/PointCloud2MsgSerializer.cs | 71 -- .../Runtime/Scripts/Serializers/Pose.meta | 8 - .../Pose/PoseStampedMsgSerializer.cs | 31 - .../Scripts/Serializers/SensorMsgs.meta | 8 + .../SensorMsgs/CameraInfoMsgSerializer.cs | 35 + .../CameraInfoMsgSerializer.cs.meta | 0 .../CompressedImageMsgSerializer.cs | 47 ++ .../CompressedImageMsgSerializer.cs.meta} | 0 .../Serializers/SensorMsgs/IInvertXJob.cs | 20 + .../IInvertXJob.cs.meta} | 0 .../SensorMsgs/IMUMsgSerializer.cs | 37 + .../IMUMsgSerializer.cs.meta | 0 .../NavSatFixMsgSerializer.cs | 26 +- .../NavSatFixMsgSerializer.cs.meta | 0 .../SensorMsgs/PointCloud2MsgSerializer.cs | 82 ++ .../PointCloud2MsgSerializer.cs.meta | 0 .../Runtime/Scripts/Serializers/Serializer.cs | 21 +- .../Runtime/Scripts/Serializers/StdMsgs.meta | 8 + .../Serializers/StdMsgs/HeaderSerializer.cs | 50 ++ .../{ => StdMsgs}/HeaderSerializer.cs.meta | 0 .../Runtime/Scripts/Serializers/TF.meta | 8 - .../Runtime/Scripts/Serializers/Tf2Msgs.meta | 8 + .../TFMessageMsgSerializer.cs} | 16 +- .../TFMessageMsgSerializer.cs.meta} | 0 .../Runtime/Scripts/Utils/PointCloud.meta | 8 + .../Utils/PointCloud/PointUtilitiesROS.cs | 46 ++ .../PointCloud/PointUtilitiesROS.cs.meta | 11 + .../Scripts/Utils/{Clock.meta => Time.meta} | 0 .../Scripts/Utils/{Clock => Time}/ROSClock.cs | 10 +- .../Utils/{Clock => Time}/ROSClock.cs.meta | 0 Assets/UnitySensorsROS/Samples/TF.meta | 8 - Assets/UnitySensorsROS/Samples/TF/TF.unity | 729 ------------------ 262 files changed, 2163 insertions(+), 3288 deletions(-) create mode 100644 Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs rename Assets/UnitySensors/{Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs.meta => Editor/Attributes/InterfaceDrawer.cs.meta} (83%) rename Assets/UnitySensors/Editor/{GroundTruth.meta => CustomInspector.meta} (77%) rename Assets/UnitySensors/Editor/{GroundTruth => CustomInspector}/GroundTruthEditor.cs (86%) rename Assets/UnitySensors/Editor/{GroundTruth => CustomInspector}/GroundTruthEditor.cs.meta (100%) rename Assets/UnitySensors/Editor/{TF.meta => DataType.meta} (77%) rename Assets/UnitySensors/{Runtime/Scripts/Visualizers => Editor/DataType}/LiDAR.meta (77%) rename Assets/UnitySensors/Editor/{ => DataType}/LiDAR/ScanPatternGenerator.cs (99%) rename Assets/UnitySensors/Editor/{ => DataType}/LiDAR/ScanPatternGenerator.cs.meta (100%) delete mode 100644 Assets/UnitySensors/Editor/TF/TFEditor.cs create mode 100644 Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab rename Assets/{UnitySensorsROS/Samples/TF/TF.unity.meta => UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab.meta} (63%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs rename Assets/UnitySensors/Runtime/Scripts/{Visualizers/Camera/CameraTextureVisualizer.cs.meta => Attributes/InterfaceAttribute.cs.meta} (83%) delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZ.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZI.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Data/Texture.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs rename Assets/UnitySensors/Runtime/Scripts/{Data.meta => DataType.meta} (100%) rename Assets/UnitySensors/Runtime/Scripts/{Data/Pose.meta => DataType/Geometry.meta} (77%) rename Assets/UnitySensors/Runtime/Scripts/{Utils/GeoCoordinates => DataType/Geometry}/GeoCoordinate.cs (80%) rename Assets/UnitySensors/Runtime/Scripts/{Utils/GeoCoordinates => DataType/Geometry}/GeoCoordinate.cs.meta (83%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs rename Assets/UnitySensors/Runtime/Scripts/{Visualizers/LiDAR/LiDARVisualizer.cs.meta => DataType/Geometry/Vector3D.cs.meta} (83%) rename Assets/UnitySensors/{Editor => Runtime/Scripts/DataType}/LiDAR.meta (77%) rename Assets/UnitySensors/Runtime/Scripts/{Sensors/LiDAR/ScanPattern => DataType/LiDAR}/ScanPattern.cs (91%) rename Assets/UnitySensors/Runtime/Scripts/{Sensors/LiDAR/ScanPattern => DataType/LiDAR}/ScanPattern.cs.meta (100%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/DataType/Sensor.meta rename Assets/UnitySensors/Runtime/Scripts/{Data => DataType/Sensor}/PointCloud.meta (100%) rename Assets/UnitySensors/Runtime/Scripts/{Data => DataType/Sensor}/PointCloud/PointCloud.cs (51%) rename Assets/UnitySensors/Runtime/Scripts/{Data => DataType/Sensor}/PointCloud/PointCloud.cs.meta (100%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZ.cs rename Assets/UnitySensors/Runtime/Scripts/{Data => DataType/Sensor}/PointCloud/PointXYZ.cs.meta (100%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZI.cs rename Assets/UnitySensors/Runtime/Scripts/{Data => DataType/Sensor}/PointCloud/PointXYZI.cs.meta (100%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs rename Assets/UnitySensors/Runtime/Scripts/{Data/PointCloud/IPointXYZInterface.cs.meta => DataType/Sensor/PointCloud/PointXYZRGB.cs.meta} (83%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs.meta rename Assets/UnitySensors/Runtime/Scripts/{Data/Pose => Interfaces/Geometry}/IPoseInterface.cs (78%) rename Assets/UnitySensors/Runtime/Scripts/{Data/Pose => Interfaces/Geometry}/IPoseInterface.cs.meta (100%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs.meta rename Assets/UnitySensors/Runtime/Scripts/{Data/PointCloud => Interfaces/Sensor}/IPointCloudInterface.cs (59%) rename Assets/UnitySensors/Runtime/Scripts/{Data/PointCloud => Interfaces/Sensor}/IPointCloudInterface.cs.meta (83%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs rename Assets/UnitySensors/Runtime/Scripts/{Data/Texture => Interfaces/Sensor}/ITextureInterface.cs.meta (83%) rename Assets/UnitySensors/Runtime/Scripts/{Visualizers => Interfaces/Sensor}/PointCloud.meta (77%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs rename Assets/UnitySensors/Runtime/Scripts/{Data => Interfaces/Sensor}/PointCloud/IPointInterface.cs.meta (83%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Std.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern.meta rename Assets/UnitySensors/Runtime/Scripts/Utils/{GeoCoordinates.meta => Geometry.meta} (100%) rename Assets/UnitySensors/Runtime/Scripts/Utils/{GeoCoordinates => Geometry}/GeoCoordinateConverter.cs (79%) rename Assets/UnitySensors/Runtime/Scripts/Utils/{GeoCoordinates => Geometry}/GeoCoordinateConverter.cs.meta (100%) rename Assets/{UnitySensorsROS/Runtime/Scripts/Publishers => UnitySensors/Runtime/Scripts/Utils}/PointCloud.meta (77%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor.meta rename Assets/{UnitySensorsROS/Runtime/Scripts/Serializers => UnitySensors/Runtime/Scripts/Visualizers/Sensor}/PointCloud.meta (77%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs rename Assets/UnitySensors/Runtime/Scripts/Visualizers/{Camera/DepthCamera => Sensor/PointCloud}/DepthCameraPointCloudVisualizer.cs.meta (83%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs.meta create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs.meta rename Assets/UnitySensors/Runtime/Scripts/Visualizers/{PointCloud => Sensor}/PointCloudVisualizer.cs (52%) rename Assets/UnitySensors/Runtime/Scripts/Visualizers/{PointCloud => Sensor}/PointCloudVisualizer.cs.meta (100%) create mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/TextureVisualizer.cs rename Assets/UnitySensors/Runtime/Scripts/Visualizers/{Texture => Sensor}/TextureVisualizer.cs.meta (100%) delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture.meta delete mode 100644 Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture/TextureVisualizer.cs create mode 100644 Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader create mode 100644 Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader.meta create mode 100644 Assets/UnitySensorsROS/Editor/CustomInspector.meta create mode 100644 Assets/UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs rename Assets/{UnitySensors/Editor/TF/TFEditor.cs.meta => UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef create mode 100644 Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab rename Assets/UnitySensorsROS/Runtime/{Scripts/Messages/Nmea/LICENSE.txt.meta => Prefabs/Camera/RGBDCamera_ros.prefab.meta} (62%) delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraInfoMsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NavSatFixMsgPublisher.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU/IMUMsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image/ImageMsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud/PointCloud2MsgPublisher.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CameraInfoMsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{Camera => SensorMsgs}/CameraInfoMsgPublisher.cs.meta (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CompressedImageMsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{Image/ImageMsgPublisher.cs.meta => SensorMsgs/CompressedImageMsgPublisher.cs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/IMUMsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{IMU => SensorMsgs}/IMUMsgPublisher.cs.meta (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/NavSatFixMsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{GNSS => SensorMsgs}/NavSatFixMsgPublisher.cs.meta (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{Camera/DepthCamera => SensorMsgs/PointCloud2Msg}/DepthCameraPointCloud2MsgPublisher.cs.meta (83%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2MsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{PointCloud => SensorMsgs}/PointCloud2MsgPublisher.cs.meta (100%) delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF/TFMsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{TF.meta => Tf2Msgs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs/TFMessageMsgPublisher.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Publishers/{TF/TFMsgPublisher.cs.meta => Tf2Msgs/TFMessageMsgPublisher.cs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Sensors.meta rename Assets/{UnitySensors => UnitySensorsROS}/Runtime/Scripts/Sensors/TF.meta (100%) rename Assets/{UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs => UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs} (53%) rename Assets/{UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs.meta => UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs.meta} (100%) delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera/CameraInfoMsgSerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs/PoseStampedMsgSerializer.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{Pose => GeometryMsgs}/PoseStampedMsgSerializer.cs.meta (100%) delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/HeaderSerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU/IMUMsgSerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image/ImageMsgSerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/IPointsToPointCloud2MsgJob.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/PointCloud2MsgSerializer.cs delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose.meta delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose/PoseStampedMsgSerializer.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CameraInfoMsgSerializer.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{Camera => SensorMsgs}/CameraInfoMsgSerializer.cs.meta (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CompressedImageMsgSerializer.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{Image/ImageMsgSerializer.cs.meta => SensorMsgs/CompressedImageMsgSerializer.cs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IInvertXJob.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{PointCloud/IPointsToPointCloud2MsgJob.cs.meta => SensorMsgs/IInvertXJob.cs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IMUMsgSerializer.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{IMU => SensorMsgs}/IMUMsgSerializer.cs.meta (100%) rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{GNSS => SensorMsgs}/NavSatFixMsgSerializer.cs (57%) rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{GNSS => SensorMsgs}/NavSatFixMsgSerializer.cs.meta (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/PointCloud2MsgSerializer.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{PointCloud => SensorMsgs}/PointCloud2MsgSerializer.cs.meta (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs/HeaderSerializer.cs rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{ => StdMsgs}/HeaderSerializer.cs.meta (100%) delete mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs.meta rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{TF/TFMsgSerializer.cs => Tf2Msgs/TFMessageMsgSerializer.cs} (76%) rename Assets/UnitySensorsROS/Runtime/Scripts/Serializers/{TF/TFMsgSerializer.cs.meta => Tf2Msgs/TFMessageMsgSerializer.cs.meta} (100%) create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud.meta create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs create mode 100644 Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs.meta rename Assets/UnitySensorsROS/Runtime/Scripts/Utils/{Clock.meta => Time.meta} (100%) rename Assets/UnitySensorsROS/Runtime/Scripts/Utils/{Clock => Time}/ROSClock.cs (81%) rename Assets/UnitySensorsROS/Runtime/Scripts/Utils/{Clock => Time}/ROSClock.cs.meta (100%) delete mode 100644 Assets/UnitySensorsROS/Samples/TF.meta delete mode 100644 Assets/UnitySensorsROS/Samples/TF/TF.unity diff --git a/Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs b/Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs new file mode 100644 index 00000000..9f164b91 --- /dev/null +++ b/Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs @@ -0,0 +1,62 @@ +using UnityEngine; +using UnityEditor; + +namespace UnitySensors.Attribute +{ + [CustomPropertyDrawer(typeof(InterfaceAttribute))] + public class InterfaceTypeDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + InterfaceAttribute ia = attribute as InterfaceAttribute; + + if (property.propertyType != SerializedPropertyType.ObjectReference) return; + + MonoBehaviour old = property.objectReferenceValue as MonoBehaviour; + + GameObject temp = null; + string oldName = ""; + + if (Event.current.type == EventType.Repaint) + { + if (old == null) + { + temp = new GameObject("None [" + ia.type.Name + "]"); + old = temp.AddComponent(); + } + else + { + oldName = old.name; + old.name = oldName + " [" + ia.type.Name + "]"; + } + } + + MonoBehaviour present = EditorGUI.ObjectField(position, label, old, typeof(MonoBehaviour), true) as MonoBehaviour; + + if (Event.current.type == EventType.Repaint) + { + if (temp != null) + GameObject.DestroyImmediate(temp); + else + old.name = oldName; + } + + if (old == present) return; + + if (present != null) + { + if (present.GetType() != ia.type) + present = present.gameObject.GetComponent(ia.type) as MonoBehaviour; + + if (present == null) return; + } + + property.objectReferenceValue = present; + property.serializedObject.ApplyModifiedProperties(); + } + } + + public class Interface : MonoBehaviour + { + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs.meta b/Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs.meta rename to Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs.meta index 94089bd1..4046c3fa 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs.meta +++ b/Assets/UnitySensors/Editor/Attributes/InterfaceDrawer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 22819631f216fab49a57f6eacd752d61 +guid: a9ccf69e968a50843add123f3c020fd6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Editor/GroundTruth.meta b/Assets/UnitySensors/Editor/CustomInspector.meta similarity index 77% rename from Assets/UnitySensors/Editor/GroundTruth.meta rename to Assets/UnitySensors/Editor/CustomInspector.meta index 54fd0851..7dbc781a 100644 --- a/Assets/UnitySensors/Editor/GroundTruth.meta +++ b/Assets/UnitySensors/Editor/CustomInspector.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1f67742c25b57a64c8a61f24929f8090 +guid: f4d0616dd1d13624e8ab85e54725f111 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Editor/GroundTruth/GroundTruthEditor.cs b/Assets/UnitySensors/Editor/CustomInspector/GroundTruthEditor.cs similarity index 86% rename from Assets/UnitySensors/Editor/GroundTruth/GroundTruthEditor.cs rename to Assets/UnitySensors/Editor/CustomInspector/GroundTruthEditor.cs index 509dcfb7..005ac9f2 100644 --- a/Assets/UnitySensors/Editor/GroundTruth/GroundTruthEditor.cs +++ b/Assets/UnitySensors/Editor/CustomInspector/GroundTruthEditor.cs @@ -1,8 +1,9 @@ using UnityEditor; -using UnitySensors.Sensor.GroundTruth; +//using UnitySensors.Sensor.GroundTruth; namespace UnitySensors.Editor { + /* [CustomEditor(typeof(GroundTruth))] public class GroundTruthEditor : UnityEditor.Editor { @@ -12,4 +13,5 @@ public override void OnInspectorGUI() EditorGUILayout.HelpBox("GroundTruth does not use \"Frequency\" param.", MessageType.Info); } } + */ } \ No newline at end of file diff --git a/Assets/UnitySensors/Editor/GroundTruth/GroundTruthEditor.cs.meta b/Assets/UnitySensors/Editor/CustomInspector/GroundTruthEditor.cs.meta similarity index 100% rename from Assets/UnitySensors/Editor/GroundTruth/GroundTruthEditor.cs.meta rename to Assets/UnitySensors/Editor/CustomInspector/GroundTruthEditor.cs.meta diff --git a/Assets/UnitySensors/Editor/TF.meta b/Assets/UnitySensors/Editor/DataType.meta similarity index 77% rename from Assets/UnitySensors/Editor/TF.meta rename to Assets/UnitySensors/Editor/DataType.meta index 8e239ee8..ad678946 100644 --- a/Assets/UnitySensors/Editor/TF.meta +++ b/Assets/UnitySensors/Editor/DataType.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b7c78d4493555194699971334b263157 +guid: c32a713a080943347936bc27971033d7 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR.meta b/Assets/UnitySensors/Editor/DataType/LiDAR.meta similarity index 77% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR.meta rename to Assets/UnitySensors/Editor/DataType/LiDAR.meta index 82611f82..fc8935a3 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR.meta +++ b/Assets/UnitySensors/Editor/DataType/LiDAR.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 436f6b5a18a7398408e6f9f84d980f94 +guid: ada79c3060577e74d986fcd3d8a5b8a8 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Editor/LiDAR/ScanPatternGenerator.cs b/Assets/UnitySensors/Editor/DataType/LiDAR/ScanPatternGenerator.cs similarity index 99% rename from Assets/UnitySensors/Editor/LiDAR/ScanPatternGenerator.cs rename to Assets/UnitySensors/Editor/DataType/LiDAR/ScanPatternGenerator.cs index 4da26159..d7b1b79e 100644 --- a/Assets/UnitySensors/Editor/LiDAR/ScanPatternGenerator.cs +++ b/Assets/UnitySensors/Editor/DataType/LiDAR/ScanPatternGenerator.cs @@ -4,7 +4,7 @@ using Unity.Mathematics; -namespace UnitySensors.Sensor.LiDAR +namespace UnitySensors.DataType.LiDAR { #if UNITY_EDITOR class ScanPatternGenerator : EditorWindow diff --git a/Assets/UnitySensors/Editor/LiDAR/ScanPatternGenerator.cs.meta b/Assets/UnitySensors/Editor/DataType/LiDAR/ScanPatternGenerator.cs.meta similarity index 100% rename from Assets/UnitySensors/Editor/LiDAR/ScanPatternGenerator.cs.meta rename to Assets/UnitySensors/Editor/DataType/LiDAR/ScanPatternGenerator.cs.meta diff --git a/Assets/UnitySensors/Editor/TF/TFEditor.cs b/Assets/UnitySensors/Editor/TF/TFEditor.cs deleted file mode 100644 index 5f7d78ce..00000000 --- a/Assets/UnitySensors/Editor/TF/TFEditor.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEditor; -using UnitySensors.Sensor.TF; - -namespace UnitySensors.Editor -{ - [CustomEditor(typeof(TF))] - public class TFEditor : UnityEditor.Editor - { - public override void OnInspectorGUI() - { - base.OnInspectorGUI(); - EditorGUILayout.HelpBox("TF does not use \"Frequency\" param.", MessageType.Info); - } - } -} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Prefabs/Camera/DepthCamera.prefab b/Assets/UnitySensors/Runtime/Prefabs/Camera/DepthCamera.prefab index 2b30cb9c..55dad53b 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/Camera/DepthCamera.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/Camera/DepthCamera.prefab @@ -11,8 +11,7 @@ GameObject: - component: {fileID: 1105687583338018336} - component: {fileID: 1105687583338018399} - component: {fileID: 1105687583338018398} - - component: {fileID: 1105687583338018397} - - component: {fileID: 1105687583338018396} + - component: {fileID: 859923666563037401} m_Layer: 0 m_Name: DepthCamera m_TagString: Untagged @@ -95,7 +94,8 @@ MonoBehaviour: _fov: 30 _minRange: 0.05 _maxRange: 100 ---- !u!114 &1105687583338018397 + _gaussianNoiseSigma: 0 +--- !u!114 &859923666563037401 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -104,19 +104,7 @@ MonoBehaviour: m_GameObject: {fileID: 1105687583338018395} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fc838544d115b7741a2cb963bc058b29, type: 3} - m_Name: - m_EditorClassIdentifier: - _image: {fileID: 0} ---- !u!114 &1105687583338018396 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1105687583338018395} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f34cfe1c27eb79849a7bd77d281a5253, type: 3} + m_Script: {fileID: 11500000, guid: f2f05a788e73116488577387bd40affc, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 1105687583338018398} diff --git a/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBCamera.prefab b/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBCamera.prefab index 3df90710..2a34e64e 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBCamera.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBCamera.prefab @@ -11,7 +11,7 @@ GameObject: - component: {fileID: 6023160553514482209} - component: {fileID: 6023160553514482210} - component: {fileID: 6023160553514482212} - - component: {fileID: 6023160553514482213} + - component: {fileID: -4194670642642625912} m_Layer: 0 m_Name: RGBCamera m_TagString: Untagged @@ -94,7 +94,7 @@ MonoBehaviour: _fov: 30 _minRange: 0.05 _maxRange: 100 ---- !u!114 &6023160553514482213 +--- !u!114 &-4194670642642625912 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -103,7 +103,9 @@ MonoBehaviour: m_GameObject: {fileID: 6023160553514482222} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fc838544d115b7741a2cb963bc058b29, type: 3} + m_Script: {fileID: 11500000, guid: 5202acb8ddfd0c546b69f23eb10b4e60, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 6023160553514482212} + _sourceTexture: 0 _image: {fileID: 0} diff --git a/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab b/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab new file mode 100644 index 00000000..a28e1867 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab @@ -0,0 +1,126 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1785895639420286579 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1785895639420286472} + - component: {fileID: 1785895639420286583} + - component: {fileID: 4070371534656761714} + - component: {fileID: 4022873546115888586} + - component: {fileID: 421189727119020206} + m_Layer: 0 + m_Name: RGBDCamera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1785895639420286472 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785895639420286579} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &1785895639420286583 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785895639420286579} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!114 &4070371534656761714 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785895639420286579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 58044c1bc2a88b943af133119c691560, type: 3} + m_Name: + m_EditorClassIdentifier: + _frequency: 10 + _resolution: {x: 640, y: 480} + _fov: 30 + _minRange: 0.05 + _maxRange: 100 + _gaussianNoiseSigma: 0 +--- !u!114 &4022873546115888586 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785895639420286579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1a3dffef534585740aa9f93736bdd5ca, type: 3} + m_Name: + m_EditorClassIdentifier: + _source: {fileID: 4070371534656761714} +--- !u!114 &421189727119020206 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785895639420286579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5202acb8ddfd0c546b69f23eb10b4e60, type: 3} + m_Name: + m_EditorClassIdentifier: + _source: {fileID: 4070371534656761714} + _sourceTexture: 0 + _image: {fileID: 0} diff --git a/Assets/UnitySensorsROS/Samples/TF/TF.unity.meta b/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab.meta similarity index 63% rename from Assets/UnitySensorsROS/Samples/TF/TF.unity.meta rename to Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab.meta index e45fd64f..b3f6b5d5 100644 --- a/Assets/UnitySensorsROS/Samples/TF/TF.unity.meta +++ b/Assets/UnitySensors/Runtime/Prefabs/Camera/RGBDCamera.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: e84e2ab71efe63b4a984b45a10c6ff38 -DefaultImporter: +guid: 6a2c732697fa6da47999dd17b096ab09 +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/UnitySensors/Runtime/Prefabs/IMU/IMU.prefab b/Assets/UnitySensors/Runtime/Prefabs/IMU/IMU.prefab index 445dfa88..a2db31d9 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/IMU/IMU.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/IMU/IMU.prefab @@ -9,7 +9,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 5305839302562335606} - - component: {fileID: 5305839302562335607} + - component: {fileID: 7445696916328043224} m_Layer: 0 m_Name: IMU m_TagString: Untagged @@ -32,7 +32,7 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &5305839302562335607 +--- !u!114 &7445696916328043224 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -44,7 +44,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: de1d05f7ef764aa45be46678498c90e4, type: 3} m_Name: m_EditorClassIdentifier: - _frequency: 20 + _frequency: 10 _position: {x: 0, y: 0, z: 0} _velocity: {x: 0, y: 0, z: 0} _acceleration: {x: 0, y: 0, z: 0} diff --git a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Livox/Mid-360.prefab b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Livox/Mid-360.prefab index de364d17..9be36d50 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Livox/Mid-360.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Livox/Mid-360.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 9210621271187283362} - component: {fileID: 9210621271187283363} - - component: {fileID: 9210621271187283360} + - component: {fileID: 3771061048342558472} m_Layer: 0 m_Name: Sensor m_TagString: Untagged @@ -52,7 +52,7 @@ MonoBehaviour: _maxRange: 70 _gaussianNoiseSigma: 0.02 _maxIntensity: 255 ---- !u!114 &9210621271187283360 +--- !u!114 &3771061048342558472 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -61,9 +61,10 @@ MonoBehaviour: m_GameObject: {fileID: 9210621271187283373} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a8859907edf5114c9beadbee04254ad, type: 3} + m_Script: {fileID: 11500000, guid: f2ac6256eabda88478ca2a2fc51a2c64, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 9210621271187283363} --- !u!1 &9210621271227589044 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16.prefab b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16.prefab index 17c65b3a..7dff3d30 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16.prefab @@ -144,9 +144,10 @@ MonoBehaviour: m_GameObject: {fileID: 5955675792109571646} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a8859907edf5114c9beadbee04254ad, type: 3} + m_Script: {fileID: 11500000, guid: f2ac6256eabda88478ca2a2fc51a2c64, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 5955675792109571644} --- !u!1 &5955675793193326067 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16HiRes.prefab b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16HiRes.prefab index 9941ac57..6f0263f3 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16HiRes.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-16HiRes.prefab @@ -243,7 +243,7 @@ GameObject: m_Component: - component: {fileID: 5738741472997638501} - component: {fileID: 5738741472997638426} - - component: {fileID: 5738741472997638427} + - component: {fileID: 2499637783975528950} m_Layer: 0 m_Name: Sensor m_TagString: Untagged @@ -285,7 +285,7 @@ MonoBehaviour: _maxRange: 100 _gaussianNoiseSigma: 0.05 _maxIntensity: 255 ---- !u!114 &5738741472997638427 +--- !u!114 &2499637783975528950 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -294,9 +294,10 @@ MonoBehaviour: m_GameObject: {fileID: 5738741472997638424} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a8859907edf5114c9beadbee04254ad, type: 3} + m_Script: {fileID: 11500000, guid: f2ac6256eabda88478ca2a2fc51a2c64, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 5738741472997638426} --- !u!1 &5738741473100887785 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-32.prefab b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-32.prefab index af718b25..a9aa0659 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-32.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLP-32.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 4239717977722247790} - component: {fileID: 4239717977722247697} - - component: {fileID: 4239717977722247696} + - component: {fileID: 4947725978431309543} m_Layer: 0 m_Name: Sensor m_TagString: Untagged @@ -52,7 +52,7 @@ MonoBehaviour: _maxRange: 100 _gaussianNoiseSigma: 0.05 _maxIntensity: 255 ---- !u!114 &4239717977722247696 +--- !u!114 &4947725978431309543 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -61,9 +61,10 @@ MonoBehaviour: m_GameObject: {fileID: 4239717977722247699} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a8859907edf5114c9beadbee04254ad, type: 3} + m_Script: {fileID: 11500000, guid: f2ac6256eabda88478ca2a2fc51a2c64, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 4239717977722247697} --- !u!1 &4239717977887452642 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLS-128_with_DepthBuffer.prefab b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLS-128_with_DepthBuffer.prefab index 0aa70930..8873cde6 100644 --- a/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLS-128_with_DepthBuffer.prefab +++ b/Assets/UnitySensors/Runtime/Prefabs/LiDAR/Velodyne/VLS-128_with_DepthBuffer.prefab @@ -93,7 +93,7 @@ GameObject: m_Component: - component: {fileID: 9219009776518534085} - component: {fileID: 9219009776518534082} - - component: {fileID: 9219009776518534083} + - component: {fileID: 9107878023928292438} m_Layer: 0 m_Name: Sensor m_TagString: Untagged @@ -137,7 +137,7 @@ MonoBehaviour: _maxIntensity: 255 _texturePixelsNum: 1500000 _textureSizePerCamera: {x: 0, y: 0} ---- !u!114 &9219009776518534083 +--- !u!114 &9107878023928292438 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -146,9 +146,10 @@ MonoBehaviour: m_GameObject: {fileID: 9219009776518534072} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8a8859907edf5114c9beadbee04254ad, type: 3} + m_Script: {fileID: 11500000, guid: f2ac6256eabda88478ca2a2fc51a2c64, type: 3} m_Name: m_EditorClassIdentifier: + _source: {fileID: 9219009776518534082} --- !u!1 &9219009777597040757 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs b/Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs new file mode 100644 index 00000000..f35c1c8c --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs @@ -0,0 +1,15 @@ +using UnityEngine; +using System; + +namespace UnitySensors.Attribute +{ + public class InterfaceAttribute : PropertyAttribute + { + public Type type; + + public InterfaceAttribute(Type type) + { + this.type = type; + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs.meta index 18367ae0..bcdb5e6f 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Attributes/InterfaceAttribute.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fc838544d115b7741a2cb963bc058b29 +guid: 4c76b944835877e4a994d87989fd4e3a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs deleted file mode 100644 index a4a12e2b..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Unity.Collections; - -namespace UnitySensors.Data.PointCloud -{ - public interface IPointInterface - { - public void CopyTo(NativeArray dst); - } -} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs deleted file mode 100644 index e804d357..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Unity.Mathematics; - -namespace UnitySensors.Data.PointCloud -{ - public interface IPointXYZInterface : IPointInterface - { - public float3 position { get; } - } -} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZ.cs b/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZ.cs deleted file mode 100644 index ab861986..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZ.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Unity.Collections; -using Unity.Mathematics; - -namespace UnitySensors.Data.PointCloud -{ - public struct PointXYZ : IPointXYZInterface - { - private float3 _position; - - public float3 position { get => _position; set => _position = value; } - - public void CopyTo(NativeArray dst) - { - dst.GetSubArray(0, 4).CopyFrom(BitConverter.GetBytes(_position.x)); - dst.GetSubArray(4, 4).CopyFrom(BitConverter.GetBytes(_position.y)); - dst.GetSubArray(8, 4).CopyFrom(BitConverter.GetBytes(_position.z)); - } - } -} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZI.cs b/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZI.cs deleted file mode 100644 index f56d9ef4..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZI.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Unity.Collections; -using Unity.Mathematics; - -namespace UnitySensors.Data.PointCloud -{ - public struct PointXYZI : IPointXYZInterface - { - private float3 _position; - public float intensity; - public float3 position { get => _position; set => _position = value; } - - public void CopyTo(NativeArray dst) - { - dst.GetSubArray(0, 4).CopyFrom(BitConverter.GetBytes(_position.x)); - dst.GetSubArray(4, 4).CopyFrom(BitConverter.GetBytes(_position.y)); - dst.GetSubArray(8, 4).CopyFrom(BitConverter.GetBytes(_position.z)); - dst.GetSubArray(12, 4).CopyFrom(BitConverter.GetBytes(intensity)); - } - } -} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/Texture.meta b/Assets/UnitySensors/Runtime/Scripts/Data/Texture.meta deleted file mode 100644 index 97f25fa6..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Data/Texture.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9accbaf0f228f9b43bc848e37c637881 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs deleted file mode 100644 index cd196100..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine; - -namespace UnitySensors.Data.Texture -{ - public interface ITextureInterface - { - public Texture2D texture { get; } - } -} diff --git a/Assets/UnitySensors/Runtime/Scripts/Data.meta b/Assets/UnitySensors/Runtime/Scripts/DataType.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Data.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/Pose.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry.meta similarity index 77% rename from Assets/UnitySensors/Runtime/Scripts/Data/Pose.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Geometry.meta index 8864d044..54ba07e0 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/Pose.meta +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 178d5051c9466c44c8cb92fb4a78d8ef +guid: 5a9ed2b29176c864f88348b83347109c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinate.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/GeoCoordinate.cs similarity index 80% rename from Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinate.cs rename to Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/GeoCoordinate.cs index 40afbcfa..7bd78a82 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinate.cs +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/GeoCoordinate.cs @@ -1,7 +1,7 @@ -namespace UnitySensors.Utils.GeoCoordinate +namespace UnitySensors.DataType.Geometry { [System.Serializable] - public struct GeoCoordinate + public class GeoCoordinate { public GeoCoordinate(double lat, double lon, double alt) { diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinate.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/GeoCoordinate.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinate.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/GeoCoordinate.cs.meta index f3e8c65e..6f0859ee 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinate.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/GeoCoordinate.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 026953520256d9f41b6acc5d1ff71426 +guid: b6e09cfe85ee8c746933b974567f627e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs new file mode 100644 index 00000000..51487ef3 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs @@ -0,0 +1,44 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace UnitySensors.DataType.Geometry +{ + public class Vector3D + { + public double x; + public double y; + public double z; + + public Vector3D() + { + x = y = z = 0; + } + + public Vector3D(double x, double y, double z) + { + this.x = x; + this.y = y; + this.z = z; + } + + public Vector3D(Vector3 vec) + { + x = vec.x; + y = vec.y; + z = vec.z; + } + + public void FromVector3(Vector3 source) + { + x = source.x; + y = source.y; + z = source.z; + } + + public Vector3 ToVector3() + { + return new Vector3((float)x, (float)y, (float)z); + } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs.meta index c64a1ee9..181105b9 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Geometry/Vector3D.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8a8859907edf5114c9beadbee04254ad +guid: 678783905e1a14645a14f3dff365ba19 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Editor/LiDAR.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR.meta similarity index 77% rename from Assets/UnitySensors/Editor/LiDAR.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR.meta index f36fb1f1..f97f3ccd 100644 --- a/Assets/UnitySensors/Editor/LiDAR.meta +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4967c6c40eb14a846b6c0697633a4ac4 +guid: d71673b62fc54b7429dcabeb6e63e493 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern/ScanPattern.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR/ScanPattern.cs similarity index 91% rename from Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern/ScanPattern.cs rename to Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR/ScanPattern.cs index 5c446ee3..d89a9763 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern/ScanPattern.cs +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR/ScanPattern.cs @@ -1,10 +1,9 @@ using UnityEngine; -using UnityEditor; using Unity.Mathematics; using UnitySensors.Attribute; -namespace UnitySensors.Sensor.LiDAR +namespace UnitySensors.DataType.LiDAR { public class ScanPattern : ScriptableObject { diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern/ScanPattern.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR/ScanPattern.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern/ScanPattern.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/LiDAR/ScanPattern.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor.meta new file mode 100644 index 00000000..b333b61f --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd7f6539d113f084b90db0a95172558e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointCloud.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointCloud.cs similarity index 51% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointCloud.cs rename to Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointCloud.cs index d17fc0fa..289f7584 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointCloud.cs +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointCloud.cs @@ -1,10 +1,10 @@ using System; using Unity.Collections; -using Unity.Mathematics; +using UnitySensors.Interface.Sensor.PointCloud; -namespace UnitySensors.Data.PointCloud +namespace UnitySensors.DataType.Sensor { - public struct PointCloud : IDisposable where T : struct, IPointInterface + public class PointCloud : IDisposable where T : struct, IPointInterface { public NativeArray points; diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointCloud.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointCloud.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointCloud.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointCloud.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZ.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZ.cs new file mode 100644 index 00000000..c3e686fe --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZ.cs @@ -0,0 +1,12 @@ +using Unity.Mathematics; + +using UnitySensors.Interface.Sensor.PointCloud; + +namespace UnitySensors.DataType.Sensor.PointCloud +{ + public struct PointXYZ : IPointInterface + { + private float3 _position; + public float3 position { get => _position; set => _position = value; } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZ.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZ.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZ.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZ.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZI.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZI.cs new file mode 100644 index 00000000..4c0c5e9b --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZI.cs @@ -0,0 +1,14 @@ +using Unity.Mathematics; + +using UnitySensors.Interface.Sensor.PointCloud; + +namespace UnitySensors.DataType.Sensor.PointCloud +{ + public struct PointXYZI : IPointInterface + { + private float3 _position; + public float intensity; + + public float3 position { get => _position; set => _position = value; } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZI.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZI.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/PointXYZI.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZI.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs new file mode 100644 index 00000000..0673875e --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs @@ -0,0 +1,23 @@ +using System; +using Unity.Collections; +using Unity.Mathematics; + +using UnitySensors.Interface.Sensor.PointCloud; + +using UnityEngine; + +namespace UnitySensors.DataType.Sensor.PointCloud +{ + [System.Serializable] + public struct PointXYZRGB : IPointInterface + { + [SerializeField] + private float3 _position; + public byte r; + public byte g; + public byte b; + public byte a; + + public float3 position { get => _position; set => _position = value; } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs.meta index 8a3089c8..37079eb6 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointXYZInterface.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/DataType/Sensor/PointCloud/PointXYZRGB.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5f80a0f4e6ff25e4982e0c6d7b22666e +guid: 49f836b5b85e31243a6a556eacb3e347 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces.meta new file mode 100644 index 00000000..dbbf144c --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b82e81a19ae443c4a831ab5a4aebfacf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry.meta new file mode 100644 index 00000000..321fd0f2 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3195f74ad8ce91e4fb74ba3474ceaa1b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs new file mode 100644 index 00000000..a9be63e9 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs @@ -0,0 +1,9 @@ +using UnitySensors.DataType.Geometry; + +namespace UnitySensors.Interface.Geometry +{ + public interface IGeoCoordinateInterface + { + public GeoCoordinate coordinate { get; } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs.meta new file mode 100644 index 00000000..a29d243d --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IGeoCoordinateInterface.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0e2ae104118e9349a42baa4333c1998 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/Pose/IPoseInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IPoseInterface.cs similarity index 78% rename from Assets/UnitySensors/Runtime/Scripts/Data/Pose/IPoseInterface.cs rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IPoseInterface.cs index fe9871f9..c9872542 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/Pose/IPoseInterface.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IPoseInterface.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace UnitySensors.Data.Pose +namespace UnitySensors.Interface.Geometry { public interface IPoseInterface { diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/Pose/IPoseInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IPoseInterface.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Data/Pose/IPoseInterface.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Geometry/IPoseInterface.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor.meta new file mode 100644 index 00000000..b1311fe3 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 162b3d58085a39f4f91a44a79c74a006 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs new file mode 100644 index 00000000..6b9746b2 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace UnitySensors.Interface.Sensor +{ + public interface ICameraInterface + { + public Camera m_camera { get; } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs.meta new file mode 100644 index 00000000..6057c0b6 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ICameraInterface.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf69d703a2e42b844b726a16214b80b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs new file mode 100644 index 00000000..88a64af2 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace UnitySensors.Interface.Sensor +{ + public interface IImuDataInterface + { + public Vector3 acceleration { get; } + public Quaternion rotation { get; } + public Vector3 angularVelocity { get; } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs.meta new file mode 100644 index 00000000..ae351cc8 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IImuDataInterface.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6792853748668214798c99d9bab79841 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointCloudInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IPointCloudInterface.cs similarity index 59% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointCloudInterface.cs rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IPointCloudInterface.cs index faf41705..9caafc89 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointCloudInterface.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IPointCloudInterface.cs @@ -1,10 +1,11 @@ -using Unity.Collections; +using UnitySensors.DataType.Sensor; +using UnitySensors.Interface.Sensor.PointCloud; -namespace UnitySensors.Data.PointCloud +namespace UnitySensors.Interface.Sensor { public interface IPointCloudInterface where T : struct, IPointInterface { public PointCloud pointCloud { get; } public int pointsNum { get; } } -} +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointCloudInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IPointCloudInterface.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointCloudInterface.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IPointCloudInterface.cs.meta index cbffdbf4..73fd764c 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointCloudInterface.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/IPointCloudInterface.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 004afa2710acbb34b9ce154b1ce02213 +guid: 93051d61501a2f94ca8fb9aa37c8bfd4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs new file mode 100644 index 00000000..28e76f3f --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs @@ -0,0 +1,10 @@ +using UnityEngine; + +namespace UnitySensors.Interface.Sensor +{ + public interface ITextureInterface + { + public Texture2D texture0 { get; } + public Texture2D texture1 { get; } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs.meta index fe9d0c67..4fdefeef 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/Texture/ITextureInterface.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/ITextureInterface.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 733a3f55ec218c04f95cc796ed3926fc +guid: 41dfa054de7d83d4ba0b91d5a7d3ef0e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud.meta similarity index 77% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud.meta rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud.meta index 145e272d..eb2f1a06 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0d2dfd099dd33134d99958d37cad4eed +guid: 6d5a7872469422c4e8ec1caeff004a5c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs new file mode 100644 index 00000000..55918a8c --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs @@ -0,0 +1,10 @@ +using Unity.Collections; +using Unity.Mathematics; + +namespace UnitySensors.Interface.Sensor.PointCloud +{ + public interface IPointInterface + { + public float3 position { get; set; } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs.meta index b1db6f69..feca7f36 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Data/PointCloud/IPointInterface.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Sensor/PointCloud/IPointInterface.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1c41a96fc5b816a4caf653c7245c7be7 +guid: d1023061985d9df459b16422f5e68670 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std.meta new file mode 100644 index 00000000..f23c6cbf --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 612243489ad8c244eba80780a37bffe1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs new file mode 100644 index 00000000..8b05ef90 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs @@ -0,0 +1,7 @@ +namespace UnitySensors.Interface.Std +{ + public interface ITimeInterface + { + public float time { get; } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs.meta new file mode 100644 index 00000000..d72a5383 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Interfaces/Std/ITimeInterface.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9bb309144c8ff640ae0afa217d3262f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/CameraSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/CameraSensor.cs index be86f7d4..b3b93986 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/CameraSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/CameraSensor.cs @@ -1,74 +1,18 @@ using UnityEngine; using UnityEngine.Rendering; -using UnitySensors.Data.Texture; +using UnitySensors.Interface.Sensor; namespace UnitySensors.Sensor.Camera { [RequireComponent(typeof(UnityEngine.Camera))] - public abstract class CameraSensor : UnitySensor, ITextureInterface + public abstract class CameraSensor : UnitySensor, ICameraInterface { [SerializeField] - private Vector2Int _resolution = new Vector2Int(640, 480); + protected Vector2Int _resolution = new Vector2Int(640, 480); [SerializeField] - private float _fov = 30.0f; - [SerializeField] - private float _minRange = 0.05f; - [SerializeField] - private float _maxRange = 100.0f; - - private UnityEngine.Camera _m_camera; - private RenderTexture _rt = null; - private Texture2D _texture; - - public Vector2Int resolution { get => _resolution; } - protected float maxRange { get => _maxRange; } - public UnityEngine.Camera m_camera { get => _m_camera; } - public Texture2D texture { get => _texture; } - - protected override void Init() - { - _m_camera = GetComponent(); - _m_camera.fieldOfView = _fov; - _m_camera.nearClipPlane = _minRange; - _m_camera.farClipPlane = _maxRange; - - _rt = new RenderTexture(_resolution.x, _resolution.y, 32, RenderTextureFormat.ARGBFloat); - _m_camera.targetTexture = _rt; - - _texture = new Texture2D(_resolution.x, _resolution.y, TextureFormat.RGBAFloat, false); - } - - protected override void UpdateSensor() - { - if (!LoadTexture()) return; - - if (onSensorUpdated != null) - onSensorUpdated.Invoke(); - } - - protected bool LoadTexture() - { - bool result = false; - AsyncGPUReadback.Request(_rt, 0, request => { - if (request.hasError) - { - } - else - { - var data = request.GetData(); - _texture.LoadRawTextureData(data); - _texture.Apply(); - result = true; - } - }); - AsyncGPUReadback.WaitAllRequests(); - return result; - } + protected float _fov = 30.0f; - protected override void OnSensorDestroy() - { - _rt.Release(); - } + public abstract UnityEngine.Camera m_camera { get; } } } diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/DepthCameraSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/DepthCameraSensor.cs index 3b79c673..bc55695b 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/DepthCameraSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/DepthCameraSensor.cs @@ -5,18 +5,29 @@ using Unity.Jobs; using Unity.Mathematics; -using UnitySensors.Data.PointCloud; +using UnitySensors.DataType.Sensor; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; using UnitySensors.Utils.Noise; using Random = Unity.Mathematics.Random; namespace UnitySensors.Sensor.Camera { - public class DepthCameraSensor : CameraSensor, IPointCloudInterface + [RequireComponent(typeof(UnityEngine.Camera))] + public class DepthCameraSensor : CameraSensor, ITextureInterface, IPointCloudInterface { + [SerializeField] + protected float _minRange = 0.05f; + [SerializeField] + protected float _maxRange = 100.0f; [SerializeField] private float _gaussianNoiseSigma = 0.0f; + private UnityEngine.Camera _camera; + private RenderTexture _rt = null; + private Texture2D _texture; + private Material _mat; private JobHandle _jobHandle; @@ -29,12 +40,24 @@ public class DepthCameraSensor : CameraSensor, IPointCloudInterface private PointCloud _pointCloud; private int _pointsNum; + + public override UnityEngine.Camera m_camera { get => _camera; } + public Texture2D texture0 { get => _texture; } + public Texture2D texture1 { get => _texture; } public PointCloud pointCloud { get => _pointCloud; } public int pointsNum { get => _pointsNum; } protected override void Init() { - base.Init(); + _camera = GetComponent(); + _camera.fieldOfView = _fov; + _camera.nearClipPlane = _minRange; + _camera.farClipPlane = _maxRange; + + _rt = new RenderTexture(_resolution.x, _resolution.y, 32, RenderTextureFormat.ARGBFloat); + _camera.targetTexture = _rt; + + _texture = new Texture2D(_resolution.x, _resolution.y, TextureFormat.RGBAFloat, false); _mat = new Material(Shader.Find("UnitySensors/Color2Depth")); float f = m_camera.farClipPlane; @@ -46,17 +69,17 @@ protected override void Init() private void SetupDirections() { - _pointsNum = resolution.x * resolution.y; + _pointsNum = _resolution.x * _resolution.y; _directions = new NativeArray(_pointsNum, Allocator.Persistent); - float z = resolution.y * 0.5f / Mathf.Tan(m_camera.fieldOfView * 0.5f * Mathf.Deg2Rad); - for (int y = 0; y < resolution.y; y++) + float z = _resolution.y * 0.5f / Mathf.Tan(m_camera.fieldOfView * 0.5f * Mathf.Deg2Rad); + for (int y = 0; y < _resolution.y; y++) { - for (int x = 0; x < resolution.x; x++) + for (int x = 0; x < _resolution.x; x++) { - Vector3 vec = new Vector3(-resolution.x / 2 + x, -resolution.y / 2 + y, z); - _directions[y * resolution.x + x] = vec.normalized; + Vector3 vec = new Vector3(-_resolution.x / 2 + x, -_resolution.y / 2 + y, z); + _directions[y * _resolution.x + x] = vec.normalized; } } } @@ -82,7 +105,7 @@ private void SetupJob() near= m_camera.nearClipPlane, far = m_camera.farClipPlane, directions = _directions, - pixels = texture.GetPixelData(0), + depthPixels = _texture.GetPixelData(0), noises = _noises, points = _pointCloud.points }; @@ -101,13 +124,32 @@ protected override void UpdateSensor() onSensorUpdated.Invoke(); } + private bool LoadTexture() + { + bool result = false; + AsyncGPUReadback.Request(_rt, 0, request => { + if (request.hasError) + { + } + else + { + var data = request.GetData(); + _texture.LoadRawTextureData(data); + _texture.Apply(); + result = true; + } + }); + AsyncGPUReadback.WaitAllRequests(); + return result; + } + protected override void OnSensorDestroy() { _jobHandle.Complete(); _pointCloud.Dispose(); _noises.Dispose(); _directions.Dispose(); - base.OnSensorDestroy(); + _rt.Release(); } private void OnRenderImage(RenderTexture source, RenderTexture dest) diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/ITextureToPointsJob.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/ITextureToPointsJob.cs index b07d92b4..31bdb2d0 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/ITextureToPointsJob.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/DepthCamera/ITextureToPointsJob.cs @@ -5,7 +5,7 @@ using Unity.Jobs; using Unity.Mathematics; -using UnitySensors.Data.PointCloud; +using UnitySensors.DataType.Sensor.PointCloud; namespace UnitySensors.Sensor.Camera { @@ -19,7 +19,7 @@ public struct ITextureToPointsJob : IJobParallelFor public NativeArray directions; [ReadOnly] - public NativeArray pixels; + public NativeArray depthPixels; [ReadOnly] public NativeArray noises; @@ -27,7 +27,7 @@ public struct ITextureToPointsJob : IJobParallelFor public void Execute(int index) { - float distance = (1.0f - Mathf.Clamp01(pixels.AsReadOnly()[index].r)) * far; + float distance = (1.0f - Mathf.Clamp01(depthPixels.AsReadOnly()[index].r)) * far; float distance_noised = distance + noises[index]; distance = (near < distance && distance < far && near < distance_noised && distance_noised < far) ? distance_noised : 0; diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBCamera/RGBCameraSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBCamera/RGBCameraSensor.cs index 7a08b1fe..0281f3e4 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBCamera/RGBCameraSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBCamera/RGBCameraSensor.cs @@ -1,6 +1,61 @@ +using UnityEngine; +using UnityEngine.Rendering; + +using UnitySensors.Interface.Sensor; + namespace UnitySensors.Sensor.Camera { - public class RGBCameraSensor : CameraSensor + public class RGBCameraSensor : CameraSensor, ITextureInterface { + private UnityEngine.Camera _camera; + private RenderTexture _rt = null; + private Texture2D _texture; + + public override UnityEngine.Camera m_camera { get => _camera; } + public Texture2D texture0 { get => _texture; } + public Texture2D texture1 { get => _texture; } + + protected override void Init() + { + _camera = GetComponent(); + _camera.fieldOfView = _fov; + + _rt = new RenderTexture(_resolution.x, _resolution.y, 32, RenderTextureFormat.ARGBFloat); + _camera.targetTexture = _rt; + + _texture = new Texture2D(_resolution.x, _resolution.y, TextureFormat.RGBAFloat, false); + } + + protected override void UpdateSensor() + { + if (!LoadTexture()) return; + + if (onSensorUpdated != null) + onSensorUpdated.Invoke(); + } + + protected bool LoadTexture() + { + bool result = false; + AsyncGPUReadback.Request(_rt, 0, request => { + if (request.hasError) + { + } + else + { + var data = request.GetData(); + _texture.LoadRawTextureData(data); + _texture.Apply(); + result = true; + } + }); + AsyncGPUReadback.WaitAllRequests(); + return result; + } + + protected override void OnSensorDestroy() + { + _rt.Release(); + } } } diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera.meta b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera.meta new file mode 100644 index 00000000..05d749ba --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aea80aebc947eda488b2d3cdc04374c6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs new file mode 100644 index 00000000..60d5c695 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; + +using UnitySensors.DataType.Sensor.PointCloud; + +namespace UnitySensors.Sensor.Camera +{ + [BurstCompile] + public struct ITextureToColorPointsJob : IJobParallelFor + { + public float near; + public float far; + + [ReadOnly] + public NativeArray directions; + + [ReadOnly] + public NativeArray depthPixels; + [ReadOnly] + public NativeArray colorPixels; + [ReadOnly] + public NativeArray noises; + + public NativeArray points; + + public void Execute(int index) + { + float distance = (1.0f - Mathf.Clamp01(depthPixels.AsReadOnly()[index].r)) * far; + float distance_noised = distance + noises[index]; + distance = (near < distance && distance < far && near < distance_noised && distance_noised < far) ? distance_noised : 0; + + PointXYZRGB point = new PointXYZRGB() + { + position = directions[index] * distance, + r = colorPixels[index].r, + g = colorPixels[index].g, + b = colorPixels[index].b, + a = (byte)(distance > 0 ? 255 : 0) + }; + points[index] = point; + } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs.meta new file mode 100644 index 00000000..4dfc6515 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/ITextureToColorPointsJob.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55e56ed540818e24ab716b8dc9897a1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs new file mode 100644 index 00000000..bcf026f2 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs @@ -0,0 +1,196 @@ +using System; +using UnityEngine; +using UnityEngine.Rendering; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; + +using UnitySensors.DataType.Sensor; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; +using UnitySensors.Utils.Noise; + +using Random = Unity.Mathematics.Random; + +namespace UnitySensors.Sensor.Camera +{ + [RequireComponent(typeof(UnityEngine.Camera))] + public class RGBDCameraSensor : CameraSensor, ITextureInterface, IPointCloudInterface + { + [SerializeField] + protected float _minRange = 0.05f; + [SerializeField] + protected float _maxRange = 100.0f; + [SerializeField] + private float _gaussianNoiseSigma = 0.0f; + + private UnityEngine.Camera _depthCamera; + private RenderTexture _depthRt = null; + private Texture2D _depthTexture; + + private UnityEngine.Camera _colorCamera; + private RenderTexture _colorRt = null; + private Texture2D _colorTexture; + + private Material _mat; + + private JobHandle _jobHandle; + + private IUpdateGaussianNoisesJob _updateGaussianNoisesJob; + private ITextureToColorPointsJob _textureToPointsJob; + + private NativeArray _noises; + private NativeArray _directions; + + private PointCloud _pointCloud; + private int _pointsNum; + + public override UnityEngine.Camera m_camera { get => _depthCamera; } + public Texture2D texture0 { get => _depthTexture; } + public Texture2D texture1 { get => _colorTexture; } + public PointCloud pointCloud { get => _pointCloud; } + public int pointsNum { get => _pointsNum; } + + protected override void Init() + { + _depthCamera = GetComponent(); + _depthRt = new RenderTexture(_resolution.x, _resolution.y, 32, RenderTextureFormat.ARGBFloat); + _depthCamera.targetTexture = _depthRt; + + GameObject colorCameraObject = new GameObject(); + Transform colorCameraTransform = colorCameraObject.transform; + colorCameraTransform.parent = this.transform; + colorCameraTransform.localPosition = Vector3.zero; + colorCameraTransform.localRotation = Quaternion.identity; + + _colorCamera = colorCameraObject.AddComponent(); + _colorRt = new RenderTexture(_resolution.x, _resolution.y, 32, RenderTextureFormat.BGRA32); + _colorCamera.targetTexture = _colorRt; + + _depthCamera.fieldOfView = _colorCamera.fieldOfView = _fov; + _depthCamera.nearClipPlane = _minRange; + _depthCamera.farClipPlane = _maxRange; + + _depthTexture = new Texture2D(_resolution.x, _resolution.y, TextureFormat.RGBAFloat, false); + _colorTexture = new Texture2D(_resolution.x, _resolution.y, TextureFormat.BGRA32, false); + + _mat = new Material(Shader.Find("UnitySensors/Color2Depth")); + float f = m_camera.farClipPlane; + _mat.SetFloat("_F", f); + + SetupDirections(); + SetupJob(); + } + + private void SetupDirections() + { + _pointsNum = _resolution.x * _resolution.y; + + _directions = new NativeArray(_pointsNum, Allocator.Persistent); + + float z = _resolution.y * 0.5f / Mathf.Tan(m_camera.fieldOfView * 0.5f * Mathf.Deg2Rad); + for (int y = 0; y < _resolution.y; y++) + { + for (int x = 0; x < _resolution.x; x++) + { + Vector3 vec = new Vector3(-_resolution.x / 2 + x, -_resolution.y / 2 + y, z); + _directions[y * _resolution.x + x] = vec.normalized; + } + } + } + + private void SetupJob() + { + _pointCloud = new PointCloud() + { + points = new NativeArray(_pointsNum, Allocator.Persistent) + }; + + _noises = new NativeArray(pointsNum, Allocator.Persistent); + + _updateGaussianNoisesJob = new IUpdateGaussianNoisesJob() + { + sigma = _gaussianNoiseSigma, + random = new Random((uint)Environment.TickCount), + noises = _noises + }; + + _textureToPointsJob = new ITextureToColorPointsJob() + { + near = m_camera.nearClipPlane, + far = m_camera.farClipPlane, + directions = _directions, + depthPixels = _depthTexture.GetPixelData(0), + colorPixels = _colorTexture.GetPixelData(0), + noises = _noises, + points = _pointCloud.points + }; + } + + protected override void UpdateSensor() + { + if (!LoadDepthTexture() || !LoadColorTexture()) return; + + JobHandle updateGaussianNoisesJobHandle = _updateGaussianNoisesJob.Schedule(_pointsNum, 1); + _jobHandle = _textureToPointsJob.Schedule(_pointsNum, 1, updateGaussianNoisesJobHandle); + JobHandle.ScheduleBatchedJobs(); + _jobHandle.Complete(); + + if (onSensorUpdated != null) + onSensorUpdated.Invoke(); + } + + private bool LoadDepthTexture() + { + bool result = false; + AsyncGPUReadback.Request(_depthRt, 0, request => { + if (request.hasError) + { + } + else + { + var data = request.GetData(); + _depthTexture.LoadRawTextureData(data); + _depthTexture.Apply(); + result = true; + } + }); + AsyncGPUReadback.WaitAllRequests(); + return result; + } + + private bool LoadColorTexture() + { + bool result = false; + AsyncGPUReadback.Request(_colorRt, 0, request => { + if (request.hasError) + { + } + else + { + var data = request.GetData(); + _colorTexture.LoadRawTextureData(data); + _colorTexture.Apply(); + result = true; + } + }); + AsyncGPUReadback.WaitAllRequests(); + return result; + } + + protected override void OnSensorDestroy() + { + _jobHandle.Complete(); + _pointCloud.Dispose(); + _noises.Dispose(); + _directions.Dispose(); + _depthRt.Release(); + _colorRt.Release(); + } + + private void OnRenderImage(RenderTexture source, RenderTexture dest) + { + Graphics.Blit(source, dest, _mat); + } + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs.meta new file mode 100644 index 00000000..2ae49337 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/Camera/RGBDCamera/RGBDCameraSensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58044c1bc2a88b943af133119c691560 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GNSSSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GNSSSensor.cs index b9f366b6..cb598af3 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GNSSSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GNSSSensor.cs @@ -1,19 +1,16 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; -using UnitySensors.Attribute; -using UnitySensors.Utils.GeoCoordinate; +using UnitySensors.DataType.Geometry; +using UnitySensors.Interface.Geometry; namespace UnitySensors.Sensor.GNSS { - public class GNSSSensor : UnitySensor + public class GNSSSensor : UnitySensor, IGeoCoordinateInterface { [SerializeField] private GeoCoordinateSystem _coordinateSystem; private Transform _transform; - private GeoCoordinateConverter _gcc; [SerializeField] private GeoCoordinate _coordinate; diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GeoCoordinateSystem.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GeoCoordinateSystem.cs index 8484b257..2ba2df31 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GeoCoordinateSystem.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/GNSS/GeoCoordinateSystem.cs @@ -1,8 +1,7 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; -using UnitySensors.Utils.GeoCoordinate; +using UnitySensors.DataType.Geometry; +using UnitySensors.Utils.Geometry; namespace UnitySensors.Sensor.GNSS { @@ -17,15 +16,13 @@ public class GeoCoordinateSystem : MonoBehaviour private void Awake() { _transform = this.transform; - _converter = new GeoCoordinateConverter(_coordinate.latitude, _coordinate.longitude); + _converter = new GeoCoordinateConverter(_coordinate); } public GeoCoordinate GetCoordinate(Vector3 worldPosition) { Vector3 localPosition = _transform.InverseTransformPoint(worldPosition); - double latitude, longitude; - (latitude, longitude) = _converter.XZ2LatLon(localPosition.x, localPosition.z); - return new GeoCoordinate(latitude, longitude, localPosition.y + _coordinate.altitude); + return _converter.Convert(new Vector3D(localPosition)); } } } \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/GroundTruth/GroundTruth.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/GroundTruth/GroundTruth.cs index d217a534..41df3e41 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/GroundTruth/GroundTruth.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/GroundTruth/GroundTruth.cs @@ -1,5 +1,5 @@ using UnityEngine; -using UnitySensors.Data.Pose; +using UnitySensors.Interface.Geometry; namespace UnitySensors.Sensor.GroundTruth { diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs index 553532f5..23ebd351 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs @@ -1,9 +1,10 @@ using UnityEngine; using UnitySensors.Attribute; +using UnitySensors.Interface.Sensor; namespace UnitySensors.Sensor.IMU { - public class IMUSensor : UnitySensor + public class IMUSensor : UnitySensor, IImuDataInterface { private Transform _transform; diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/DepthBufferLiDARSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/DepthBufferLiDARSensor.cs index 78f529cf..85e6cc77 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/DepthBufferLiDARSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/DepthBufferLiDARSensor.cs @@ -5,8 +5,6 @@ using Unity.Jobs; using Unity.Mathematics; -using UnitySensors.Attribute; -using UnitySensors.Data.PointCloud; using UnitySensors.Utils.Noise; using UnitySensors.Utils.Camera; @@ -14,7 +12,7 @@ namespace UnitySensors.Sensor.LiDAR { - public class DepthBufferLiDARSensor : LiDARSensor + public class DepthBufferLiDARSensor : LiDARSensor { [SerializeField, Min(1)] private int _texturePixelsNum = 1; @@ -131,7 +129,9 @@ private void SetupJobs() _textureToPointsJob = new ITextureToPointsJob() { near = minRange, + sqrNear = minRange * minRange, far = maxRange, + maxIntensity = maxIntensity, indexOffset = 0, directions = _directions, pixelIndices = _pixelIndices, diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/ITextureToPointsJob.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/ITextureToPointsJob.cs index 4990a5eb..b495455f 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/ITextureToPointsJob.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/DepthBufferLiDAR/ITextureToPointsJob.cs @@ -5,7 +5,7 @@ using Unity.Jobs; using Unity.Mathematics; -using UnitySensors.Data.PointCloud; +using UnitySensors.DataType.Sensor.PointCloud; namespace UnitySensors.Sensor.LiDAR { @@ -13,7 +13,9 @@ namespace UnitySensors.Sensor.LiDAR public struct ITextureToPointsJob : IJobParallelFor { public float near; + public float sqrNear; public float far; + public float maxIntensity; public int indexOffset; [ReadOnly] @@ -37,7 +39,8 @@ public void Execute(int index) distance = (near < distance && distance < far && near < distance_noised && distance_noised < far) ? distance_noised : 0; PointXYZI point = new PointXYZI() { - position = directions[index + indexOffset] * distance + position = directions[index + indexOffset] * distance, + intensity = (distance != 0) ? maxIntensity * sqrNear / (distance * distance) : 0 }; points[index] = point; diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/LiDARSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/LiDARSensor.cs index bc47c7a2..febec48a 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/LiDARSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/LiDARSensor.cs @@ -1,16 +1,14 @@ -using System; - using UnityEngine; - -using Unity.Mathematics; using Unity.Collections; -using UnitySensors.Data.PointCloud; +using UnitySensors.DataType.LiDAR; +using UnitySensors.DataType.Sensor; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; namespace UnitySensors.Sensor.LiDAR { - public abstract class LiDARSensor : UnitySensor, IPointCloudInterface - where T : struct, IPointXYZInterface + public abstract class LiDARSensor : UnitySensor, IPointCloudInterface { [SerializeField] private ScanPattern _scanPattern; @@ -25,22 +23,22 @@ public abstract class LiDARSensor : UnitySensor, IPointCloudInterface [SerializeField] private float _maxIntensity = 255.0f; - private PointCloud _pointCloud; + private PointCloud _pointCloud; protected ScanPattern scanPattern { get => _scanPattern; } protected float minRange { get => _minRange; } protected float maxRange { get => _maxRange; } protected float gaussianNoiseSigma { get => _gaussianNoiseSigma; } protected float maxIntensity { get => _maxIntensity; } - public PointCloud pointCloud { get => _pointCloud; } + public PointCloud pointCloud { get => _pointCloud; } public int pointsNum { get => _pointsNumPerScan; } protected override void Init() { _pointsNumPerScan = Mathf.Clamp(_pointsNumPerScan, 1, scanPattern.size); - _pointCloud = new PointCloud() + _pointCloud = new PointCloud() { - points = new NativeArray(_pointsNumPerScan, Allocator.Persistent) + points = new NativeArray(_pointsNumPerScan, Allocator.Persistent) }; } diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox.meta b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox.meta deleted file mode 100644 index 466d765c..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 27afd4a13f83aea4dbb031f48b2b5948 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs deleted file mode 100644 index 17d251c5..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/Livox/LivoxSensor.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Rendering; - -using Unity.Burst; -using Unity.Collections; -using UnityEngine.Jobs; -using Unity.Jobs; - -using Random = Unity.Mathematics.Random; - -namespace UnitySensors -{ - /* - public class LivoxSensor : Sensor - { - [SerializeField] - private CSVLiDARScanPattern _scanPattern; - - [SerializeField] - private int _scanSeparation = 40; - - [SerializeField] - private float _minDistance = 0.1f; - [SerializeField] - private float _maxDistance = 100.0f; - [SerializeField] - private float _maxIntensity = 255.0f; - [SerializeField] - private float _gaussianNoiseSigma = 0.0f; - - [SerializeField] - private int _resolution = 100; - - private Transform _transform; - - private Camera _cam; - - private Vector2Int _textureSize; - - private RenderTexture _rt = null; - private Texture2D _texture; - - private JobHandle _handle; - private TextureToPointsJob _textureToPointsJob; - private UpdateGaussianNoisesJob _updateGaussianNoisesJob; - private Random _random; - public NativeArray points; - public NativeArray intensities; - private NativeArray _directions; - private NativeArray _pixelIndices; - private NativeArray _noises; - - private uint _randomSeed; - private int _pointsNum; - public uint pointsNum { get=>(uint)(_pointsNum);} - public float minDistance { get => _minDistance; } - public float maxDistance { get => _maxDistance; } - public float maxIntensity { get => _maxIntensity; } - - protected override void Init() - { - _pointsNum = _scanPattern.size / _scanSeparation; - CreateSensor(); - SetupCamera(); - SetupIndicesAndDirections(); - SetupJob(); - base.Init(); - } - - private void CreateSensor() - { - _transform = this.transform; - - GameObject cam_obj = new GameObject(); - Transform cam_transform = cam_obj.transform; - _cam = cam_obj.AddComponent(); - cam_transform.parent = _transform; - cam_transform.name = "Camera"; - cam_transform.localPosition = Vector3.zero; - cam_transform.localRotation = Quaternion.identity; - } - - private void SetupCamera() - { - float fov = Mathf.Max(_scanPattern.maxAzimuth, _scanPattern.maxZenith * 2 / Mathf.Cos(_scanPattern.maxAzimuth * Mathf.Deg2Rad)); - - float resolution_y = _resolution / (_scanPattern.maxZenith * 2) * fov; - float resolution_x = Mathf.CeilToInt(resolution_y / Mathf.Tan(fov * 0.5f * Mathf.Deg2Rad) * Mathf.Tan(60.0f * Mathf.Deg2Rad)); - _textureSize.x = Mathf.CeilToInt(resolution_x); - _textureSize.y = Mathf.CeilToInt(resolution_y); - - _rt = new RenderTexture(_textureSize.x, _textureSize.y, 32, RenderTextureFormat.ARGBFloat); - - _cam.targetTexture = _rt; - _cam.fieldOfView = fov; - _cam.nearClipPlane = _minDistance; - _cam.farClipPlane = _maxDistance; - _cam.gameObject.AddComponent(); - _cam.clearFlags = CameraClearFlags.SolidColor; - - _texture = new Texture2D(_textureSize.x, _textureSize.y, TextureFormat.RGBAFloat, false); - } - private void SetupIndicesAndDirections() - { - int scanPattern_size = _scanPattern.size; - _directions = new NativeArray(scanPattern_size, Allocator.Persistent); - _pixelIndices = new NativeArray(scanPattern_size, Allocator.Persistent); - - float radius = _textureSize.y * 0.5f / Mathf.Tan(_cam.fieldOfView * 0.5f * Mathf.Deg2Rad); - for (int i = 0; i < scanPattern_size; i++) - { - _directions[i] = _scanPattern.scans[i]; - - Vector3 dir = _directions[i]; - dir *= (radius / dir.z); - int index_x = (int)Mathf.Clamp(_textureSize.x * 0.5f + dir.x, 0, _textureSize.x - 1); - int index_y = (int)Mathf.Clamp(_textureSize.y * 0.5f + dir.y, 0, _textureSize.y - 1); - _pixelIndices[i] = index_y * _textureSize.x + index_x; - } - } - - private void SetupJob() - { - points = new NativeArray(_pointsNum, Allocator.Persistent); - intensities = new NativeArray(_pointsNum, Allocator.Persistent); - _randomSeed = (uint)Environment.TickCount; - _random = new Random(_randomSeed); - - _noises = new NativeArray(_pointsNum, Allocator.Persistent); - - _updateGaussianNoisesJob = new UpdateGaussianNoisesJob() - { - sigma = _gaussianNoiseSigma, - random = _random, - noises = _noises - }; - - _textureToPointsJob = new TextureToPointsJob() - { - scanSeparation = _scanSeparation, - separationCounter = 0, - minDistance = _minDistance, - minDistance_sqr = _minDistance * _minDistance, - maxDistance = _maxDistance, - maxIntensity = _maxIntensity, - pixelIndices = _pixelIndices, - directions = _directions, - pixels = _texture.GetPixelData(0), - noises = _noises, - points = points, - intensities = intensities - }; - } - - protected override void UpdateSensor() - { - _handle.Complete(); - if (_randomSeed++ == 0) _randomSeed = 1; - _updateGaussianNoisesJob.random.InitState(_randomSeed); - - _textureToPointsJob.separationCounter++; - if (_textureToPointsJob.separationCounter >= _scanSeparation) _textureToPointsJob.separationCounter = 0; - - AsyncGPUReadback.Request(_rt, 0, request => { - if (request.hasError) - { - } - else - { - if (!Application.isPlaying) return; - var data = request.GetData(); - _texture.LoadRawTextureData(data); - _texture.Apply(); - } - }); - - JobHandle updateGaussianNoisesJobHandle = _updateGaussianNoisesJob.Schedule(_pointsNum, 1); - _handle = _textureToPointsJob.Schedule(_pointsNum, 1, updateGaussianNoisesJobHandle); - - JobHandle.ScheduleBatchedJobs(); - } - - public void CompleteJob() - { - _handle.Complete(); - } - - private void OnDestroy() - { - _handle.Complete(); - _noises.Dispose(); - _pixelIndices.Dispose(); - _directions.Dispose(); - points.Dispose(); - intensities.Dispose(); - - _rt.Release(); - } - - [BurstCompile] - private struct UpdateGaussianNoisesJob : IJobParallelFor - { - public float sigma; - public Random random; - public NativeArray noises; - - public void Execute(int index) - { - var rand2 = random.NextFloat(); - var rand3 = random.NextFloat(); - float normrand = - (float)Math.Sqrt(-2.0f * Math.Log(rand2)) * - (float)Math.Cos(2.0f * Math.PI * rand3); - noises[index] = sigma * normrand; - } - } - - [BurstCompile] - private struct TextureToPointsJob : IJobParallelFor - { - public int scanSeparation; - public int separationCounter; - - [ReadOnly] - public float minDistance; - [ReadOnly] - public float minDistance_sqr; - [ReadOnly] - public float maxDistance; - [ReadOnly] - public float maxIntensity; - - [ReadOnly] - public NativeArray pixelIndices; - [ReadOnly] - public NativeArray directions; - - [ReadOnly] - public NativeArray pixels; - [ReadOnly] - public NativeArray noises; - - public NativeArray points; - public NativeArray intensities; - - public void Execute(int index) - { - int offset = points.Length * separationCounter / scanSeparation; - int pixelIndex = pixelIndices.AsReadOnly()[index + offset]; - float distance = maxDistance * Mathf.Clamp01(1.0f - pixels.AsReadOnly()[pixelIndex].r) + noises[index]; - bool isValid = (minDistance <= distance && distance <= maxDistance); - if (!isValid) distance = 0; - points[index] = directions.AsReadOnly()[index + offset] * distance; - float distance_sqr = distance * distance; - intensities[index] = isValid ? maxIntensity * minDistance_sqr / distance_sqr : 0; - } - } - } - */ -} diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/IRaycastHitsToPointsJob.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/IRaycastHitsToPointsJob.cs index e24eed86..9018c32c 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/IRaycastHitsToPointsJob.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/IRaycastHitsToPointsJob.cs @@ -5,7 +5,7 @@ using Unity.Jobs; using Unity.Mathematics; -using UnitySensors.Data.PointCloud; +using UnitySensors.DataType.Sensor.PointCloud; namespace UnitySensors.Sensor.LiDAR { @@ -15,7 +15,7 @@ public struct IRaycastHitsToPointsJob : IJobParallelFor [ReadOnly] public float minRange; [ReadOnly] - public float minRange_sqr; + public float sqrMinRange; [ReadOnly] public float maxRange; [ReadOnly] @@ -39,7 +39,7 @@ public void Execute(int index) PointXYZI point = new PointXYZI() { position = directions[index + indexOffset] * distance, - intensity = (distance != 0) ? maxIntensity * minRange_sqr / (distance * distance) : 0 + intensity = (distance != 0) ? maxIntensity * sqrMinRange / (distance * distance) : 0 }; points[index] = point; } diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/RaycastLiDARSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/RaycastLiDARSensor.cs index 2cfa5764..18c53cae 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/RaycastLiDARSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/RaycastLiDAR/RaycastLiDARSensor.cs @@ -6,13 +6,12 @@ using Unity.Mathematics; using UnitySensors.Utils.Noise; -using UnitySensors.Data.PointCloud; using Random = Unity.Mathematics.Random; namespace UnitySensors.Sensor.LiDAR { - public class RaycastLiDARSensor : LiDARSensor + public class RaycastLiDARSensor : LiDARSensor { private Transform _transform; @@ -73,7 +72,7 @@ private void SetupJobs() _raycastHitsToPointsJob = new IRaycastHitsToPointsJob() { minRange = minRange, - minRange_sqr = minRange * minRange, + sqrMinRange = minRange * minRange, maxRange = maxRange, maxIntensity = maxIntensity, directions = _directions, diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern.meta b/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern.meta deleted file mode 100644 index 16b246d0..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/LiDAR/ScanPattern.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 38891272c2e8e4244abdfa3808f48136 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/UnitySensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/UnitySensor.cs index cb5660b6..f7c3dd0d 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/UnitySensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/UnitySensor.cs @@ -1,8 +1,9 @@ using UnityEngine; +using UnitySensors.Interface.Std; namespace UnitySensors.Sensor { - public abstract class UnitySensor : MonoBehaviour + public abstract class UnitySensor : MonoBehaviour, ITimeInterface { [SerializeField] private float _frequency = 10.0f; diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates.meta b/Assets/UnitySensors/Runtime/Scripts/Utils/Geometry.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates.meta rename to Assets/UnitySensors/Runtime/Scripts/Utils/Geometry.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinateConverter.cs b/Assets/UnitySensors/Runtime/Scripts/Utils/Geometry/GeoCoordinateConverter.cs similarity index 79% rename from Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinateConverter.cs rename to Assets/UnitySensors/Runtime/Scripts/Utils/Geometry/GeoCoordinateConverter.cs index 96d8cc35..d3a20861 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinateConverter.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Utils/Geometry/GeoCoordinateConverter.cs @@ -1,9 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using UnityEngine; +using UnitySensors.DataType.Geometry; -namespace UnitySensors.Utils.GeoCoordinate +namespace UnitySensors.Utils.Geometry { /// /// •½–Ê’¼ŠpÀ•WŒn‚ƈܓxŒo“x‚Ì‘ŠŒÝ•ÏŠ· @@ -16,35 +15,22 @@ public class GeoCoordinateConverter const double dF = 298.257222101d; //‹tG•½—¦ const double dM0 = 0.9999; //•½–Ê’¼ŠpÀ•WŒn‚ÌYŽ²ã‚É‚¨‚¯‚ékŽÚŒW”(UTMÀ•WŒn‚Ìꇨ0.9996) - private double _lon0; - private double _lat0; + private GeoCoordinate _origin; - /// - /// ƒRƒ“ƒXƒgƒ‰ƒNƒ^ - /// - /// Œ´“_:ˆÜ“x[“x] - /// Œ´“_:Œo“x[“x] - public GeoCoordinateConverter(double lat0, double lon0) + public GeoCoordinateConverter(GeoCoordinate origin) { - this._lat0 = lat0; - this._lon0 = lon0; + _origin = origin; } - /// - /// ’n—À•WŒniˆÜ“xEŒo“xj -> •½–Ê’¼ŠpÀ•W - /// - /// ˆÜ“x[“x] - /// Œo“x[“x] - /// XAY - public (double X, double Z) LatLon2XZ(double Lat, double Lon) + public Vector3D Convert(GeoCoordinate coordinate) { double dn = 1d / (2 * dF - 1); //ƒ‰ƒWƒAƒ“’PˆÊ‚É - Lat = Deg2Rad(Lat); - Lon = Deg2Rad(Lon); - double Lat0 = Deg2Rad(this._lat0); - double Lon0 = Deg2Rad(this._lon0); + double Lat = Deg2Rad(coordinate.latitude); + double Lon = Deg2Rad(coordinate.longitude); + double Lat0 = Deg2Rad(_origin.latitude); + double Lon0 = Deg2Rad(_origin.longitude); double dt = Math.Sinh(Atanh(Math.Sin(Lat)) - (2 * Math.Sqrt(dn)) / (1 + dn) * Atanh(2 * Math.Sqrt(dn) / (1 + dn) * Math.Sin(Lat))); double dtb = Math.Sqrt(1 + Math.Pow(dt, 2)); @@ -92,25 +78,16 @@ public GeoCoordinateConverter(double lat0, double lon0) X += dal[j] * Math.Cos(2 * j * dXi) * Math.Sinh(2 * j * dEt); } - return ( - dAb * (dEt + X), - dAb * (dXi + Z) - dSb - ); + return new Vector3D(dAb * (dEt + X), coordinate.altitude - _origin.altitude, dAb * (dXi + Z) - dSb); } - /// - /// •½–Ê’¼ŠpÀ•WŒn -> ’n—À•WŒniˆÜ“xEŒo“xj - /// - /// XÀ•W(“Œ¼•ûŒüAm) - /// YÀ•W(“ì–k•ûŒüAm) - /// LonFˆÜ“x[“x], LatFŒo“x[“x] - public (double Lat, double Lon) XZ2LatLon(double X, double Z) + public GeoCoordinate Convert(Vector3D coordinate) { double dn = 1d / (2 * dF - 1); //ƒ‰ƒWƒAƒ“’PˆÊ‚É - double Lon0 = Deg2Rad(this._lon0); - double Lat0 = Deg2Rad(this._lat0); + double Lat0 = Deg2Rad(_origin.latitude); + double Lon0 = Deg2Rad(_origin.longitude); //SƒÓ0AA double[] dA = new double[6]; @@ -129,8 +106,8 @@ public GeoCoordinateConverter(double lat0, double lon0) dSb = dM0 * daa / (1 + dn) * (dA[0] * Lat0 + dSb); //ƒÌEƒÅ - double dXi = (Z + dSb) / dAb; - double dEt = X / dAb; + double dXi = (coordinate.z + dSb) / dAb; + double dEt = coordinate.x / dAb; //ƒÀ double[] dBt = new double[6]; @@ -174,13 +151,8 @@ public GeoCoordinateConverter(double lat0, double lon0) Lat += dDt[j] * Math.Sin(2 * j * dCi); } - //“x’PˆÊ‚É - return ( - Rad2Deg(Lat), - Rad2Deg(Lon) - ); + return new GeoCoordinate(Rad2Deg(Lat), Rad2Deg(Lon), coordinate.y + _origin.altitude); } - //‘o‹Èü³ÚŠÖ”‚Ì‹tŠÖ” private static double Atanh(double x) => (1d / 2d * Math.Log((1 + x) / (1 - x), Math.E)); private static double Deg2Rad(double Deg) => (Math.PI * Deg / 180d); diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinateConverter.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Utils/Geometry/GeoCoordinateConverter.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Utils/GeoCoordinates/GeoCoordinateConverter.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Utils/Geometry/GeoCoordinateConverter.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud.meta b/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud.meta similarity index 77% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud.meta rename to Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud.meta index 2a0c10f6..aee067ce 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ed497a4be13d33246a6b5b500dadf7f2 +guid: a68cd6c835888e14e95d7ec0f620bb0d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs b/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs new file mode 100644 index 00000000..d2dee496 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using UnitySensors.DataType.Sensor.PointCloud; + +namespace UnitySensors.Utils.PointCloud +{ + public static class PointUtilities + { + public readonly static ReadOnlyDictionary pointDataSizes = new ReadOnlyDictionary(new Dictionary + { + { typeof(PointXYZ), 12 }, + { typeof(PointXYZI), 16 }, + { typeof(PointXYZRGB), 16 } + }); + + public readonly static ReadOnlyDictionary shaderNames = new ReadOnlyDictionary(new Dictionary + { + { typeof(PointXYZ), "UnitySensors/PointCloudXYZ" }, + { typeof(PointXYZI), "UnitySensors/PointCloudXYZI" }, + { typeof(PointXYZRGB), "UnitySensors/PointCloudXYZRGB" } + }); + } +} diff --git a/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs.meta new file mode 100644 index 00000000..e59c4b4a --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Utils/PointCloud/PointUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a30cb1240907864cb62e781c6cdcf3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera.meta deleted file mode 100644 index 84379811..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fcb85d635fd598f44bcda9bfea0323bc -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs deleted file mode 100644 index 35530dcd..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/CameraTextureVisualizer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; -using UnitySensors.Sensor.Camera; -using UnitySensors.Visualization.Texture; - -namespace UnitySensors.Visualization.Camera -{ - [RequireComponent(typeof(CameraSensor))] - public class CameraTextureVisualizer : TextureVisualizer - { - } -} diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera.meta deleted file mode 100644 index 2e4ba249..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 56e4f8ed974fc984bb1cfb834d9f51b2 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs deleted file mode 100644 index dd1ff41f..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using UnityEngine; - -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor.Camera; -using UnitySensors.Visualization.PointCloud; - -namespace UnitySensors.Visualization.Camera -{ - [RequireComponent(typeof(DepthCameraSensor))] - public class DepthCameraPointCloudVisualizer : PointCloudVisualizer - { - } -} diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs deleted file mode 100644 index 67438207..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/LiDAR/LiDARVisualizer.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; -using Unity.Mathematics; - -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor.LiDAR; -using UnitySensors.Visualization.PointCloud; - -namespace UnitySensors.Visualization.LiDAR -{ - public class LiDARVisualizer : PointCloudVisualizer, PointXYZI> - { - - } -} diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor.meta new file mode 100644 index 00000000..2060c952 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad1561e744c942440a6f9eab8c972d3e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud.meta similarity index 77% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud.meta rename to Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud.meta index b86bc343..b5ae78ca 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ff8a1ea0bbea78749a421c4e5ab09076 +guid: 928fbd8c68ee62942bb9a014c4656274 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs new file mode 100644 index 00000000..c64dc242 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs @@ -0,0 +1,24 @@ +using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; +using UnitySensors.Sensor; + +namespace UnitySensors.Visualization.Sensor +{ + public class DepthCameraPointCloudVisualizer : PointCloudVisualizer + { + [SerializeField, Interface(typeof(IPointCloudInterface))] + private Object _source; + + protected override void Start() + { + if (_source is UnitySensor) + { + (_source as UnitySensor).onSensorUpdated += Visualize; + } + base.SetSource(_source as IPointCloudInterface); + base.Start(); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs.meta similarity index 83% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs.meta index 65c71496..d87a7000 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Camera/DepthCamera/DepthCameraPointCloudVisualizer.cs.meta +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/DepthCameraPointCloudVisualizer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f34cfe1c27eb79849a7bd77d281a5253 +guid: f2f05a788e73116488577387bd40affc MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs new file mode 100644 index 00000000..80f89189 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs @@ -0,0 +1,24 @@ +using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; +using UnitySensors.Sensor; + +namespace UnitySensors.Visualization.Sensor +{ + public class LiDARPointCloudVisualizer : PointCloudVisualizer + { + [SerializeField, Interface(typeof(IPointCloudInterface))] + private Object _source; + + protected override void Start() + { + if (_source is UnitySensor) + { + (_source as UnitySensor).onSensorUpdated += Visualize; + } + base.SetSource(_source as IPointCloudInterface); + base.Start(); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs.meta new file mode 100644 index 00000000..b46d38ba --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/LiDARPointCloudVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2ac6256eabda88478ca2a2fc51a2c64 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs new file mode 100644 index 00000000..625e19f7 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs @@ -0,0 +1,24 @@ +using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; +using UnitySensors.Sensor; + +namespace UnitySensors.Visualization.Sensor +{ + public class RGBDCameraPointCloudVisualizer : PointCloudVisualizer + { + [SerializeField, Interface(typeof(IPointCloudInterface))] + private Object _source; + + protected override void Start() + { + if (_source is UnitySensor) + { + (_source as UnitySensor).onSensorUpdated += Visualize; + } + base.SetSource(_source as IPointCloudInterface); + base.Start(); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs.meta new file mode 100644 index 00000000..a67bd5ed --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloud/RGBDCameraPointCloudVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a3dffef534585740aa9f93736bdd5ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud/PointCloudVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloudVisualizer.cs similarity index 52% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud/PointCloudVisualizer.cs rename to Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloudVisualizer.cs index 986320b5..9f25a97f 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud/PointCloudVisualizer.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloudVisualizer.cs @@ -1,43 +1,36 @@ -using System; -using System.Collections.Generic; using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.Interface.Sensor; +using UnitySensors.Interface.Sensor.PointCloud; using UnitySensors.Sensor; -using UnitySensors.Data.PointCloud; +using UnitySensors.Utils.PointCloud; -namespace UnitySensors.Visualization.PointCloud +namespace UnitySensors.Visualization.Sensor { - public class PointCloudVisualizer : Visualizer - where T : UnitySensor, IPointCloudInterface - where TT : struct, IPointInterface + public class PointCloudVisualizer : Visualizer where T : struct, IPointInterface { + private IPointCloudInterface _sourceInterface; + private Transform _transform; + private Material _mat; private Mesh _mesh; - private ComputeBuffer _pointsBuffer; private ComputeBuffer _argsBuffer; private uint[] _args = new uint[5] { 0, 0, 0, 0, 0 }; - private int _cachedPointsCount = -1; - private int _bufferSize; - private static readonly Dictionary BUFFER_SIZE_DICTIONARY = new Dictionary() + public void SetSource(IPointCloudInterface sourceInterface) { - { typeof(PointXYZ), 12 }, - { typeof(PointXYZI), 16 } - }; - - private static readonly Dictionary SHADER_NAME_DICTIONARY = new Dictionary() - { - { typeof(PointXYZ), "UnitySensors/PointCloudXYZ" }, - { typeof(PointXYZI), "UnitySensors/PointCloudXYZI" } - }; + _sourceInterface = sourceInterface; + } - protected override void Init() + protected virtual void Start() { - _bufferSize = BUFFER_SIZE_DICTIONARY[typeof(TT)]; - _mat = new Material(Shader.Find(SHADER_NAME_DICTIONARY[typeof(TT)])); + _transform = this.transform; + _bufferSize = PointUtilities.pointDataSizes[typeof(T)]; + _mat = new Material(Shader.Find(PointUtilities.shaderNames[typeof(T)])); _mat.renderQueue = 3000; _mesh = new Mesh(); _mesh.vertices = new Vector3[1] { Vector3.zero }; @@ -48,9 +41,9 @@ protected override void Init() protected override void Visualize() { - if (sensor.pointsNum != _cachedPointsCount) UpdateBuffers(); - _mat.SetMatrix("LocalToWorldMatrix", sensor.transform.localToWorldMatrix); - _pointsBuffer.SetData(sensor.pointCloud.points); + if (_sourceInterface.pointsNum != _cachedPointsCount) UpdateBuffers(); + _mat.SetMatrix("LocalToWorldMatrix", _transform.localToWorldMatrix); + _pointsBuffer.SetData(_sourceInterface.pointCloud.points); } private void Update() @@ -61,16 +54,16 @@ private void Update() private void UpdateBuffers() { if (_pointsBuffer != null) _pointsBuffer.Release(); - _pointsBuffer = new ComputeBuffer(sensor.pointsNum, _bufferSize); - _pointsBuffer.SetData(sensor.pointCloud.points); + _pointsBuffer = new ComputeBuffer(_sourceInterface.pointsNum, _bufferSize); + _pointsBuffer.SetData(_sourceInterface.pointCloud.points); _mat.SetBuffer("PointsBuffer", _pointsBuffer); uint numIndices = (_mesh != null) ? (uint)_mesh.GetIndexCount(0) : 0; _args[0] = numIndices; - _args[1] = (uint)sensor.pointsNum; + _args[1] = (uint)_sourceInterface.pointsNum; _argsBuffer.SetData(_args); - _cachedPointsCount = sensor.pointsNum; + _cachedPointsCount = _sourceInterface.pointsNum; } private void OnDisable() diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud/PointCloudVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloudVisualizer.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/PointCloud/PointCloudVisualizer.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/PointCloudVisualizer.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/TextureVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/TextureVisualizer.cs new file mode 100644 index 00000000..4e9cca94 --- /dev/null +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/TextureVisualizer.cs @@ -0,0 +1,41 @@ +using UnityEngine; +using UnityEngine.UI; +using UnitySensors.Attribute; +using UnitySensors.Sensor; +using UnitySensors.Interface.Sensor; + +namespace UnitySensors.Visualization.Sensor +{ + public class TextureVisualizer : Visualizer + { + private enum SourceTexture + { + Texture0, + Texture1 + } + + [SerializeField, Interface(typeof(ITextureInterface))] + private Object _source; + [SerializeField] + private SourceTexture _sourceTexture; + [SerializeField] + private RawImage _image; + + private ITextureInterface _sourceInterface; + + private void Start() + { + _sourceInterface = _source as ITextureInterface; + if(_source is UnitySensor) + { + (_source as UnitySensor).onSensorUpdated += Visualize; + } + } + + protected override void Visualize() + { + if (!_image) return; + _image.texture = _sourceTexture == SourceTexture.Texture0 ? _sourceInterface.texture0 : _sourceInterface.texture1; + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture/TextureVisualizer.cs.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/TextureVisualizer.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture/TextureVisualizer.cs.meta rename to Assets/UnitySensors/Runtime/Scripts/Visualizers/Sensor/TextureVisualizer.cs.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture.meta b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture.meta deleted file mode 100644 index e6fc468e..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7222d66ce8e9d79429428ad19561b097 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture/TextureVisualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture/TextureVisualizer.cs deleted file mode 100644 index e9696268..00000000 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Texture/TextureVisualizer.cs +++ /dev/null @@ -1,23 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; -using UnitySensors.Sensor; -using UnitySensors.Data.Texture; - -namespace UnitySensors.Visualization.Texture -{ - public class TextureVisualizer : Visualizer where T : UnitySensor, ITextureInterface - { - [SerializeField] - private RawImage _image; - - protected override void Init() - { - } - - protected override void Visualize() - { - if (!_image) return; - _image.texture = sensor.texture; - } - } -} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Visualizer.cs b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Visualizer.cs index b7bbd232..bab5d64f 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Visualizers/Visualizer.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Visualizers/Visualizer.cs @@ -1,22 +1,11 @@ using UnityEngine; +using UnitySensors.Attribute; using UnitySensors.Sensor; namespace UnitySensors.Visualization { - public abstract class Visualizer : MonoBehaviour where T : UnitySensor + public abstract class Visualizer : MonoBehaviour { - private T _sensor; - public T sensor { get => _sensor; } - - private void Start() - { - _sensor = GetComponent(); - _sensor.onSensorUpdated += Visualize; - - Init(); - } - - protected abstract void Init(); protected abstract void Visualize(); } } diff --git a/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZI.shader.meta b/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZI.shader.meta index 658d988b..6a6e5e24 100644 --- a/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZI.shader.meta +++ b/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZI.shader.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 417e6f59011b2b743a51b9344a78b15d +guid: f9fa29512657a5b408ef0c50698b141b ShaderImporter: externalObjects: {} defaultTextures: [] diff --git a/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader b/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader new file mode 100644 index 00000000..6545026a --- /dev/null +++ b/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader @@ -0,0 +1,78 @@ +Shader "UnitySensors/PointCloudXYZRGB" +{ + Properties{ + _MainTex("Albedo (RGB)", 2D) = "white" {} + _Glossiness("Smoothness", Range(0,1)) = 0.5 + _Metallic("Metallic", Range(0,1)) = 0.0 + } + SubShader{ + Tags{ "RenderType" = "Opaque" } + LOD 100 + + CGPROGRAM + // Physically based Standard lighting model +#pragma surface surf Standard addshadow +#pragma multi_compile_instancing +#pragma instancing_options procedural:setup + + sampler2D _MainTex; + + struct Input + { +float2 uv_MainTex; +}; + +#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED + struct Point + { + float3 position; + uint bgra; + }; + StructuredBuffer PointsBuffer; + float4x4 LocalToWorldMatrix; +#endif + + void setup() + { +#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED + float3 data = mul(LocalToWorldMatrix, float4(PointsBuffer[unity_InstanceID].position, 1)); + unity_ObjectToWorld._11_21_31_41 = float4(1, 0, 0, 0); + unity_ObjectToWorld._12_22_32_42 = float4(0, 1, 0, 0); + unity_ObjectToWorld._13_23_33_43 = float4(0, 0, 1, 0); + unity_ObjectToWorld._14_24_34_44 = float4(data, 1); + unity_WorldToObject = unity_ObjectToWorld; + unity_WorldToObject._14_24_34 *= -1; + unity_WorldToObject._11_22_33 = 1.0f / unity_WorldToObject._11_22_33; +#endif + } + + inline float4 uint2Color(uint u) + { + const uint b = 255; + return float4(u & b, u >> 8 & b, u >> 16 & b, u >> 24) / 255; + } + + half _Glossiness; + half _Metallic; + + void surf(Input IN, inout SurfaceOutputStandard o) + { + float4 col = 1; +#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED + const uint b = 255; + float4 bgra = uint2Color(PointsBuffer[unity_InstanceID].bgra); + col = float4(bgra.b, bgra.g, bgra.r, bgra.a); +#else + col = float4(1, 1, 1, 1); +#endif + + fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * col; + o.Albedo = c.rgb; + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + FallBack "Diffuse" +} diff --git a/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader.meta b/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader.meta new file mode 100644 index 00000000..658d988b --- /dev/null +++ b/Assets/UnitySensors/Runtime/Shaders/PointCloudXYZRGB.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 417e6f59011b2b743a51b9344a78b15d +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Editor/CustomInspector.meta b/Assets/UnitySensorsROS/Editor/CustomInspector.meta new file mode 100644 index 00000000..aa09b2ba --- /dev/null +++ b/Assets/UnitySensorsROS/Editor/CustomInspector.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5a415a06150cf4c4ca44b8ae3240ceba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs b/Assets/UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs new file mode 100644 index 00000000..ccd89416 --- /dev/null +++ b/Assets/UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs @@ -0,0 +1,15 @@ +using UnityEditor; +using UnitySensors.Sensor.TF; + +namespace UnitySensors.ROS.Editor +{ + [CustomEditor(typeof(TFLink))] + public class TFLinkEditor : UnityEditor.Editor + { + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + EditorGUILayout.HelpBox("TFLink does not use \"Frequency\" param.", MessageType.Info); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensors/Editor/TF/TFEditor.cs.meta b/Assets/UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs.meta similarity index 100% rename from Assets/UnitySensors/Editor/TF/TFEditor.cs.meta rename to Assets/UnitySensorsROS/Editor/CustomInspector/TFLinkEditor.cs.meta diff --git a/Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef b/Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef new file mode 100644 index 00000000..7d9186d6 --- /dev/null +++ b/Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "UnitySensorsROSEditor", + "rootNamespace": "", + "references": [ + "GUID:fa38f881a10f6314fa784b8975c16eff" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef.meta b/Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef.meta new file mode 100644 index 00000000..9a37d459 --- /dev/null +++ b/Assets/UnitySensorsROS/Editor/UnitySensorsROSEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8840b8e36cd17034a841908537d44f56 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/DepthCamera_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/DepthCamera_ros.prefab index 748405ed..7c6942af 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/DepthCamera_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/DepthCamera_ros.prefab @@ -11,9 +11,9 @@ GameObject: - component: {fileID: 4853532333615570984} - component: {fileID: 4853532333615571031} - component: {fileID: 4853532333615571030} - - component: {fileID: 4853532333615570986} - component: {fileID: 4853532333615570985} - - component: {fileID: 4853532333615570987} + - component: {fileID: 9201004833233192004} + - component: {fileID: 3086342091309557783} m_Layer: 0 m_Name: DepthCamera_ros m_TagString: Untagged @@ -96,7 +96,8 @@ MonoBehaviour: _fov: 30 _minRange: 0.05 _maxRange: 20 ---- !u!114 &4853532333615570986 + _gaussianNoiseSigma: 0 +--- !u!114 &4853532333615570985 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -105,16 +106,17 @@ MonoBehaviour: m_GameObject: {fileID: 4853532333615571027} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c5d828eb68e3371438db55311f6be27f, type: 3} + m_Script: {fileID: 11500000, guid: ca85518969b9bf94aa9948188d795075, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 - _topicName: /camera/depth/image/compressed + _topicName: /camera/depth/info _serializer: + _source: {fileID: 4853532333615571030} _header: + _source: {fileID: 4853532333615571030} _frame_id: /camera_frame - quality: 75 ---- !u!114 &4853532333615570985 +--- !u!114 &9201004833233192004 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -123,15 +125,17 @@ MonoBehaviour: m_GameObject: {fileID: 4853532333615571027} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ca85518969b9bf94aa9948188d795075, type: 3} + m_Script: {fileID: 11500000, guid: 4840ee4519c33a142a3fb06d6d6b3b50, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 - _topicName: /camera/depth/info + _topicName: /camera/depth/points _serializer: _header: + _source: {fileID: 4853532333615571030} _frame_id: /camera_frame ---- !u!114 &4853532333615570987 + _source: {fileID: 4853532333615571030} +--- !u!114 &3086342091309557783 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -140,11 +144,15 @@ MonoBehaviour: m_GameObject: {fileID: 4853532333615571027} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 66f06c73d3d50274d883545c2fbcd881, type: 3} + m_Script: {fileID: 11500000, guid: b474a6242e811f04488e3cb67b65dd35, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 - _topicName: /camera/depth/points + _topicName: /camera/depth/image/compressed _serializer: + _source: {fileID: 4853532333615571030} + _sourceTexture: 0 _header: + _source: {fileID: 4853532333615571030} _frame_id: /camera_frame + quality: 75 diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBCamera_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBCamera_ros.prefab index 5f26f37d..fac2ba6a 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBCamera_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBCamera_ros.prefab @@ -11,8 +11,8 @@ GameObject: - component: {fileID: 2016422477619200581} - component: {fileID: 2016422477619200582} - component: {fileID: 2016422477619200576} - - component: {fileID: 2016422477619200578} - component: {fileID: 2016422477619200579} + - component: {fileID: 7476313626036288691} m_Layer: 0 m_Name: RGBCamera_ros m_TagString: Untagged @@ -95,7 +95,7 @@ MonoBehaviour: _fov: 30 _minRange: 0.05 _maxRange: 100 ---- !u!114 &2016422477619200578 +--- !u!114 &2016422477619200579 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -104,16 +104,17 @@ MonoBehaviour: m_GameObject: {fileID: 2016422477619200586} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c5d828eb68e3371438db55311f6be27f, type: 3} + m_Script: {fileID: 11500000, guid: ca85518969b9bf94aa9948188d795075, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 - _topicName: /camera/color/image/compressed + _topicName: /camera/color/info _serializer: + _source: {fileID: 2016422477619200576} _header: + _source: {fileID: 2016422477619200576} _frame_id: /camera_frame - quality: 75 ---- !u!114 &2016422477619200579 +--- !u!114 &7476313626036288691 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -122,11 +123,15 @@ MonoBehaviour: m_GameObject: {fileID: 2016422477619200586} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ca85518969b9bf94aa9948188d795075, type: 3} + m_Script: {fileID: 11500000, guid: b474a6242e811f04488e3cb67b65dd35, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 - _topicName: /camera/color/info + _topicName: /camera/color/image/compressed _serializer: + _source: {fileID: 2016422477619200576} + _sourceTexture: 0 _header: + _source: {fileID: 2016422477619200576} _frame_id: /camera_frame + quality: 75 diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab new file mode 100644 index 00000000..292f10b0 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab @@ -0,0 +1,176 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4414791596585746458 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4414791596585746529} + - component: {fileID: 4414791596585746462} + - component: {fileID: 6928715047789551323} + - component: {fileID: 4414791596585746528} + - component: {fileID: 2224187045829796718} + - component: {fileID: 6110166055807567966} + - component: {fileID: 8736958369943202624} + m_Layer: 0 + m_Name: RGBDCamera_ros + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4414791596585746529 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &4414791596585746462 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!114 &6928715047789551323 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 58044c1bc2a88b943af133119c691560, type: 3} + m_Name: + m_EditorClassIdentifier: + _frequency: 10 + _resolution: {x: 640, y: 480} + _fov: 30 + _minRange: 0.05 + _maxRange: 100 + _gaussianNoiseSigma: 0 +--- !u!114 &4414791596585746528 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ca85518969b9bf94aa9948188d795075, type: 3} + m_Name: + m_EditorClassIdentifier: + _source: {fileID: 6928715047789551323} + _frequency: 10 + _topicName: /camera/info + _serializer: + _header: + _frame_id: /camera_frame +--- !u!114 &2224187045829796718 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24143da40ec715f40bf587d63ce67ed2, type: 3} + m_Name: + m_EditorClassIdentifier: + _source: {fileID: 6928715047789551323} + _frequency: 10 + _topicName: /camera/depth/points + _serializer: + _header: + _frame_id: /camera_frame +--- !u!114 &6110166055807567966 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b474a6242e811f04488e3cb67b65dd35, type: 3} + m_Name: + m_EditorClassIdentifier: + _source: {fileID: 6928715047789551323} + _frequency: 10 + _topicName: /camera/depth/image/compressed + _serializer: + _sourceTexture: 0 + _header: + _frame_id: /camera_frame + quality: 75 +--- !u!114 &8736958369943202624 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4414791596585746458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b474a6242e811f04488e3cb67b65dd35, type: 3} + m_Name: + m_EditorClassIdentifier: + _source: {fileID: 6928715047789551323} + _frequency: 10 + _topicName: /camera/color/image/compressed + _serializer: + _sourceTexture: 1 + _header: + _frame_id: /camera_frame + quality: 75 diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt.meta b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab.meta similarity index 62% rename from Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt.meta rename to Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab.meta index a6bdd912..3c66a1ad 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt.meta +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/Camera/RGBDCamera_ros.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 43e7df08f6bdfac4abe68cf6c53fafad -TextScriptImporter: +guid: caf455cab29d65c4491e901049b60dee +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/GNSS/GNSS_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/GNSS/GNSS_ros.prefab index 67a6d7cc..7e26f6a6 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/GNSS/GNSS_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/GNSS/GNSS_ros.prefab @@ -66,7 +66,9 @@ MonoBehaviour: _frequency: 10 _topicName: navsat _serializer: + _source: {fileID: 3192925013080293982} _header: + _source: {fileID: 3192925013080293982} _frame_id: map _status: 1 _service: 0 diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/GroundTruth/GroundTruth_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/GroundTruth/GroundTruth_ros.prefab index 001fe30a..caa14f08 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/GroundTruth/GroundTruth_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/GroundTruth/GroundTruth_ros.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 5717740228665964843} - component: {fileID: 2623422876239157573} - - component: {fileID: 8758993239309509226} + - component: {fileID: 6365885348317185162} m_Layer: 0 m_Name: GroundTruth_ros m_TagString: Untagged @@ -46,7 +46,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _frequency: 10 ---- !u!114 &8758993239309509226 +--- !u!114 &6365885348317185162 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -55,11 +55,13 @@ MonoBehaviour: m_GameObject: {fileID: 6638955471370723587} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0a05b6f4d45a9a844be53576f613e64d, type: 3} + m_Script: {fileID: 11500000, guid: 58c946e57b0f2a943abcff0d129aa500, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 - _topicName: /groundTruth/poseStamped + _topicName: ground_truth _serializer: + _source: {fileID: 2623422876239157573} _header: - _frame_id: /map + _source: {fileID: 2623422876239157573} + _frame_id: map diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/IMU/IMU_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/IMU/IMU_ros.prefab index f2430ab3..1ad7c1b2 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/IMU/IMU_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/IMU/IMU_ros.prefab @@ -66,5 +66,7 @@ MonoBehaviour: _frequency: 20 _topicName: /imu _serializer: + _source: {fileID: 3526848927119471302} _header: + _source: {fileID: 3526848927119471302} _frame_id: imu_link diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Livox/Mid-360_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Livox/Mid-360_ros.prefab index f3a0bb90..128a6fb5 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Livox/Mid-360_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Livox/Mid-360_ros.prefab @@ -75,7 +75,7 @@ GameObject: m_Component: - component: {fileID: 7522962572353966419} - component: {fileID: 7522962572353966418} - - component: {fileID: 7522962572353966417} + - component: {fileID: 7630058950724618500} m_Layer: 0 m_Name: Sensor m_TagString: Untagged @@ -117,7 +117,7 @@ MonoBehaviour: _maxRange: 70 _gaussianNoiseSigma: 0.02 _maxIntensity: 255 ---- !u!114 &7522962572353966417 +--- !u!114 &7630058950724618500 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -126,14 +126,16 @@ MonoBehaviour: m_GameObject: {fileID: 7522962572353966428} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e432afcc9ea3ada4b9be4fd86b0024f6, type: 3} + m_Script: {fileID: 11500000, guid: 32c6ed908b3e5d74697c679c7798bcc2, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 _topicName: /livox/lidar _serializer: _header: - _frame_id: /livox_frame + _source: {fileID: 7522962572353966418} + _frame_id: livox_frame + _source: {fileID: 7522962572353966418} --- !u!1 &7522962572398341445 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Velodyne/VLP-16_ros.prefab b/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Velodyne/VLP-16_ros.prefab index a6bbfc50..cbfc5818 100644 --- a/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Velodyne/VLP-16_ros.prefab +++ b/Assets/UnitySensorsROS/Runtime/Prefabs/LiDAR/Velodyne/VLP-16_ros.prefab @@ -326,7 +326,7 @@ GameObject: m_Component: - component: {fileID: 773861080551603304} - component: {fileID: 773861080551603223} - - component: {fileID: 7417028832377807650} + - component: {fileID: 2649015881702736681} m_Layer: 0 m_Name: Sensor m_TagString: Untagged @@ -368,7 +368,7 @@ MonoBehaviour: _maxRange: 100 _gaussianNoiseSigma: 0.05 _maxIntensity: 255 ---- !u!114 &7417028832377807650 +--- !u!114 &2649015881702736681 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -377,11 +377,13 @@ MonoBehaviour: m_GameObject: {fileID: 773861080551603221} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e432afcc9ea3ada4b9be4fd86b0024f6, type: 3} + m_Script: {fileID: 11500000, guid: 32c6ed908b3e5d74697c679c7798bcc2, type: 3} m_Name: m_EditorClassIdentifier: _frequency: 10 _topicName: /velodyne_points _serializer: _header: - _frame_id: /velodyne_link + _source: {fileID: 773861080551603223} + _frame_id: velodyne_link + _source: {fileID: 773861080551603223} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages.meta deleted file mode 100644 index bd9b285c..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1fefa2769a521eb43869657f9d6cfdff -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea.meta deleted file mode 100644 index 5e80d2e3..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e5d574e124d0d0f4485510e164163fe5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt deleted file mode 100644 index 37c5758c..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/LICENSE.txt +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2013-2021, ROS Device Driver Contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg.meta deleted file mode 100644 index 80a9d1cf..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6886efa7217c2c94d939733a1f7826dd -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs deleted file mode 100644 index a0cd6e05..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs +++ /dev/null @@ -1,70 +0,0 @@ -//Do not edit! This file was generated by Unity-ROS MessageGeneration. -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text; -using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using RosMessageTypes.Std; - -namespace RosMessageTypes.Nmea -{ - [Serializable] - public class SentenceMsg : Message - { - public const string k_RosMessageName = "nmea_msgs/Sentence"; - public override string RosMessageName => k_RosMessageName; - - // A message representing a single NMEA0183 sentence. - // header.stamp is the ROS Time when the sentence was read. - // header.frame_id is the frame of reference reported by the satellite - // receiver, usually the location of the antenna. This is a - // Euclidean frame relative to the vehicle, not a reference - // ellipsoid. - public HeaderMsg header; - // This should only contain ASCII characters in order to be a valid NMEA0183 sentence. - public string sentence; - - public SentenceMsg() - { - this.header = new HeaderMsg(); - this.sentence = ""; - } - - public SentenceMsg(HeaderMsg header, string sentence) - { - this.header = header; - this.sentence = sentence; - } - - public static SentenceMsg Deserialize(MessageDeserializer deserializer) => new SentenceMsg(deserializer); - - private SentenceMsg(MessageDeserializer deserializer) - { - this.header = HeaderMsg.Deserialize(deserializer); - deserializer.Read(out this.sentence); - } - - public override void SerializeTo(MessageSerializer serializer) - { - serializer.Write(this.header); - serializer.Write(this.sentence); - } - - public override string ToString() - { - return "SentenceMsg: " + - "\nheader: " + header.ToString() + - "\nsentence: " + sentence.ToString(); - } - -#if UNITY_EDITOR - [UnityEditor.InitializeOnLoadMethod] -#else - [UnityEngine.RuntimeInitializeOnLoadMethod] -#endif - public static void Register() - { - MessageRegistry.Register(k_RosMessageName, Deserialize); - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs.meta deleted file mode 100644 index 74d5c398..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Nmea/msg/SentenceMsg.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3fc5a6bd92cd1e140b135312ccf46784 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne.meta deleted file mode 100644 index 7ace4fb2..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e468c3facd00acf438421524b56859ea -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg.meta deleted file mode 100644 index 5c486aaa..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e9de86ff082cf5647b3cccb778de93a4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs deleted file mode 100644 index e9c944a0..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs +++ /dev/null @@ -1,66 +0,0 @@ -//Do not edit! This file was generated by Unity-ROS MessageGeneration. -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text; -using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using RosMessageTypes.BuiltinInterfaces; - -namespace RosMessageTypes.Velodyne -{ - [Serializable] - public class VelodynePacketMsg : Message - { - public const string k_RosMessageName = "velodyne_msgs/VelodynePacket"; - public override string RosMessageName => k_RosMessageName; - - // Raw Velodyne LIDAR packet. - public TimeMsg stamp; - // packet timestamp - public byte[] data; - // packet contents - - public VelodynePacketMsg() - { - this.stamp = new TimeMsg(); - this.data = new byte[1206]; - } - - public VelodynePacketMsg(TimeMsg stamp, byte[] data) - { - this.stamp = stamp; - this.data = data; - } - - public static VelodynePacketMsg Deserialize(MessageDeserializer deserializer) => new VelodynePacketMsg(deserializer); - - private VelodynePacketMsg(MessageDeserializer deserializer) - { - this.stamp = TimeMsg.Deserialize(deserializer); - deserializer.Read(out this.data, sizeof(byte), 1206); - } - - public override void SerializeTo(MessageSerializer serializer) - { - serializer.Write(this.stamp); - serializer.Write(this.data); - } - - public override string ToString() - { - return "VelodynePacketMsg: " + - "\nstamp: " + stamp.ToString() + - "\ndata: " + System.String.Join(", ", data.ToList()); - } - -#if UNITY_EDITOR - [UnityEditor.InitializeOnLoadMethod] -#else - [UnityEngine.RuntimeInitializeOnLoadMethod] -#endif - public static void Register() - { - MessageRegistry.Register(k_RosMessageName, Deserialize); - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs.meta deleted file mode 100644 index 1db9744e..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodynePacketMsg.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8f8c3ad2b3016f9479dc8f2c5f9cc57d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs deleted file mode 100644 index 7eedc8fb..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs +++ /dev/null @@ -1,67 +0,0 @@ -//Do not edit! This file was generated by Unity-ROS MessageGeneration. -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text; -using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using RosMessageTypes.Std; - -namespace RosMessageTypes.Velodyne -{ - [Serializable] - public class VelodyneScanMsg : Message - { - public const string k_RosMessageName = "velodyne_msgs/VelodyneScan"; - public override string RosMessageName => k_RosMessageName; - - // Velodyne LIDAR scan packets. - public HeaderMsg header; - // standard ROS message header - public VelodynePacketMsg[] packets; - // vector of raw packets - - public VelodyneScanMsg() - { - this.header = new HeaderMsg(); - this.packets = new VelodynePacketMsg[0]; - } - - public VelodyneScanMsg(HeaderMsg header, VelodynePacketMsg[] packets) - { - this.header = header; - this.packets = packets; - } - - public static VelodyneScanMsg Deserialize(MessageDeserializer deserializer) => new VelodyneScanMsg(deserializer); - - private VelodyneScanMsg(MessageDeserializer deserializer) - { - this.header = HeaderMsg.Deserialize(deserializer); - deserializer.Read(out this.packets, VelodynePacketMsg.Deserialize, deserializer.ReadLength()); - } - - public override void SerializeTo(MessageSerializer serializer) - { - serializer.Write(this.header); - serializer.WriteLength(this.packets); - serializer.Write(this.packets); - } - - public override string ToString() - { - return "VelodyneScanMsg: " + - "\nheader: " + header.ToString() + - "\npackets: " + System.String.Join(", ", packets.ToList()); - } - -#if UNITY_EDITOR - [UnityEditor.InitializeOnLoadMethod] -#else - [UnityEngine.RuntimeInitializeOnLoadMethod] -#endif - public static void Register() - { - MessageRegistry.Register(k_RosMessageName, Deserialize); - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs.meta deleted file mode 100644 index 1309e76d..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Messages/Velodyne/msg/VelodyneScanMsg.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0cc1f1984e0237d41bd7ed6880097c68 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera.meta deleted file mode 100644 index ef45390e..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ec06295033323644d8cc3f62b11d9bdc -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs deleted file mode 100644 index 33366434..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs +++ /dev/null @@ -1,10 +0,0 @@ -using UnityEngine; -using UnitySensors.Sensor.Camera; - -namespace UnitySensors.ROS.Publisher.Image -{ - [RequireComponent(typeof(CameraSensor))] - public class CameraImageMsgPublisher : ImageMsgPublisher - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs.meta deleted file mode 100644 index d4e42ee3..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraImageMsgPublisher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c5d828eb68e3371438db55311f6be27f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraInfoMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraInfoMsgPublisher.cs deleted file mode 100644 index 571fe575..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraInfoMsgPublisher.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; -using RosMessageTypes.Sensor; -using UnitySensors.Sensor.Camera; -using UnitySensors.ROS.Serializer.Camera; - -namespace UnitySensors.ROS.Publisher.Camera -{ - [RequireComponent(typeof(CameraSensor))] - public class CameraInfoMsgPublisher : RosMsgPublisher - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera.meta deleted file mode 100644 index 1b14355b..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1e26685f106ba3f47a97dc5212807d20 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs deleted file mode 100644 index be73f60b..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UnityEngine; -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor.Camera; - -namespace UnitySensors.ROS.Publisher.PointCloud -{ - [RequireComponent(typeof(DepthCameraSensor))] - public class DepthCameraPointCloud2MsgPublisher : PointCloud2MsgPublisher - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS.meta deleted file mode 100644 index f1f626e1..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5bb2fe39acf5a574395679a538055665 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs deleted file mode 100644 index 24bd94aa..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -using RosMessageTypes.Nmea; - -namespace UnitySensors.ROS -{ - /* - [RequireComponent(typeof(GPSSensor))] - [ExecuteAlways] - public class NMEAPublisher : Publisher - { - [SerializeField] - private string _topicName = "gnss/raw_data"; - [SerializeField] - private string _frame_id = "gnss_link"; - - [SerializeField] - private NMEASerializer _serializer_gps; - - protected override void Start() - { - base.Start(); - if (!Application.isPlaying) return; - _serializer_gps.Start(); - } - - protected override void Init() - { - _ros.RegisterPublisher(_topicName); - _serializer_gps.Init(_frame_id); - } - - protected override void Update() - { - base.Update(); - _serializer_gps.Update(); -#if UNITY_EDITOR - if (!Application.isPlaying && (_serializer_gps.format.updated)) - { - EditorUtility.SetDirty(this); - } -#endif - } - - protected override void Publish(float time) - { - _serializer_gps.Serialize(time, _sensor.coordinate, _sensor.velocity); - _ros.Publish(_topicName, _serializer_gps.msg); - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs.meta deleted file mode 100644 index 998aba5e..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NMEAPublisher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0cd1737f876f48b4989fb62329fbe050 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NavSatFixMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NavSatFixMsgPublisher.cs deleted file mode 100644 index 575df020..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NavSatFixMsgPublisher.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; -using RosMessageTypes.Sensor; - -using UnitySensors.Sensor.GNSS; -using UnitySensors.ROS.Serializer.GNSS; - -namespace UnitySensors.ROS.Publisher.GNSS -{ - [RequireComponent(typeof(GNSSSensor))] - public class NavSatFixMsgPublisher : RosMsgPublisher - { - } -} - diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs.meta new file mode 100644 index 00000000..036e564b --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad208b925f7901c4eba52ab115b2c5b6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs new file mode 100644 index 00000000..866ae726 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs @@ -0,0 +1,10 @@ +using RosMessageTypes.Geometry; + +using UnitySensors.ROS.Serializer.Geometry; + +namespace UnitySensors.ROS.Publisher.Geometry +{ + public class PoseStampedMsgPublisher : RosMsgPublisher + { + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs.meta new file mode 100644 index 00000000..d95c561a --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GeometryMsgs/PoseStampedMsgPublisher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58c946e57b0f2a943abcff0d129aa500 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth.meta deleted file mode 100644 index c0dd0cdd..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 68fd08c088cc6b74d9b987d684cccb9a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs deleted file mode 100644 index 349d6678..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs +++ /dev/null @@ -1,13 +0,0 @@ -using UnityEngine; -using RosMessageTypes.Geometry; - -using UnitySensors.Sensor.GroundTruth; -using UnitySensors.ROS.Serializer.PoseStamped; - -namespace UnitySensors.ROS.Publisher -{ - [RequireComponent(typeof(GroundTruth))] - public class GroundTruthPublisher : RosMsgPublisher, PoseStampedMsg> - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs.meta deleted file mode 100644 index f4a31cb4..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GroundTruth/GroundTruthPublisher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0a05b6f4d45a9a844be53576f613e64d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU.meta deleted file mode 100644 index 92aeb2f4..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0d08794f72f378a4ead24ab92643acea -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU/IMUMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU/IMUMsgPublisher.cs deleted file mode 100644 index 67493b7f..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU/IMUMsgPublisher.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; -using RosMessageTypes.Sensor; -using UnitySensors.Sensor.IMU; -using UnitySensors.ROS.Serializer.IMU; - -namespace UnitySensors.ROS.Publisher.IMU -{ - [RequireComponent(typeof(IMUSensor))] - public class IMUMsgPublisher : RosMsgPublisher - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image.meta deleted file mode 100644 index e555b2b3..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3fc395ca34b7d4a4e91cefc92ad5660d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image/ImageMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image/ImageMsgPublisher.cs deleted file mode 100644 index c29133b1..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image/ImageMsgPublisher.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; -using RosMessageTypes.Sensor; -using UnitySensors.Data.Texture; -using UnitySensors.Sensor; -using UnitySensors.ROS.Serializer.Image; - -namespace UnitySensors.ROS.Publisher.Image -{ - public class ImageMsgPublisher : RosMsgPublisher, CompressedImageMsg> where T : UnitySensor, ITextureInterface - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR.meta deleted file mode 100644 index b3412b55..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 25d356387b027d749a72cd25030afa92 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs deleted file mode 100644 index 602caa0f..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor.LiDAR; -using UnitySensors.ROS.Publisher.PointCloud; - -namespace UnitySensors.ROS.Publisher.LiDAR -{ - [RequireComponent(typeof(DepthBufferLiDARSensor))] - public class DepthBufferLiDARPointCloud2MsgPublisher : PointCloud2MsgPublisher - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs.meta deleted file mode 100644 index 1c721ea0..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/DepthBufferLiDARPointCloud2MsgPublisher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 849f66e9cf6e1df4daee9aecb2918542 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs deleted file mode 100644 index d9f1734f..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor.LiDAR; -using UnitySensors.ROS.Publisher.PointCloud; - -namespace UnitySensors.ROS.Publisher.LiDAR -{ - [RequireComponent(typeof(RaycastLiDARSensor))] - public class RaycastLiDARPointCloud2MsgPublisher : PointCloud2MsgPublisher - { - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs.meta deleted file mode 100644 index de912b66..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/LiDAR/RaycastLiDARPointCloud2MsgPublisher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e432afcc9ea3ada4b9be4fd86b0024f6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud/PointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud/PointCloud2MsgPublisher.cs deleted file mode 100644 index f3b0c93f..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud/PointCloud2MsgPublisher.cs +++ /dev/null @@ -1,19 +0,0 @@ -using UnityEngine; -using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using RosMessageTypes.Sensor; -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor; -using UnitySensors.ROS.Serializer.PointCloud; - -namespace UnitySensors.ROS.Publisher.PointCloud -{ - public class PointCloud2MsgPublisher : RosMsgPublisher, PointCloud2Msg> - where T : UnitySensor, IPointCloudInterface - where TT : struct, IPointXYZInterface - { - private void OnDestroy() - { - _serializer.Dispose(); - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/RosMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/RosMsgPublisher.cs index 3e8b9874..b379b444 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/RosMsgPublisher.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/RosMsgPublisher.cs @@ -2,21 +2,20 @@ using Unity.Robotics.ROSTCPConnector; using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using UnitySensors.Sensor; using UnitySensors.ROS.Serializer; namespace UnitySensors.ROS.Publisher { - public class RosMsgPublisher : MonoBehaviour where T : UnitySensor where TT : RosMsgSerializer where TTT : Message, new() + public class RosMsgPublisher : MonoBehaviour where T : RosMsgSerializer where TT : Message, new() { [SerializeField] private float _frequency = 10.0f; [SerializeField] - private string _topicName; + protected string _topicName; [SerializeField] - protected TT _serializer; + protected T _serializer; private ROSConnection _ros; @@ -31,9 +30,9 @@ protected virtual void Start() _frequency_inv = 1.0f / _frequency; _ros = ROSConnection.GetOrCreateInstance(); - _ros.RegisterPublisher(_topicName); + _ros.RegisterPublisher(_topicName); - _serializer.Init(GetComponent()); + _serializer.Init(); } protected virtual void Update() @@ -45,5 +44,10 @@ protected virtual void Update() _dt -= _frequency_inv; } + + private void OnDestroy() + { + _serializer.OnDestroy(); + } } } diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs.meta new file mode 100644 index 00000000..afec6fe5 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f5fe93c7587f4cd478b55df01d5d720c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CameraInfoMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CameraInfoMsgPublisher.cs new file mode 100644 index 00000000..41ef193a --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CameraInfoMsgPublisher.cs @@ -0,0 +1,9 @@ +using RosMessageTypes.Sensor; +using UnitySensors.ROS.Serializer.Sensor; + +namespace UnitySensors.ROS.Publisher.Camera +{ + public class CameraInfoMsgPublisher : RosMsgPublisher + { + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraInfoMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CameraInfoMsgPublisher.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/CameraInfoMsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CameraInfoMsgPublisher.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CompressedImageMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CompressedImageMsgPublisher.cs new file mode 100644 index 00000000..d8cdcca7 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CompressedImageMsgPublisher.cs @@ -0,0 +1,9 @@ +using RosMessageTypes.Sensor; +using UnitySensors.ROS.Serializer.Sensor; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public class CompressedImageMsgPublisher : RosMsgPublisher + { + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image/ImageMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CompressedImageMsgPublisher.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Image/ImageMsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/CompressedImageMsgPublisher.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/IMUMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/IMUMsgPublisher.cs new file mode 100644 index 00000000..d21e07bd --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/IMUMsgPublisher.cs @@ -0,0 +1,9 @@ +using RosMessageTypes.Sensor; +using UnitySensors.ROS.Serializer.Sensor; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public class IMUMsgPublisher : RosMsgPublisher + { + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU/IMUMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/IMUMsgPublisher.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/IMU/IMUMsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/IMUMsgPublisher.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/NavSatFixMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/NavSatFixMsgPublisher.cs new file mode 100644 index 00000000..96ccd384 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/NavSatFixMsgPublisher.cs @@ -0,0 +1,10 @@ +using RosMessageTypes.Sensor; +using UnitySensors.ROS.Serializer.Sensor; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public class NavSatFixMsgPublisher : RosMsgPublisher + { + } +} + diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NavSatFixMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/NavSatFixMsgPublisher.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/GNSS/NavSatFixMsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/NavSatFixMsgPublisher.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg.meta new file mode 100644 index 00000000..8d8b5658 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a71cdadaa469224f95b2d66d58bca0c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs new file mode 100644 index 00000000..2f4f41e0 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public class DepthCameraPointCloud2MsgPublisher : PointCloud2MsgPublisher + { + [SerializeField, Interface(typeof(IPointCloudInterface))] + private Object _source; + + private void Awake() + { + _serializer.SetSource(_source as IPointCloudInterface); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs.meta similarity index 83% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs.meta index 5c2b9fb1..d9624057 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Camera/DepthCamera/DepthCameraPointCloud2MsgPublisher.cs.meta +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/DepthCameraPointCloud2MsgPublisher.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 66f06c73d3d50274d883545c2fbcd881 +guid: 4840ee4519c33a142a3fb06d6d6b3b50 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs new file mode 100644 index 00000000..171836a7 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public class LiDARPointCloud2MsgPublisher : PointCloud2MsgPublisher + { + [SerializeField, Interface(typeof(IPointCloudInterface))] + private Object _source; + + private void Awake() + { + _serializer.SetSource(_source as IPointCloudInterface); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs.meta new file mode 100644 index 00000000..ef62b848 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/LiDARPointCloud2MsgPublisher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32c6ed908b3e5d74697c679c7798bcc2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs new file mode 100644 index 00000000..a4a95de6 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using UnitySensors.Attribute; +using UnitySensors.DataType.Sensor.PointCloud; +using UnitySensors.Interface.Sensor; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public class RGBDCameraPointCloud2MsgPublisher : PointCloud2MsgPublisher + { + [SerializeField, Interface(typeof(IPointCloudInterface))] + private Object _source; + + private void Awake() + { + _serializer.SetSource(_source as IPointCloudInterface); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs.meta new file mode 100644 index 00000000..18f953c8 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2Msg/RGBDCameraPointCloud2MsgPublisher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 24143da40ec715f40bf587d63ce67ed2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2MsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2MsgPublisher.cs new file mode 100644 index 00000000..398655ac --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2MsgPublisher.cs @@ -0,0 +1,11 @@ +using RosMessageTypes.Sensor; + +using UnitySensors.Interface.Sensor.PointCloud; +using UnitySensors.ROS.Serializer.PointCloud; + +namespace UnitySensors.ROS.Publisher.Sensor +{ + public abstract class PointCloud2MsgPublisher : RosMsgPublisher, PointCloud2Msg> where T : struct, IPointInterface + { + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud/PointCloud2MsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2MsgPublisher.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/PointCloud/PointCloud2MsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/SensorMsgs/PointCloud2MsgPublisher.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF/TFMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF/TFMsgPublisher.cs deleted file mode 100644 index adceca58..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF/TFMsgPublisher.cs +++ /dev/null @@ -1,16 +0,0 @@ -using UnityEngine; - -using RosMessageTypes.Tf2; - -using UnitySensors.Sensor.TF; -using UnitySensors.ROS.Serializer.TF; - -namespace UnitySensors.ROS.Publisher.TF -{ - using TFSensor = Sensor.TF.TF; - - [RequireComponent(typeof(TFSensor))] - public class TFMsgPublisher : RosMsgPublisher - { - } -} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs/TFMessageMsgPublisher.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs/TFMessageMsgPublisher.cs new file mode 100644 index 00000000..c5175195 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs/TFMessageMsgPublisher.cs @@ -0,0 +1,9 @@ +using RosMessageTypes.Tf2; +using UnitySensors.ROS.Serializer.Tf2; + +namespace UnitySensors.ROS.Publisher.Tf2 +{ + public class TFMessageMsgPublisher : RosMsgPublisher + { + } +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF/TFMsgPublisher.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs/TFMessageMsgPublisher.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Publishers/TF/TFMsgPublisher.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Publishers/Tf2Msgs/TFMessageMsgPublisher.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Sensors.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Sensors.meta new file mode 100644 index 00000000..0325716a --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Sensors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 025a55b2433fe9b4c8db0cec68de229e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/TF.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Sensors/TF.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF.meta diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs similarity index 53% rename from Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs rename to Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs index 2f2846fe..129e2af0 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs @@ -14,12 +14,12 @@ public struct TFData public Quaternion rotation; }; - public class TF : UnitySensor + public class TFLink : UnitySensor { [SerializeField] private string _frame_id; [SerializeField] - private TF[] _children; + private TFLink[] _children; private Transform _transform; @@ -39,7 +39,7 @@ public TFData[] GetTFData() Matrix4x4 worldToLocalMatrix = _transform.worldToLocalMatrix; Quaternion worldToLocalQuaternion = Quaternion.Inverse(_transform.rotation); - foreach (TF child in _children) + foreach (TFLink child in _children) { tfData.AddRange(child.GetTFData(_frame_id, worldToLocalMatrix, worldToLocalQuaternion)); } @@ -70,7 +70,7 @@ public TFData[] GetTFData(string frame_id_parent, Matrix4x4 worldToLocalMatrix, worldToLocalMatrix = _transform.worldToLocalMatrix; worldToLocalQuaternion = Quaternion.Inverse(_transform.rotation); - foreach (TF child in _children) + foreach (TFLink child in _children) { tfData.AddRange(child.GetTFData(_frame_id, worldToLocalMatrix, worldToLocalQuaternion)); } @@ -82,77 +82,4 @@ protected override void OnSensorDestroy() { } } -} - -/* -public class TFSensor : Sensor -{ - public struct TFData - { - public string frame_id_parent; - public string frame_id_child; - public Vector3 position; - public Quaternion rotation; - }; - - [SerializeField] - public string frame_id; - [SerializeField] - public TFSensor[] _children; - - private Transform _transform; - - public TFData[] tf { get => GetTFData(); } - - protected override void Init() - { - _transform = transform; - base.Init(); - } - - protected override void UpdateSensor() - { - base.UpdateSensor(); - } - - public TFData[] GetTFData() - { - List tf = new List(); - - Matrix4x4 worldToLocalMatrix = _transform.worldToLocalMatrix; - Quaternion worldToLocalQuaternion = Quaternion.Inverse(_transform.rotation); - foreach (TFSensor child in _children) - { - tf.AddRange(child.GetTFData(frame_id, worldToLocalMatrix, worldToLocalQuaternion)); - } - return tf.ToArray(); - } - - public TFData[] GetTFData(string frame_id_parent, Matrix4x4 worldToLocalMatrix, Quaternion worldToLocalQuaternion) - { - List tf = new List(); - - TFData tfData; - tfData.frame_id_parent = frame_id_parent; - tfData.frame_id_child = frame_id; - tfData.position = worldToLocalMatrix * _transform.position; - tfData.rotation = worldToLocalQuaternion * _transform.rotation; - tf.Add(tfData); - - worldToLocalMatrix = _transform.worldToLocalMatrix; - worldToLocalQuaternion = Quaternion.Inverse(_transform.rotation); - foreach (TFSensor child in _children) - { - tf.AddRange(child.GetTFData(frame_id, worldToLocalMatrix, worldToLocalQuaternion)); - } - return tf.ToArray(); - } - - public void AddChild(TFSensor child) - { - List children = _children!=null ? new List(_children) : new List(); - children.Add(child); - _children = children.ToArray(); - } -} -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs.meta similarity index 100% rename from Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Sensors/TF/TFLink.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera.meta deleted file mode 100644 index 23e92d54..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b002083f87a49054d9aa148dd8dde9a7 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera/CameraInfoMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera/CameraInfoMsgSerializer.cs deleted file mode 100644 index 83cc110b..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera/CameraInfoMsgSerializer.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine; -using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using RosMessageTypes.Sensor; -using UnitySensors.Sensor.Camera; - -namespace UnitySensors.ROS.Serializer.Camera -{ - [System.Serializable] - public class CameraInfoMsgSerializer : RosMsgSerializer - { - [SerializeField] - private HeaderSerializer _header; - - public override void Init(CameraSensor sensor) - { - base.Init(sensor); - _header.Init(sensor); - } - - public override CameraInfoMsg Serialize() - { - _msg = CameraInfoGenerator.ConstructCameraInfoMessage(sensor.m_camera, _header.Serialize()); - return _msg; - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS.meta deleted file mode 100644 index fcc423c5..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 91c9aeed0586da345a00ae7652c9ee69 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA.meta deleted file mode 100644 index a49f1550..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d6502f40124c3da4c97da522cb76adf7 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats.meta deleted file mode 100644 index 0700bf99..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6972d30acfe31b64b9ce83b48b262f4b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs deleted file mode 100644 index 56ec18dc..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnitySensors -{ - /* - [CreateAssetMenu] - public class GPGGA : NMEAFormat - { - private enum Quality - { - NONE = 0, - SPS = 1, - DIFFERENTIAL_GPS = 2 - } - - [SerializeField] - private TimeMode _timeMode; - [SerializeField] - private Quality _quality; - [SerializeField] - private uint _satelliteNum = 8; - [SerializeField] - private float _HDOP = 0.0f; - [SerializeField] - private float _geoidHeight = 36.7071f; - - public override string Serialize(GeoCoordinate coordinate, Vector3 velocity) - { - string sentence = "$GPGGA,"; - - switch (_timeMode) - { - case TimeMode.SIM: - base.AddSimTime(ref sentence); - break; - case TimeMode.UTC: - base.AddUTCTime(ref sentence); - break; - } - - base.AddLatitude(ref sentence, (float)coordinate.latitude); - base.AddLongitude(ref sentence, (float)coordinate.longitude); - - sentence += ((int)_quality).ToString(); - sentence += ","; - - sentence += ((int)_satelliteNum).ToString("D02"); - sentence += ","; - - sentence += _HDOP.ToString(); - sentence += ","; - - sentence += coordinate.altitude.ToString(); - sentence += ",M,"; - - sentence += Math.Round(_geoidHeight, 1).ToString(); - sentence += ",M,"; - - sentence += ","; - - sentence += "0000"; - - base.AddChecksum(ref sentence); - - sentence += "\r\n"; - - return sentence; - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs.meta deleted file mode 100644 index 6d5d0b83..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGGA.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3a43f2130f8dec04da1eb2fbd26724c9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs deleted file mode 100644 index 1ca727d6..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnitySensors -{ - /* - [CreateAssetMenu] - public class GPGSA : NMEAFormat - { - private enum Mode - { - AUTO, - MANUAL - } - - private enum LocatingType - { - NONE = 1, - TWO_D = 2, - THREE_D = 3 - } - - [SerializeField] - private Mode _mode; - [SerializeField] - private int[] _satelliteID; - [SerializeField] - private LocatingType _locatingType; - [SerializeField] - private float _PDOP = 0.0f; - [SerializeField] - private float _HDOP = 0.0f; - [SerializeField] - private float _VDOP = 0.0f; - - public override string Serialize(GeoCoordinate coordinate, Vector3 velocity) - { - string sentence = "$GPGSA,"; - - switch (_mode) - { - case Mode.AUTO: - sentence += "A,"; - break; - case Mode.MANUAL: - sentence += "M,"; - break; - } - - sentence += ((int)_locatingType).ToString(); - - for (int i = 0; i < _satelliteID.Length && i < 12; i++) - { - sentence += _satelliteID[i].ToString("D02"); - sentence += ","; - } - - sentence += _PDOP.ToString("0.0"); - sentence += ","; - - sentence += _HDOP.ToString("0.0"); - sentence += ","; - - sentence += _VDOP.ToString("0.0"); - - base.AddChecksum(ref sentence); - - sentence += "\r\n"; - - return sentence; - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs.meta deleted file mode 100644 index 3a1358fc..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPGSA.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a7d7a4a2427093344bcbf28db18f9d83 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs deleted file mode 100644 index ffebaed1..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnitySensors -{ - /* - [CreateAssetMenu] - public class GPRMC : NMEAFormat - { - [SerializeField] - private TimeMode _timeMode; - - [SerializeField] - private NMEAMode _mode; - - [SerializeField, Tooltip("False : Available, True : Warning")] - private bool _status; - - private const float _meterPerSec2knot = 1.9384f; - - public override string Serialize(GeoCoordinate coordinate, Vector3 velocity) - { - velocity.y = 0.0f; - float groundSpeed = velocity.magnitude * _meterPerSec2knot; - float directionOfMovement = Mathf.Atan2(velocity.x, velocity.z) * Mathf.Rad2Deg; - if (directionOfMovement < 0) directionOfMovement += 360.0f; - - string sentence = "$GPRMC,"; - - switch (_timeMode) - { - case TimeMode.SIM: - base.AddSimTime(ref sentence); - break; - case TimeMode.UTC: - base.AddUTCTime(ref sentence); - break; - }; - - sentence += _status ? "V" : "A"; - sentence += ","; - - base.AddLatitude(ref sentence, (float) coordinate.latitude); - base.AddLongitude(ref sentence, (float) coordinate.longitude); - - sentence += groundSpeed.ToString("000.0"); - sentence += ","; - - sentence += directionOfMovement.ToString("000.0"); - sentence += ","; - - AddUTCDate(ref sentence); - - sentence += ",,"; - - switch (_mode) - { - case NMEAMode.NONE: - sentence += "N"; - break; - case NMEAMode.AUTONOMOUS: - sentence += "A"; - break; - case NMEAMode.DIFFERENTIAL: - sentence += "D"; - break; - case NMEAMode.ESTIMATED: - sentence += "E"; - break; - } - - base.AddChecksum(ref sentence); - - sentence += "\r\n"; - - return sentence; - } - - private void AddUTCDate(ref string sentence) - { - sentence += DateTime.UtcNow.Day.ToString("D02"); - sentence += DateTime.UtcNow.Month.ToString("D02"); - sentence += ((int)(DateTime.UtcNow.Year - (int)(DateTime.UtcNow.Year * 0.01) * 100)).ToString("D02"); - sentence += ","; - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs.meta deleted file mode 100644 index 95df23ac..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPRMC.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 56d3b5f215c5fe24eada1c2197b43338 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs deleted file mode 100644 index 15fc020d..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnitySensors -{ - /* - [CreateAssetMenu] - public class GPVTG : NMEAFormat - { - [SerializeField] - private NMEAMode _mode; - - private const float _meterPerSec2knot = 1.9384f; - private const float _meterPerSec2KiloMeterPerHour = 3.6f; - - public override string Serialize(GeoCoordinate coordinate, Vector3 velocity) - { - velocity.y = 0.0f; - float vel = velocity.magnitude; - float groundSpeed_knot = vel * _meterPerSec2knot; - float groundSpeed_kiloMetersPerHour = vel * _meterPerSec2KiloMeterPerHour; - float directionOfMovement = Mathf.Atan2(velocity.x, velocity.z) * Mathf.Rad2Deg; - if (directionOfMovement < 0) directionOfMovement += 360.0f; - - string sentence = "$GPVTG,"; - - sentence += directionOfMovement.ToString("000.0"); - sentence += ",T,"; - - sentence += ",M,"; - - sentence += groundSpeed_knot.ToString("000.0"); - sentence += ",N,"; - sentence += groundSpeed_kiloMetersPerHour.ToString("000.0"); - sentence += ",K,"; - - switch (_mode) - { - case NMEAMode.NONE: - sentence += "N"; - break; - case NMEAMode.AUTONOMOUS: - sentence += "A"; - break; - case NMEAMode.DIFFERENTIAL: - sentence += "D"; - break; - case NMEAMode.ESTIMATED: - sentence += "E"; - break; - } - - base.AddChecksum(ref sentence); - - sentence += "\r\n"; - - return sentence; - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs.meta deleted file mode 100644 index 759ec7fd..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/Formats/GPVTG.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e796dcb07eb17c3449f7f627ce34fee9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs deleted file mode 100644 index c2845fec..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnitySensors -{ - /* - public class NMEAFormat : AttachableScriptableObject - { - protected enum TimeMode - { - SIM = 0, - UTC = 1 - } - - protected enum NMEAMode - { - NONE, - AUTONOMOUS, - DIFFERENTIAL, - ESTIMATED - } - - public virtual void Init() - { - - } - - public virtual string Serialize(GeoCoordinate coordinate, Vector3 velocity) - { - return ""; - } - - protected void AddUTCTime(ref string sentence) - { - sentence += DateTime.UtcNow.Hour.ToString("D02"); - sentence += DateTime.UtcNow.Minute.ToString("D02"); - sentence += DateTime.UtcNow.Second.ToString("D02"); - sentence += "."; - sentence += DateTime.UtcNow.Millisecond.ToString("D3"); - sentence += ","; - } - protected void AddSimTime(ref string sentence) - { - uint raw_sec = (uint)Math.Truncate(Time.time); - uint hour = raw_sec / 3600; - uint min = (raw_sec - (3600 * hour)) / 60; - uint sec = raw_sec - (3600 * hour) - (60 * min); - uint millisec = (uint)((Time.time % 1) * 1e+3); - sentence += hour.ToString("D02"); - sentence += min.ToString("D02"); - sentence += sec.ToString("D02"); - sentence += "."; - sentence += millisec.ToString("D3"); - sentence += ","; - } - - protected void AddLatitude(ref string sentence, float latitude) - { - sentence += ((latitude < 0 ? -latitude : latitude) * 1e2).ToString(); - sentence += ","; - if (latitude >= 0) - sentence += "N"; - else - sentence += "S"; - sentence += ","; - } - - protected void AddLongitude(ref string sentence, float longitude) - { - sentence += ((longitude < 0 ? -longitude : longitude) * 1e2).ToString(); - sentence += ","; - if (longitude >= 0) - sentence += "E"; - else - sentence += "W"; - sentence += ","; - } - - protected void AddChecksum(ref string sentence) - { - byte checksum = 0; - for (int i = 1; i < sentence.Length; i++) - checksum ^= (byte)sentence[i]; - sentence += "*"; - sentence += checksum.ToString("X2"); - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs.meta deleted file mode 100644 index f8182c85..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormat.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 94cee98cdf3a2c4458a43ba92c05c73c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs deleted file mode 100644 index d1b5e26c..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace UnitySensors -{ - /* - [System.Serializable] - public class NMEAFormatManager : AttachableScriptableObjectManager - { - private NMEAFormat _format; - - public override void Start() - { - base.Start(); - _format = base._scriptableObject as NMEAFormat; - if (_format) _format.Init(); - else Debug.LogError("Type of NMEAFormat does not match."); - } - - public override void Update() - { - base.Update(); - } - - public string Serialize(GeoCoordinate coordinate, Vector3 velocity) - { - return _format.Serialize(coordinate, velocity); - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs.meta deleted file mode 100644 index afbd5f69..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEA/NMEAFormatManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 04b8486fb47ad3f4593adb2d409dea5b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs deleted file mode 100644 index 3846ddb6..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -using Unity.Robotics.ROSTCPConnector.ROSGeometry; -using RosMessageTypes.Nmea; - -namespace UnitySensors.ROS -{ - /* - [System.Serializable] - public class NMEASerializer : Serializer - { - [SerializeField] - private NMEAFormatManager _format; - - private SentenceMsg _msg; - private AutoHeader _header; - - public NMEAFormatManager format { get => _format; } - public SentenceMsg msg { get => _msg; } - - public void Start() - { - _format.Start(); - } - - public void Init(string frame_id) - { - _msg = new SentenceMsg(); - _header = new AutoHeader(); - - _header.Init(frame_id); - } - - public void Update() - { - _format.Update(); - } - - public void Serialize(float time, GeoCoordinate coordinate, Vector3 velocity) - { - _header.Serialize(time); - _msg.sentence = _format.Serialize(coordinate, velocity); - _msg.header = _header.header; - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs.meta deleted file mode 100644 index e4b97984..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NMEASerializer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6ea023b814d823e40b8d541c50052d96 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs.meta new file mode 100644 index 00000000..ff346b73 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86abc1269b9ec4a4c951090f5bde2c1f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs/PoseStampedMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs/PoseStampedMsgSerializer.cs new file mode 100644 index 00000000..60c28dd9 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs/PoseStampedMsgSerializer.cs @@ -0,0 +1,37 @@ +using UnityEngine; + +using Unity.Robotics.ROSTCPConnector.ROSGeometry; +using RosMessageTypes.Geometry; + +using UnitySensors.Attribute; +using UnitySensors.Interface.Geometry; +using UnitySensors.ROS.Serializer.Std; + +namespace UnitySensors.ROS.Serializer.Geometry +{ + [System.Serializable] + public class PoseStampedMsgSerializer : RosMsgSerializer + { + [SerializeField, Interface(typeof(IPoseInterface))] + private Object _source; + [SerializeField] + private HeaderSerializer _header; + + private IPoseInterface _sourceInterface; + + public override void Init() + { + base.Init(); + _header.Init(); + _sourceInterface = _source as IPoseInterface; + } + + public override PoseStampedMsg Serialize() + { + _msg.header = _header.Serialize(); + _msg.pose.position = _sourceInterface.position.To(); + _msg.pose.orientation = _sourceInterface.rotation.To(); + return _msg; + } + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose/PoseStampedMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs/PoseStampedMsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose/PoseStampedMsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GeometryMsgs/PoseStampedMsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/HeaderSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/HeaderSerializer.cs deleted file mode 100644 index d3261ba2..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/HeaderSerializer.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using UnityEngine; -using UnitySensors.Sensor; -using RosMessageTypes.Std; - -namespace UnitySensors.ROS.Serializer -{ - [System.Serializable] - public class HeaderSerializer : RosMsgSerializer - { - [SerializeField] - private string _frame_id; - - public override void Init(UnitySensor sensor) - { - base.Init(sensor); - _msg.frame_id = _frame_id; -#if ROS2 -#else - _msg.seq = 0; -#endif - } - - public override HeaderMsg Serialize() - { -#if ROS2 - int sec = (int)Math.Truncate(sensor.time); -#else - uint sec = (uint)Math.Truncate(sensor.time); -#endif - _msg.stamp.sec = sec; - _msg.stamp.nanosec = (uint)((sensor.time - sec) * 1e+9); -#if ROS2 -#else - _msg.seq++; -#endif - return _msg; - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU.meta deleted file mode 100644 index 7986bc34..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cfeffd4cb6c3ff943a61358f2f8de918 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU/IMUMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU/IMUMsgSerializer.cs deleted file mode 100644 index d3734922..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU/IMUMsgSerializer.cs +++ /dev/null @@ -1,29 +0,0 @@ -using UnityEngine; -using Unity.Robotics.ROSTCPConnector.ROSGeometry; -using RosMessageTypes.Sensor; -using UnitySensors.Sensor.IMU; - -namespace UnitySensors.ROS.Serializer.IMU -{ - [System.Serializable] - public class IMUMsgSerializer : RosMsgSerializer - { - [SerializeField] - private HeaderSerializer _header; - - public override void Init(IMUSensor sensor) - { - base.Init(sensor); - _header.Init(sensor); - } - - public override ImuMsg Serialize() - { - _msg.header = _header.Serialize(); - _msg.linear_acceleration = sensor.acceleration.To(); - _msg.orientation = sensor.rotation.To(); - _msg.angular_velocity = sensor.angularVelocity.To(); - return _msg; - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image.meta deleted file mode 100644 index c69d7765..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e33d6f1fd6a38484ea8c298a5b3586a7 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image/ImageMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image/ImageMsgSerializer.cs deleted file mode 100644 index 7255046b..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image/ImageMsgSerializer.cs +++ /dev/null @@ -1,32 +0,0 @@ -using UnityEngine; - -using RosMessageTypes.Sensor; -using UnitySensors.Data.Texture; -using UnitySensors.Sensor; - -namespace UnitySensors.ROS.Serializer.Image -{ - [System.Serializable] - public class ImageMsgSerializer : RosMsgSerializer where T : UnitySensor, ITextureInterface - { - [SerializeField] - private HeaderSerializer _header; - [SerializeField, Range(1, 100)] - private int quality = 75; - - public override void Init(T sensor) - { - base.Init(sensor); - _header.Init(sensor); - - _msg.format = "jpeg"; - } - - public override CompressedImageMsg Serialize() - { - _msg.header = _header.Serialize(); - _msg.data = sensor.texture.EncodeToJPG(quality); - return _msg; - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR.meta deleted file mode 100644 index bfe9f800..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e0225f80a48393642adb6f50b6640200 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne.meta deleted file mode 100644 index 8780023c..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0399b6aa94a0ae14c8e1a6aceb6ebea0 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs deleted file mode 100644 index 5aafe492..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -using Unity.Burst; -using Unity.Collections; -using UnityEngine.Jobs; -using Unity.Jobs; - -using RosMessageTypes.Velodyne; - -namespace UnitySensors.ROS -{ - /* - [System.Serializable] - public class VelodyneMsgSerializer : Serializer - { - private VelodyneScanMsg _msg; - private AutoHeader _header; - - private JobHandle _handle; - private DistancesToVelodyneScanMsgJob _job; - - private NativeArray _packets; - - private int _jobSize; - - public VelodyneScanMsg msg { get => _msg; } - - public void Init(string frame_id, ref NativeArray distances, ref NativeArray intensities, int pointsNum, int azimuthResolution) - { - _header = new AutoHeader(); - _header.Init(frame_id); - - _msg = new VelodyneScanMsg(); - _msg.packets = new VelodynePacketMsg[azimuthResolution/12]; - for (int i = 0; i < _msg.packets.Length; i++) - { - _msg.packets[i] = new VelodynePacketMsg(); - _msg.packets[i].data = new byte[1206]; - } - - _packets = new NativeArray(pointsNum / 12 * 1260, Allocator.Persistent); - - _jobSize = azimuthResolution / 12; - - _job = new DistancesToVelodyneScanMsgJob - { - azimuth_coef = 1200.0f * 360.0f / azimuthResolution, - timeStamp = 0, - distances = distances, - intensities = intensities, - packets = _packets - }; - } - - public VelodyneScanMsg Serialize(float time) - { - _handle = _job.Schedule(_jobSize, 1); - JobHandle.ScheduleBatchedJobs(); - _handle.Complete(); - - _header.Serialize(time); - - _msg.header = _header.header; - -#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++) - { - _msg.packets[i].data = _packets.GetSubArray(i * 1206, 1206).ToArray(); - _msg.packets[i].stamp.sec = sec; - _msg.packets[i].stamp.nanosec = nanosec; - } - - return _msg; - } - - public void Dispose() - { - _handle.Complete(); - _packets.Dispose(); - } - - [BurstCompile] - public struct DistancesToVelodyneScanMsgJob : IJobParallelFor - { - [ReadOnly] - public float azimuth_coef; - [ReadOnly] - public float timeStamp; - - [ReadOnly, NativeDisableParallelForRestriction] - public NativeArray distances; - [ReadOnly, NativeDisableParallelForRestriction] - public NativeArray intensities; - - [NativeDisableParallelForRestriction] - public NativeArray packets; - - public void Execute(int index) - { - ushort azimuth = (ushort)Mathf.Round(index * azimuth_coef); - byte azimuth_packet_u = (byte)((azimuth << 8) >> 8); - byte azimuth_packet_d = (byte)(azimuth >> 8); - - for (int i = 0; i < 1200; i += 100) - { - int index_i = index + i; - - // Header - packets[index_i++] = 0xff; - packets[index_i++] = 0xee; - - // Azimuth Data - packets[index_i++] = azimuth_packet_u; - packets[index_i++] = azimuth_packet_d; - - for(int j = 0; j < 16; j++) - { - int index_j = index_i + j * 3; - int index_d = index_i + (j / 2) + (j % 2) * 8; - - // Distance - ushort distance = (ushort)Mathf.Round((distances[index_d] * 1e+3f) / 2.0f); - packets[index_j++] = (byte)((distance << 8) >> 8); - packets[index_j++] = (byte)(distance >> 8); - - // Intensity - packets[index_j] = (byte)(intensities[index_d]); - } - } - // Time Stamp - var time = (uint)Math.Truncate(timeStamp * 1e+6f); - packets[index + 1200] = (byte)((time << 24) >> 24); - packets[index + 1201] = (byte)((time << 16) >> 24); - packets[index + 1202] = (byte)((time << 8) >> 24); - packets[index + 1203] = (byte)(time >> 24); - - // Footer - packets[index + 1204] = 0x37; - packets[index + 1205] = 0x22; - } - } - } - */ -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs.meta deleted file mode 100644 index c49cd6da..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/LiDAR/Velodyne/VelodyneMsgSerializer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 15217ef405f8ea5408d1f4f2eee2d916 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/IPointsToPointCloud2MsgJob.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/IPointsToPointCloud2MsgJob.cs deleted file mode 100644 index 9f5fbcbb..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/IPointsToPointCloud2MsgJob.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Unity.Burst; -using Unity.Collections; -using Unity.Jobs; - -using UnitySensors.Data.PointCloud; - -namespace UnitySensors.ROS.Serializer.PointCloud -{ - [BurstCompile] - public struct IPointsToPointCloud2MsgJob : IJobParallelFor - where T : struct, IPointXYZInterface - { - [ReadOnly] - public NativeArray points; - - public NativeArray data; - - public void Execute(int index) - { - NativeArray tmp = new NativeArray(3, Allocator.Temp); - tmp[0] = points[index].position.z; - tmp[1] = -points[index].position.x; - tmp[2] = points[index].position.y; - var slice = new NativeSlice(tmp).SliceConvert(); - slice.CopyTo(data.GetSubArray(index * 12, 12)); - - } - } -} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/PointCloud2MsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/PointCloud2MsgSerializer.cs deleted file mode 100644 index c4341950..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/PointCloud2MsgSerializer.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using Unity.Collections; -using Unity.Jobs; -using RosMessageTypes.Sensor; - -using UnitySensors.Data.PointCloud; -using UnitySensors.Sensor; - -namespace UnitySensors.ROS.Serializer.PointCloud -{ - [System.Serializable] - public class PointCloud2MsgSerializer : RosMsgSerializer - where T : UnitySensor, IPointCloudInterface - where TT : struct, IPointXYZInterface - { - [SerializeField] - private HeaderSerializer _header; - - private JobHandle _jobHandle; - private IPointsToPointCloud2MsgJob _pointsToPointCloud2MsgJob; - private NativeArray _data; - - public override void Init(T sensor) - { - base.Init(sensor); - _header.Init(sensor); - - _msg.height = 1; - _msg.width = (uint)sensor.pointsNum; - _msg.fields = new PointFieldMsg[3]; - for (int i = 0; i < 3; i++) - { - _msg.fields[i] = new PointFieldMsg(); - _msg.fields[i].name = ((char)('x' + i)).ToString(); - _msg.fields[i].offset = (uint)(4 * i); - _msg.fields[i].datatype = 7; - _msg.fields[i].count = 1; - } - _msg.is_bigendian = false; - _msg.point_step = 12; - _msg.row_step = (uint)sensor.pointsNum * 12; - _msg.data = new byte[(uint)sensor.pointsNum * 12]; - _msg.is_dense = true; - - _data = new NativeArray(sensor.pointsNum * 12, Allocator.Persistent); - - _pointsToPointCloud2MsgJob = new IPointsToPointCloud2MsgJob() - { - points = sensor.pointCloud.points, - data = _data - }; - } - - public override PointCloud2Msg Serialize() - { - _msg.header = _header.Serialize(); - _jobHandle = _pointsToPointCloud2MsgJob.Schedule(sensor.pointsNum, 1); - _jobHandle.Complete(); - _pointsToPointCloud2MsgJob.data.CopyTo(_msg.data); - return _msg; - } - - public void Dispose() - { - _jobHandle.Complete(); - if(_data.IsCreated) _data.Dispose(); - } - } -} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose.meta deleted file mode 100644 index 8a2f2a1c..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 91afea264deaeb445a905eda33041ceb -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose/PoseStampedMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose/PoseStampedMsgSerializer.cs deleted file mode 100644 index d66cb81f..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Pose/PoseStampedMsgSerializer.cs +++ /dev/null @@ -1,31 +0,0 @@ -using UnityEngine; - -using Unity.Robotics.ROSTCPConnector.ROSGeometry; -using RosMessageTypes.Geometry; - -using UnitySensors.Data.Pose; -using UnitySensors.Sensor; - -namespace UnitySensors.ROS.Serializer.PoseStamped -{ - [System.Serializable] - public class PoseStampedMsgSerializer : RosMsgSerializer where T : UnitySensor, IPoseInterface - { - [SerializeField] - private HeaderSerializer _header; - - public override void Init(T sensor) - { - base.Init(sensor); - _header.Init(sensor); - } - - public override PoseStampedMsg Serialize() - { - _msg.header = _header.Serialize(); - _msg.pose.position = sensor.transform.position.To(); - _msg.pose.orientation = sensor.transform.rotation.To(); - return _msg; - } - } -} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs.meta new file mode 100644 index 00000000..6e211911 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88cae70b467ca5e4b9ef00b058a6a895 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CameraInfoMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CameraInfoMsgSerializer.cs new file mode 100644 index 00000000..e54587b1 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CameraInfoMsgSerializer.cs @@ -0,0 +1,35 @@ +using UnityEngine; +using Unity.Robotics.ROSTCPConnector.MessageGeneration; +using RosMessageTypes.Sensor; + +using UnitySensors.Attribute; +using UnitySensors.Interface.Sensor; +using UnitySensors.ROS.Serializer.Std; + +namespace UnitySensors.ROS.Serializer.Sensor +{ + [System.Serializable] + public class CameraInfoMsgSerializer : RosMsgSerializer + { + [SerializeField, Interface(typeof(ICameraInterface))] + private Object _source; + + [SerializeField] + private HeaderSerializer _header; + + private ICameraInterface _sourceInterface; + + public override void Init() + { + base.Init(); + _header.Init(); + _sourceInterface = _source as ICameraInterface; + } + + public override CameraInfoMsg Serialize() + { + _msg = CameraInfoGenerator.ConstructCameraInfoMessage(_sourceInterface.m_camera, _header.Serialize()); + return _msg; + } + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera/CameraInfoMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CameraInfoMsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Camera/CameraInfoMsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CameraInfoMsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CompressedImageMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CompressedImageMsgSerializer.cs new file mode 100644 index 00000000..11dc8844 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CompressedImageMsgSerializer.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +using RosMessageTypes.Sensor; + +using UnitySensors.Attribute; +using UnitySensors.Interface.Sensor; +using UnitySensors.ROS.Serializer.Std; + +namespace UnitySensors.ROS.Serializer.Sensor +{ + [System.Serializable] + public class CompressedImageMsgSerializer : RosMsgSerializer + { + private enum SourceTexture + { + Texture0, + Texture1 + } + + [SerializeField, Interface(typeof(ITextureInterface))] + private Object _source; + [SerializeField] + private SourceTexture _sourceTexture; + + [SerializeField] + private HeaderSerializer _header; + [SerializeField, Range(1, 100)] + private int quality = 75; + + private ITextureInterface _sourceInterface; + + public override void Init() + { + base.Init(); + _header.Init(); + _sourceInterface = _source as ITextureInterface; + _msg.format = "jpeg"; + } + + public override CompressedImageMsg Serialize() + { + _msg.header = _header.Serialize(); + _msg.data = (_sourceTexture == SourceTexture.Texture0 ? _sourceInterface.texture0 : _sourceInterface.texture1).EncodeToJPG(quality); + return _msg; + } + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image/ImageMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CompressedImageMsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Image/ImageMsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/CompressedImageMsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IInvertXJob.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IInvertXJob.cs new file mode 100644 index 00000000..7acc2f4c --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IInvertXJob.cs @@ -0,0 +1,20 @@ +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; + +namespace UnitySensors.ROS.Serializer.PointCloud +{ + [BurstCompile] + public struct IInvertXJob : IJobParallelFor + { + public int pointStep; + + [NativeDisableParallelForRestriction] + public NativeArray data; + + public void Execute(int index) + { + data[index * pointStep + 3] += 128; + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/IPointsToPointCloud2MsgJob.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IInvertXJob.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/IPointsToPointCloud2MsgJob.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IInvertXJob.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IMUMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IMUMsgSerializer.cs new file mode 100644 index 00000000..95a4fafd --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IMUMsgSerializer.cs @@ -0,0 +1,37 @@ +using UnityEngine; +using Unity.Robotics.ROSTCPConnector.ROSGeometry; +using RosMessageTypes.Sensor; + +using UnitySensors.Attribute; +using UnitySensors.Interface.Sensor; +using UnitySensors.ROS.Serializer.Std; + +namespace UnitySensors.ROS.Serializer.Sensor +{ + [System.Serializable] + public class IMUMsgSerializer : RosMsgSerializer + { + [SerializeField, Interface(typeof(IImuDataInterface))] + private Object _source; + [SerializeField] + private HeaderSerializer _header; + + private IImuDataInterface _sourceInterface; + + public override void Init() + { + base.Init(); + _header.Init(); + _sourceInterface = _source as IImuDataInterface; + } + + public override ImuMsg Serialize() + { + _msg.header = _header.Serialize(); + _msg.linear_acceleration = _sourceInterface.acceleration.To(); + _msg.orientation = _sourceInterface.rotation.To(); + _msg.angular_velocity = _sourceInterface.angularVelocity.To(); + return _msg; + } + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU/IMUMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IMUMsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/IMU/IMUMsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/IMUMsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NavSatFixMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/NavSatFixMsgSerializer.cs similarity index 57% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NavSatFixMsgSerializer.cs rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/NavSatFixMsgSerializer.cs index 1ded6c95..12a84c82 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NavSatFixMsgSerializer.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/NavSatFixMsgSerializer.cs @@ -1,11 +1,14 @@ using UnityEngine; using RosMessageTypes.Sensor; -using UnitySensors.Sensor.GNSS; -namespace UnitySensors.ROS.Serializer.GNSS +using UnitySensors.Attribute; +using UnitySensors.Interface.Geometry; +using UnitySensors.ROS.Serializer.Std; + +namespace UnitySensors.ROS.Serializer.Sensor { [System.Serializable] - public class NavSatFixMsgSerializer : RosMsgSerializer + public class NavSatFixMsgSerializer : RosMsgSerializer { private enum Status { @@ -23,6 +26,8 @@ private enum Service GALILEO } + [SerializeField, Interface(typeof(IGeoCoordinateInterface))] + private Object _source; [SerializeField] private HeaderSerializer _header; @@ -31,10 +36,13 @@ private enum Service [SerializeField] private Service _service = Service.GPS; - public override void Init(GNSSSensor sensor) + private IGeoCoordinateInterface _sourceInterface; + + public override void Init() { - base.Init(sensor); - _header.Init(sensor); + base.Init(); + _header.Init(); + _sourceInterface = _source as IGeoCoordinateInterface; _msg.status = new NavSatStatusMsg(); _msg.status.service = (ushort)Mathf.Pow(2, (int)(_service)); @@ -44,9 +52,9 @@ public override NavSatFixMsg Serialize() { _msg.header = _header.Serialize(); _msg.status.status = (sbyte)((int)(_status) - 1); - _msg.latitude = sensor.coordinate.latitude; - _msg.longitude = sensor.coordinate.longitude; - _msg.altitude = sensor.coordinate.altitude; + _msg.latitude = _sourceInterface.coordinate.latitude; + _msg.longitude = _sourceInterface.coordinate.longitude; + _msg.altitude = _sourceInterface.coordinate.altitude; _msg.position_covariance_type = 0; return _msg; } diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NavSatFixMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/NavSatFixMsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/GNSS/NavSatFixMsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/NavSatFixMsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/PointCloud2MsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/PointCloud2MsgSerializer.cs new file mode 100644 index 00000000..fae25d77 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/PointCloud2MsgSerializer.cs @@ -0,0 +1,82 @@ +using UnityEngine; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Jobs; +using RosMessageTypes.Sensor; + +using UnitySensors.Interface.Sensor; +using UnitySensors.Interface.Sensor.PointCloud; +using UnitySensors.Utils.PointCloud; +using UnitySensors.ROS.Serializer.Std; +using UnitySensors.ROS.Utils.PointCloud; + +namespace UnitySensors.ROS.Serializer.PointCloud +{ + [System.Serializable] + public class PointCloud2MsgSerializer : RosMsgSerializer where T : struct, IPointInterface + { + [SerializeField] + private HeaderSerializer _header; + + protected IPointCloudInterface _sourceInterface; + private int _pointsNum; + + private JobHandle _jobHandle; + private IInvertXJob _invertXJob; + private NativeArray _data; + + public void SetSource(IPointCloudInterface sourceInterface) + { + _sourceInterface = sourceInterface; + } + + public override void Init() + { + base.Init(); + _header.Init(); + + _pointsNum = _sourceInterface.pointCloud.points.Length; + int sizeOfPoint = PointUtilities.pointDataSizes[typeof(T)]; + int dataSize = _pointsNum * sizeOfPoint; + + _msg.height = 1; + _msg.width = (uint)_pointsNum; + _msg.fields = PointUtilitiesROS.pointFields[typeof(T)]; + _msg.is_bigendian = true; + _msg.point_step = (uint)sizeOfPoint; + _msg.row_step = (uint)dataSize; + _msg.data = new byte[dataSize]; + _msg.is_dense = true; + + _data = new NativeArray(dataSize, Allocator.Persistent); + + _invertXJob = new IInvertXJob() + { + pointStep = sizeOfPoint, + data = _data + }; + } + + public override PointCloud2Msg Serialize() + { + _msg.header = _header.Serialize(); + + unsafe + { + UnsafeUtility.MemCpy(NativeArrayUnsafeUtility.GetUnsafePtr(_data), NativeArrayUnsafeUtility.GetUnsafePtr(_sourceInterface.pointCloud.points), _data.Length); + } + _jobHandle = _invertXJob.Schedule(_pointsNum, 1); + _jobHandle.Complete(); + + _data.CopyTo(_msg.data); + + return _msg; + } + + public override void OnDestroy() + { + _jobHandle.Complete(); + if (_data.IsCreated) _data.Dispose(); + } + } +} \ No newline at end of file diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/PointCloud2MsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/PointCloud2MsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/PointCloud/PointCloud2MsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/SensorMsgs/PointCloud2MsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Serializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Serializer.cs index f1a10701..df21fb94 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Serializer.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Serializer.cs @@ -1,23 +1,16 @@ +using UnityEngine; using Unity.Robotics.ROSTCPConnector.MessageGeneration; -using UnitySensors.Sensor; - namespace UnitySensors.ROS.Serializer { [System.Serializable] - public abstract class RosMsgSerializer where T : UnitySensor where TT : Message, new() + public abstract class RosMsgSerializer where T : Message, new () { - private T _sensor; - protected T sensor { get => _sensor; } - - protected TT _msg; - - public virtual void Init(T sensor) - { - _sensor = sensor; - _msg = new TT(); - } + protected T _msg; + public T msg { get => _msg; } - public abstract TT Serialize(); + public virtual void Init() { _msg = new T(); } + public abstract T Serialize(); + public virtual void OnDestroy() { } } } diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs.meta new file mode 100644 index 00000000..0037acf0 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 445feb292b0ff6a4287480691ca0d31d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs/HeaderSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs/HeaderSerializer.cs new file mode 100644 index 00000000..4ad1cc30 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs/HeaderSerializer.cs @@ -0,0 +1,50 @@ +using System; +using UnityEngine; +using RosMessageTypes.Std; + +using UnitySensors.Attribute; +using UnitySensors.Interface.Std; + +namespace UnitySensors.ROS.Serializer.Std +{ + [System.Serializable] + public class HeaderSerializer : RosMsgSerializer + { + [SerializeField, Interface(typeof(ITimeInterface))] + private UnityEngine.Object _source; + [SerializeField] + private string _frame_id; + + private ITimeInterface _sourceInterface; + + public override void Init() + { + base.Init(); + _sourceInterface = _source as ITimeInterface; + + _msg = new HeaderMsg(); + + _msg.frame_id = _frame_id; +#if ROS2 +#else + _msg.seq = 0; +#endif + } + + public override HeaderMsg Serialize() + { +#if ROS2 + int sec = (int)Math.Truncate(_sourceInterface.time); +#else + uint sec = (uint)Math.Truncate(_sourceInterface.time); +#endif + _msg.stamp.sec = sec; + _msg.stamp.nanosec = (uint)((_sourceInterface.time - sec) * 1e+9); +#if ROS2 +#else + _msg.seq++; +#endif + return _msg; + } + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/HeaderSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs/HeaderSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/HeaderSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/StdMsgs/HeaderSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF.meta deleted file mode 100644 index 192c46ec..00000000 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c092a0b613d2d094699154ff5618ce4c -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs.meta new file mode 100644 index 00000000..1a70e699 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b9620d3b4b3b1b4a80d14375fb44b02 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs/TFMessageMsgSerializer.cs similarity index 76% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs/TFMessageMsgSerializer.cs index 8aed1c84..bc1163c6 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs/TFMessageMsgSerializer.cs @@ -8,21 +8,23 @@ using RosMessageTypes.Tf2; using UnitySensors.Sensor.TF; +using UnitySensors.ROS.Serializer.Std; -namespace UnitySensors.ROS.Serializer.TF +namespace UnitySensors.ROS.Serializer.Tf2 { - using TFSensor = Sensor.TF.TF; [System.Serializable] - public class TFMsgSerializer : RosMsgSerializer + public class TFMessageMsgSerializer : RosMsgSerializer { + [SerializeField] + private TFLink _source; [SerializeField] private HeaderSerializer _header; - public override void Init(TFSensor sensor) + public override void Init() { - base.Init(sensor); - _header.Init(sensor); + base.Init(); + _header.Init(); } public override TFMessageMsg Serialize() @@ -30,7 +32,7 @@ public override TFMessageMsg Serialize() HeaderMsg headerMsg = _header.Serialize(); List transforms = new List(); - TFData[] tfData = sensor.GetTFData(); + TFData[] tfData = _source.GetTFData(); foreach(TFData data in tfData) { TransformStampedMsg transform = new TransformStampedMsg(); diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs/TFMessageMsgSerializer.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Serializers/Tf2Msgs/TFMessageMsgSerializer.cs.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud.meta new file mode 100644 index 00000000..16f40779 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6abf9bbc002bc7249875f1501fedd189 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs new file mode 100644 index 00000000..8d17e049 --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +using RosMessageTypes.Sensor; + +using UnitySensors.DataType.Sensor.PointCloud; + +namespace UnitySensors.ROS.Utils.PointCloud +{ + public static class PointUtilitiesROS + { + public readonly static ReadOnlyDictionary pointFields = new ReadOnlyDictionary(new Dictionary + { + { + typeof(PointXYZ), + new PointFieldMsg[] + { + new PointFieldMsg("y", 0, 7, 1), + new PointFieldMsg("z", 4, 7, 1), + new PointFieldMsg("x", 8, 7, 1), + } + }, + { + typeof(PointXYZI), + new PointFieldMsg[] + { + new PointFieldMsg("y", 0, 7, 1), + new PointFieldMsg("z", 4, 7, 1), + new PointFieldMsg("x", 8, 7, 1), + new PointFieldMsg("intensity", 12, 7, 1), + } + }, + { + typeof(PointXYZRGB), + new PointFieldMsg[] + { + new PointFieldMsg("y", 0, 7, 1), + new PointFieldMsg("z", 4, 7, 1), + new PointFieldMsg("x", 8, 7, 1), + new PointFieldMsg("rgba", 12, 6, 1) + } + } + }); + } +} diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs.meta new file mode 100644 index 00000000..cb342fee --- /dev/null +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/PointCloud/PointUtilitiesROS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1eded8d2d6ed9154e947c46f3bba56d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time.meta diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock/ROSClock.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time/ROSClock.cs similarity index 81% rename from Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock/ROSClock.cs rename to Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time/ROSClock.cs index ecbc55ae..12653031 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock/ROSClock.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time/ROSClock.cs @@ -4,7 +4,7 @@ using Unity.Robotics.ROSTCPConnector; using RosMessageTypes.Rosgraph; -namespace UnitySensors.ROS.Publisher +namespace UnitySensors.ROS.Utils.Time { public class ROSClock : MonoBehaviour { @@ -14,7 +14,7 @@ public class ROSClock : MonoBehaviour private ROSConnection _ros; private ClockMsg _message; - void Start() + private void Start() { this._ros = ROSConnection.GetOrCreateInstance(); @@ -25,11 +25,11 @@ void Start() this._message.clock.nanosec = 0; } - void Update() + private void Update() { - float time = Time.time; + float time = UnityEngine.Time.time; #if ROS2 - int sec = (int)Math.Truncate(time); + int sec = (int)Math.Truncate(time); #else uint sec = (uint)Math.Truncate(time); #endif diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock/ROSClock.cs.meta b/Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time/ROSClock.cs.meta similarity index 100% rename from Assets/UnitySensorsROS/Runtime/Scripts/Utils/Clock/ROSClock.cs.meta rename to Assets/UnitySensorsROS/Runtime/Scripts/Utils/Time/ROSClock.cs.meta diff --git a/Assets/UnitySensorsROS/Samples/TF.meta b/Assets/UnitySensorsROS/Samples/TF.meta deleted file mode 100644 index 1ca4ad7c..00000000 --- a/Assets/UnitySensorsROS/Samples/TF.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 55b2adbf850448d45afda235a8f2ea87 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/UnitySensorsROS/Samples/TF/TF.unity b/Assets/UnitySensorsROS/Samples/TF/TF.unity deleted file mode 100644 index 3e7a405c..00000000 --- a/Assets/UnitySensorsROS/Samples/TF/TF.unity +++ /dev/null @@ -1,729 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 0} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1001 &270305095 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 6235299019127333997, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_Name - value: SimpleEnv - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6235299019127333998, guid: 56564b72d282a2046835e0629759e128, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 56564b72d282a2046835e0629759e128, type: 3} ---- !u!1001 &302656453 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 304106766} - m_Modifications: - - target: {fileID: 3835360430879934882, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_Name - value: VLP-16_ros - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.536 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalPosition.z - value: -0.02 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: d7ba18bcf853116459c3becb08f01c65, type: 3} ---- !u!4 &302656454 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 3835360430879934884, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - m_PrefabInstance: {fileID: 302656453} - m_PrefabAsset: {fileID: 0} ---- !u!1 &304106762 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 304106766} - - component: {fileID: 304106765} - - component: {fileID: 304106764} - - component: {fileID: 304106763} - - component: {fileID: 304106768} - - component: {fileID: 304106767} - - component: {fileID: 304106769} - - component: {fileID: 304106770} - m_Layer: 0 - m_Name: Base_link - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!65 &304106763 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &304106764 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &304106765 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &304106766 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.82, y: 0.11, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1983887110} - - {fileID: 302656454} - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &304106767 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cde12085c739d548a159c84b40bbd2a, type: 3} - m_Name: - m_EditorClassIdentifier: - _frequency: 10 - _serializer: - _msg: - transforms: [] - _topicName: /tf ---- !u!114 &304106768 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 60a6512c6d49c2244a1a77e382c678b1, type: 3} - m_Name: - m_EditorClassIdentifier: - _frequency: 10 - frame_id: - _children: - - {fileID: 1983887115} - - {fileID: 1891329943} ---- !u!114 &304106769 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 89775f84ec1b05048997be0d603cca35, type: 3} - m_Name: - m_EditorClassIdentifier: - axesScale: 0.1 - lineThickness: 0.01 - color: {r: 1, g: 1, b: 1, a: 1} ---- !u!114 &304106770 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 304106762} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0d410a4ef658bc43a5f7617794a8efb, type: 3} - m_Name: - m_EditorClassIdentifier: - _topicName: clock ---- !u!1 &640845642 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 640845644} - - component: {fileID: 640845643} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &640845643 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 640845642} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &640845644 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 640845642} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &949585412 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 949585415} - - component: {fileID: 949585414} - - component: {fileID: 949585413} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &949585413 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 949585412} - m_Enabled: 1 ---- !u!20 &949585414 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 949585412} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &949585415 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 949585412} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1822541744 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 4278881538632891480, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - m_PrefabInstance: {fileID: 1983887109} - m_PrefabAsset: {fileID: 0} ---- !u!1 &1891329939 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 5416862128607984436, guid: d7ba18bcf853116459c3becb08f01c65, - type: 3} - m_PrefabInstance: {fileID: 302656453} - m_PrefabAsset: {fileID: 0} ---- !u!114 &1891329943 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1891329939} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 60a6512c6d49c2244a1a77e382c678b1, type: 3} - m_Name: - m_EditorClassIdentifier: - _frequency: 10 - frame_id: velodyne_link - _children: [] ---- !u!1001 &1983887109 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 304106766} - m_Modifications: - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.391 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalPosition.z - value: 0.626 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4278881538632891480, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - propertyPath: m_Name - value: RGBCamera_ros - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 8ab4d4b2351e5644d9abeaa752110709, type: 3} ---- !u!4 &1983887110 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 4278881538632891476, guid: 8ab4d4b2351e5644d9abeaa752110709, - type: 3} - m_PrefabInstance: {fileID: 1983887109} - m_PrefabAsset: {fileID: 0} ---- !u!114 &1983887115 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1822541744} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 60a6512c6d49c2244a1a77e382c678b1, type: 3} - m_Name: - m_EditorClassIdentifier: - _frequency: 10 - frame_id: camera - _children: []