Instructions to build standalone executable
When a terminal is mentioned, it refers to:
cmd.exe
on Windows
Terminal
on Ubuntu
-
Download and Install Unity Hub
- Ubuntu: You may need to allow the downloaded AppImage to be run as an executable
- Right-click the AppImage
- Select
Properties
- Go to the
Permissions
tab - Check
Allow executing file as program
- Alternatively, in the terminal run
sudo chmod +x UnityHub.AppImage
- Ubuntu: You may need to allow the downloaded AppImage to be run as an executable
-
Download and Install Unity 2019.3.3f1 from the Unity Download Archive:
- IMPORTANT include Mono support for both Windows and Linux when installing Unity
- (Optional) include support for Visual Studio for easier debugging
- Windows
- Click the
Unity Hub
button to have Unity Hub handle the installation process
- Click the
- Ubuntu
- Right click the
Unity Hub
button and selectCopy Link Address
- In a terminal, type
<PATH_TO_UNITY_HUB> <COPIED_LINK>
- The copied link will be in the form
unityhub://Unity-VERSION/XXXXXX
(e.g.unityhub://2019.3.3f1/7ceaae5f7503
) - Thus, if the Unity Hub application is in the current directory, type
./UnityHub.AppImage unityhub://2019.3.3f1/7ceaae5f7503
- The copied link will be in the form
- Unity Hub will open and guide you through the installation of Unity Editor
- Right click the
- Verify installation
- Under the
Installs
tab ofUnity Hub
there should be the expected version shown. In the bottom-left corner of the version, there should be an icon of the other OS (e.g. on a Linux computer, the Windows logo will be shown)
- Under the
-
Download and Install Node.js
- Version 12.16.1 LTS is fine
- Windows
- Download and run the
.msi
- Download and run the
- Ubuntu
- The instructions are from the NodeJS Github
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
- The instructions are from the NodeJS Github
- Verify installation
- Open a terminal and type
node --version
v12.16.1
should print out
- Open a terminal and type
-
Make sure you have git-lfs installed before cloning the Simulator repository.
- Instructions for installation are here
- Verify installation
- In a terminal enter
git lfs install
> Git LFS initialized.
should print out
- In a terminal enter
-
Clone simulator from GitHub
- Open a terminal and navigate to where you want the Simulator to be downloaded to
- e.g. If you want the Simulator in your
Documents
folder, usecd
in the terminal so that the input for the terminal is similar to/Documents$
- e.g. If you want the Simulator in your
git clone --single-branch https://github.com/lgsvl/simulator.git
- Verify download
- The
git clone
will create aSimulator
folder - Open a File Explorer and navigate to where the
Simulator
folder is - Navigate to
Simulator/Assets/Materials/EnvironmentMaterials/
- There should be a
EnvironmentDamageAlbedo.png
in this folder - Open the image, it should be a mostly grey square that looks like concrete
- If the image cannot be opened,
Git LFS
was not installed before cloning the repository- Install
Git LFS
following step 4 - In a terminal, navigate to the
Simulator
folder so that the terminal is similar to/Simulator$
git lfs pull
- Check the image again
- Install
- The
- Open a terminal and navigate to where you want the Simulator to be downloaded to
-
Run Unity Hub
-
In the
Projects
tab, clickAdd
and select theSimulator
folder that was created bygit clone
in Step 5 -
In the
Projects
tab, verify that the Simulator is using Unity Version 2019.3.3f1 from the dropdown -
Double-click the name of the project to launch Unity Editor
-
Open a terminal and navigate to the
WebUI
folder of the Simulator project- Window ex.
C:\Users\XXX\Documents\Simulator\WebUI
- Linux ex.
/home/XXX/Projects/Simulator/WebUI
- Window ex.
-
In the terminal run
npm install
to install dependencies, do this only once or if dependencies change inside packages.json file- The output will be similar to below
-
In Unity Editor run
Build WebUi...
inUnity
:Simulator
->Build WebUI...
-
Open
Build...
inUnity
:Simulator
->Build...
-
Check the Environments, Vehicles, and Sensors that should be generated as AssetBundles
- The
Simulator
repository does not contain any Environments, Vehicles, or Sensors. They are separate repositories on GitHub - See assets documentation for information on how to add Environments and Vehicles
- They will be located in a folder called
AssetBundles
in the folder selected as the build location - These may also be built separately from the Simulator. In this case they will be put into
Simulator/AssetBundles
folder of the project
- The
-
(Optional) Click
Build
to only build the AssetBundles. Load theLoaderScene.unity
and click the Play button at the top of the editor to start the simulator. -
Select the
Target OS
for the build- This is only used when building the Simulator. AssetBundles are built for Linux and Windows automatically
-
Verify
Build Simulator
is checked for the Simulator to be built -
Select a folder that the simulator will be built in
-
(Optional) Check
Development Build
to create a Development Build -
Click
Build
- NOTE You will get an error when building AssetBundles if either Windows or Linux support is not installed in Unity
- Open
Unity Hub
and go to theInstalls
tab - Click the vertical 3-dots next to the Unity version of the Simulator
- Click
Add Modules
- Check
Windows Build Support (Mono)
orLinux Build Support (Mono)
- Click
Done
- Open
- NOTE You will get an error when building AssetBundles if either Windows or Linux support is not installed in Unity
Test Simulator top#
-
Ubuntu - Install Vulkan userspace library
sudo apt-get install libvulkan1
-
Double-click the
Simulator.exe
that was built -
Select graphics options then press
Ok
-
Click
Open Browser
-
In the Maps tab,
Add new
map with the URL to an environment assetbundle -
ex.
C:\Users\XXX\Desktop\Simulator\AssetBundles\environment_borregasave
-
In the Vehicles tab,
Add new
vehicle with the URL to a vehicle assetbundle -
ex.
C:\Users\XXX\Desktop\Simulator\AssetBundles\vehicle_jaguar2015xe
-
(Optional) Add a keyboard control "sensor" to the vehicle to enable driving
- Click the wrench icon next to the vehicle name
-
In the text box insert
[{"type": "Keyboard Control", "name": "Keyboard Car Control"}]
-
In the Simulations tab,
Add new
simulation with the added map and vehicle -
Press the Play button
-
The Unity window should now show a vehicle in the built environment