diff --git a/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs b/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs index 197a4a282..d0a07863b 100644 --- a/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs +++ b/Assets/RGLUnityPlugin/Scripts/LowLevelWrappers/RGLNativeAPI.cs @@ -166,8 +166,14 @@ public static extern int rgl_node_points_udp_publish( 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 { diff --git a/docs/Components/ROS2/ROS2ForUnity/index.md b/docs/Components/ROS2/ROS2ForUnity/index.md index 07f494f87..db823cd83 100644 --- a/docs/Components/ROS2/ROS2ForUnity/index.md +++ b/docs/Components/ROS2/ROS2ForUnity/index.md @@ -21,7 +21,10 @@ All required dependencies are installed and can be used e.g. as a complete set o Only asset libraries and generated messages are installed therefore *ROS2* instance must be sourced. By default, asset `R2FU` in *AWSIM* is prepared in *standalone mode*. -Thanks to this, *ROS2* instance doesn't need to be sourced - all you have to do is run the *Unity* editor. + +!!! warning + + To avoid internal conflicts between the standalone libraries, and sourced ones, *ROS2* instance shouldn't be sourced before running AWSIM or the *Unity* Editor. !!! question "Can't see topics" There are no errors but I can't see topics published by `R2FU` diff --git a/docs/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.md b/docs/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.md index b4a28253c..739e62aae 100644 --- a/docs/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.md +++ b/docs/Components/Traffic/RandomTraffic/RandomTrafficSimulator/index.md @@ -29,8 +29,6 @@ The following section describes Unity Editor components settings. | Ego Vehicle | Transform of ego vehicle | | Vehicle Layer Mask | LayerMask that masks only vehicle(NPC and ego) colliders | | Ground Layer Mask | LayerMask that masks only ground colliders of the map | -| Culling Distance | Distance at which NPCs are culled relative to EgoVehicle | -| Culling Hz | Culling operation cycle | | **NPC Vehicle Settings** | | | Max Vehicle Count | Maximum number of NPC vehicles to be spawned in simulation| | NPC Prefabs | Prefabs representing controlled vehicles.
They must have `NPCVehicle` component attached. | diff --git a/docs/GettingStarted/SetupUnityProject/index.md b/docs/GettingStarted/SetupUnityProject/index.md index 0862f1bf3..02207333c 100644 --- a/docs/GettingStarted/SetupUnityProject/index.md +++ b/docs/GettingStarted/SetupUnityProject/index.md @@ -43,6 +43,24 @@ This page is a tutorial for setting up a AWSIM Unity project. 2. Prepare a desktop PC with Windows 10 or 11 (64 bit) installed. 3. Install [git](https://git-scm.com/). +### ROS 2 + +AWSIM comes with a *standalone* flavor of [`Ros2ForUnity`](../../Components/ROS2/ROS2ForUnity/index.md). This means that, to avoid internal conflicts between different ROS 2 versions, you shouldn't run the Editor or AWSIM binary with ROS 2 sourced. + +!!! warning + + Do not run the AWSIM, Unity Hub, or the Editor with ROS 2 sourced. + +=== "Ubuntu 22" + - Make sure that the terminal which you are using to run Unity Hub, Editor, or AWSIM doesn't have ROS 2 sourced. + - It is common to have ROS 2 sourced automatically with `~/.bashrc` or `~/.profile`. Make sure it is not obscuring your working environment: + - Running Unity Hub from the Ubuntu GUI menu takes the environment configuration from `~/.profile`. + - Running Unity Hub from the terminal uses the current terminal configuration from `~/.profile` and `~/.bashrc`. + - Running Unity Editor from the UnityHub inherits the environment setup from the Unity Hub. + +=== "Windows" + - Make sure your Windows environment variables are ROS 2 free. + ### Unity installation !!! info @@ -78,7 +96,7 @@ Follow the steps below to install Unity on your machine: To open the Unity AWSIM project in Unity Editor: === "Using Unity Hub" - 1. Make sure you have the AWSIM repository cloned + 1. Make sure you have the AWSIM repository cloned and ROS 2 is not sourced. ``` git clone git@github.com:tier4/AWSIM.git ``` @@ -93,21 +111,21 @@ To open the Unity AWSIM project in Unity Editor: If you are launching the Unity Hub from the Ubuntu applications menu (without the terminal), make sure that system optimizations are set. To be sure, run the terminal at least once before running the Unity Hub. This will apply the OS settings. 3. Open the project in UnityHub - - Click the `Open` button - ![](image_6.png) + - Click the `Open` button + ![](image_6.png) - - Navigate the directory where the AWSIM repository was cloned to - ![](image_7.png) + - Navigate the directory where the AWSIM repository was cloned to + ![](image_7.png) - - The project should be added to `Projects` tab in Unity Hub. To launch the project in Unity Editor simply click the `AWSIM` item - ![](image_8.png) + - The project should be added to `Projects` tab in Unity Hub. To launch the project in Unity Editor simply click the `AWSIM` item + ![](image_8.png) - - The project is now ready to use - ![](image_9.png) + - The project is now ready to use + ![](image_9.png) === "Using Terminal" - 1. Enter the AWSIM directory + 1. Enter the AWSIM directory (make sure ROS 2 is not sourced). ``` cd AWSIM ```