Skip to content

Setup unity project

Info

It is advised to checkout the Quick Start Demo tutorial before reading this section.

1. Environment preparation

Ubuntu OS is required.

  1. Make sure your machine meets the required hardware specifications.
    • NOTE: PC requirements may vary depending on simulation contents which may change as the simulator develops
  2. Prepare a desktop PC with Ubuntu 22.04 installed.
  3. Install nvidia gpu driver (Skip if already installed).

    1. Add nvidia driver to apt repository.
      sudo add-apt-repository ppa:graphics-drivers/ppa &&
      sudo apt update
      
    2. Install the recommended version of the driver.

      sudo ubuntu-drivers autoinstall
      

      Info

      Version 570 or higher is recommended.

    3. Reboot your machine to make the installed driver detected by the system.

      sudo reboot
      

    4. Open terminal and check if nvidia-smi command is available and outputs summary similar to the one presented below.

      nvidia-smi 
      
      Check result.
      Fri May  2 18:55:24 2025       
      +-----------------------------------------------------------------------------------------+
      | NVIDIA-SMI 570.124.06             Driver Version: 570.124.06     CUDA Version: 12.8     |
      |-----------------------------------------+------------------------+----------------------+
      | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
      | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
      |                                         |                        |               MIG M. |
      |=========================================+========================+======================|
      |   0  NVIDIA GeForce RTX 4090        Off |   00000000:01:00.0  On |                  Off |
      |  0%   45C    P8             25W /  450W |    5920MiB /  24564MiB |      7%      Default |
      |                                         |                        |                  N/A |
      +-----------------------------------------+------------------------+----------------------+
      

  4. Install vulkan graphics library (Skip if already installed).

    1. Update the environment.
      sudo apt update
      
    2. Install the library.
      sudo apt install libvulkan1
      
  5. Install git (Skip if already installed).

  6. Set the ROS 2 middleware and the localhost only mode in ~/.profile (or, in ~/.bash_profile or ~/bash_login if either of those exists) file:
    export ROS_LOCALHOST_ONLY=1
    export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
    
  7. Set the system optimizations by adding this code to the very bottom of your ~/.bashrc file:
    if [ ! -e /tmp/cycloneDDS_configured ]; then
    sudo sysctl -w net.core.rmem_max=2147483647
    sudo ip link set lo multicast on
    touch /tmp/cycloneDDS_configured
    fi
    
  8. Restart PC.

AWSIM comes with a standalone flavor of Ros2ForUnity. 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.

  • Make sure that the terminal which you are using to run Unity Hub, Editor, or AWSIM doesn't have ROS 2sourced.
  • 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.

2. Unity installation

Info

AWSIM's Unity version is currently 6000.0.34f1

  1. Install UnityHub.
  2. Download Unity 6000.0.34f1 from the download archive.

3. Open AWSIM project

  1. Git clone AWSIM repository.

    git clone git@github.com:tier4/AWSIM.git
    

  2. Open AWSIM project.

    1. Open Unity Hub.
    2. Add -> Add project from disk.
    3. Add and Open AWSIM unity project.

    Info

    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.

    Warning

    If you get the safe mode dialog when starting UnityEditor, you may need to install openssl.

    1. download libssl
      $ wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb
    2. install
      sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb

4. Import external packages

  1. Download Shinjuku.unitypackage

    Download Shinjuku.unitypackage

  2. In Unity Editor, from the menu bar at the top, select Assets -> Import Package -> Custom Package... and navigate the Shinjuku.unitypackage file.

  3. Shinjuku.unitypackage package has been successfully imported under Assets\AWSIM\Externals directory.

    Info

    The Externals directory is added to the .gitignore because the map has a large file size and should not be directly uploaded to the repository.

5. Run the demo in Editor

The following steps describe how to run the demo in Unity Editor:

  1. Open the AutowareSimulationDemo.unity scene placed under Assets/AWSIM/Scenes/ directory.
  2. Run the simulation by clicking Play button placed at the top section of Edtior.