From 9090546cdbcfc902dc3c735dbf4fd878656f1fc0 Mon Sep 17 00:00:00 2001 From: Mateusz Szczygielski Date: Sat, 23 Sep 2023 21:40:36 +0200 Subject: [PATCH] Warn user if running RGLUnityPlugin with sourced ROS2 --- .../Scripts/LowLevelWrappers/RGLNativeAPI.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs b/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs index f9f7b0082..f215e5ec6 100644 --- a/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs +++ b/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs @@ -151,8 +151,14 @@ public static extern int rgl_node_points_udp_publish_velodyne( static RGLNativeAPI() { string ros2SourcedCodename = Environment.GetEnvironmentVariable("ROS_DISTRO"); - string ros2BuildType = string.IsNullOrEmpty(ros2SourcedCodename) ? "standalone" : "sourced"; - Debug.Log($"RGL uses {ros2BuildType} ROS version."); + bool isRos2Sourced = !string.IsNullOrEmpty(ros2SourcedCodename); + if (isRos2Sourced) + { + Debug.LogError( + "You should not source ROS2 in 'RobotecGPULidar' standalone build. " + + "RGLUnityPlugin might not work correctly." + ); + } try {