Install the authoring tools
This guide will help you install and set up everything you need to begin testing your vehicle (robot, drone, AV, etc.) in Unity.
Authoring packages
Foundation
The Simulation Foundation package acts as the foundation for all robotic simulations authored in Unity. This package contains all the services and interfaces needed to manage a robotic simulation. Interfaces in this package are service agnostic and can be used to communicate with different services with the same API. The user just need to install the service specific package that implements these interfaces. An example of this can be found in the next section.
This package includes
- Interfaces for communication with external services.
- Message definitions for sending/receiving information with external services.
- Time management functionality to give user granular control of the flow of time in the simulation.
- Visualizations to illustrate different parts of simulation like trajectory and sensor readings
- A transform system to read and visualize coordinate systems from an external source.
- And the ability to send the coordinate information to an external source from Unity.
NOTE The Foundation package should be installed first before the following packages, since it is a root dependency.
ROS Integrations
The ROS Integrations package allows you to communicate with external service called ROS. This package consist of implementation of interfaces present in Foundation that allows user to communicate with ROS using the APIs in Foundation.
Note
While this package facilitates communicating with an existing ROS system, you don't have to use ROS to use any of the other Simulation packages. Simulation sensors and controllers can communicate with any other framework, if necessary.
URDF Importer
The URDF Importer package allows you to import URDF files and then work with them as regular assets in the project folder. Links and joints become reflected as GameObjects with the ArticulationBody components. All mesh formats are supported for the collision and visual meshes. We import materials as well.
Sensors
The Sensors package provides out-of-the-box sensor models as well as tools for creating your own custom sensor models.
Vehicle Controllers
The Vehicle Controllers package contains various controllers for use in your vehicle simulation as well as robot URDF models that are ready to be imported into Unity projects.
System Requirements
Platforms: Ubuntu 18.04, Ubuntu 20.04, Windows 10 x64, Windows 11 x64. Not listed? Please reach out.
Software: Python 2.7 or 3.6+.
Unity on Linux officially supports Nvidia and AMD cards with their recommended drivers.
Important
On Linux, High Definition Render Pipeline (HDRP) projects require using Vulkan.
Create a new project
- Install the Unity Hub; or, if you already have Unity Hub installed, make sure it's updated to the latest release
- Install Unity 2021.3+ from the Unity Hub. If it's no longer available on the hub, download it from the Download Archive
- In the Unity Hub, create a New project and select your installed Unity 2021.3+ version
- In the New project window, download the 3D (HDRP) or 3D (URP) template and once downloaded, select it.
- Create your project with your specified project name and location
Install the authoring packages
The above dependencies are distributed through the Unity Simulation Pro Suite Installer package. Follow the instructions below to download and import the Unity Simulation Pro Suite Installer package. A new Simulation menu will be added to the Unity Editor to select, download, and import the above packages.
You must first email unitysimulationpro@unity3d.com with:
- Your GitHub account - necessary for access to the below repository to download and import the package.
- Your Unity org id - necessary for access to the above packages.
Download the latest Unity Simulation Pro Suite Installer package tarball from the GitHub releases page.
In the Unity Editor, import the Unity Simulation Pro Suite Installer package by navigating to Window > Package Manager > Add package from tarball...
In the file dialog, select the tarball you downloaded.
A new Simulation menu appears in the Unity Editor. It may be necessary to close and re-open the project after importing the package.
Select Simulation > Install Components. A window appears with the available components.
- Select the desired components and select Install Selected.
Important
Install the Foundation package first, since the other packages depend on it.
Set up your project
Configure physics settings
For most Unity Simulation projects, you will need more accuracy than games need. This means changing the solvers and accuracy parameters that PhysX uses.
In the Unity Editor, under Edit > Project Settings... > Physics, modify the following settings:
- Solver Type: Temporal Gauss Seidel. This solver offers a better convergence and a better handling of high-mass ratios and minimizes energy introduced when correcting penetrations. We've found that it fits the simulation use case better than the default solver.
- Sleep Threshold:
0.005
. This is the default sleep threshold, but if you find that your robot tends to slightly drift without stopping on a flat plane without any inputs, increasing this property might help put the robot to "sleep" which would mean it does not try to continuously resolve its position after falling under this specified energy threshold. - Default Solver Iterations:
20
. - Default Solver Velocity Iterations:
6
. Increasing the solver iterations comes with a higher processing time cost, but with higher precision results. Finding a right balance of these iteration counts may differ per each use case.
The other settings can stay at their default values. You can now close the Project Settings window.
Check your project manifest
The Unity Package Manager uses the project manifest to retrieve and load the required list of packages. This file is located at the project's Packages/manifest.json
. You can check whether the Simulation packages are installed by locating the following lines, where <PROJECT_PATH>
refers to the actual path to your project:
"com.unity.simulation.foundation": "file:<PROJECT_PATH>/Library/Temp/com.unity.simulation.foundation/com.unity.simulation.foundation.tgz",
"com.unity.simulation.ros-integrations": "file:<PROJECT_PATH>/Library/Temp/com.unity.simulation.ros-integrations/com.unity.simulation.ros-integrations.tgz",
"com.unity.simulation.sensors": "file:<PROJECT_PATH>/Library/Temp/com.unity.simulation.sensors/com.unity.simulation.sensors.tgz",
"com.unity.simulation.urdf-importer": "file:<PROJECT_PATH>/Library/Temp/com.unity.simulation.urdf-importer/com.unity.simulation.urdf-importer.tgz",
"com.unity.simulation.vehicle-controllers": "file:<PROJECT_PATH>/Library/Temp/com.unity.simulation.vehicle-controllers/com.unity.simulation.vehicle-controllers.tgz",