SEAN 2.0
SEAN 2.0
Home Documentation About SEAN Tutorials
Home Documentation About SEAN Tutorials
  • System Architecture
  • Development Setup
  • Communication
  • Unity API
  • ROS Nodes
  • Metrics
  • Unity Navmesh & ROS Map

Setup

Note: The recommended way to run SEAN 2.0 is using Windows to run the Unity component and WSL2 to run ROS. This is because there is a bug with Unity on Ubuntu that prohibits efficient background rendering of virtual cameras. Click here for the windows setup instructions.

This guide will walk you through setting up the simulation environment including Unity and ROS.

Start with Ubuntu 20.04.

Unity Editor

To install the Unity Editor, we need to (1) download Unity Hub, (2) create Unity Account and login, and (3) install the correct Unity Version. Besides our tutorial, you can follow the Unity Getting Started Guide.

Note: If you plan on using an Ubuntu VM, install UnityHub and UnityEditor on the host (outside of the virtual machine). Allow communication between Unity (on the host) and ROS (inside of the VM) by allowing communication between the host and VM on port 10000 in your virtualization software.

Following the guide, run the following command to add the Unity Hub repository:

sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'

To add the public signing key, run the following command:

wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -

Then update the package cache and install the package using:

sudo apt update
sudo apt-get install unityhub
  • If you do not have an account, create a Unity account now.

Note: signing up for a student account, though not required, will give you access to some free assets: https://assetstore.unity.com/browse/student-plan-pack

  • Login to UnityHub.

Note: UnityHub can have trouble when Firefox is set to the default browser on Ubuntu 20.04. Installing the Google Chrome browser can fix this: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt install ./google-chrome-stable_current_amd64.deb. You may also need to set Chrome as the default browser.

Click the 2020.3.48f1 link in the Unity Archive under the Unity 2020.x tab. Accept the popup to allow the link to run via xdg-open and then follow the installation tutorial in Unity Hub.

If prompted, accept the defaults to install Unity and optionally install any target build environments that you may want to build for the future.

Unity Project

  • Clone the unity project—the location of this project is not important, but we'll clone it to the home directory:
git clone --recurse-submodules https://github.com/yale-sean/social_sim_unity.git ~/social_sim_unity

In Unity Hub, add the project you just cloned by clicking the "Add" button. Choose the folder named "social_sim_unity" in the home directory. Once that folder is selected, click the "Ok" button to confirm your selection.

Note: if you are unable to add the project, create a new, blank project by clicking the "New" button, restart Unity Hub, and then try adding social_sim_unity project again

When opening the project for the first time, it is normal that it takes a long time to load all the assets.

ROS Setup

There are two ways to setup ROS: You can either install ROS or use the Docker configuration below.

Install ROS and Use Preconfigured Workspace.

Install by following the ROS Noetic Setup Guide. If you run into any problem or want to learn more about ROS Noetic, see ROS Noetic. Then, you can use the sim_ws as a starting point for your catkin workspace. Start by checking out the repository.

git clone https://github.com/yale-sean/sim_ws ~/sim_ws

Then, run the installer scripts to install all required packages:

cd ~/sim_ws/
./scripts/setup.sh

Note: This script will checkout the code from GitHub and build the workspace for you. If you run into issues, try building the Catkin workspace from scratch and checking out the code manually.

Note: This script runs apt-get update, which sometimes produces an error "the following signatures couldn't be verified because the public key is not available: NO PUBKEY $YOUR-KEY". To fix this, run sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $YOUR-KEY for each missing key (see this post)

After you are done, make sure you add source commands in your .bashrc file so ROS knows where your installed ROS packages are every time you open a terminal:

echo "source /opt/ros/noetic/setup.bash" >> $HOME/.bashrc
echo "source ~/sim_ws/devel/setup.bash" >> $HOME/.bashrc
source $HOME/.bashrc

You will see an error like -bash: $HOME/sim_ws/devel/setup.bash: No such file or directory, which is fine. You can now build the workspace:

cd $HOME/sim_ws
catkin_make

Then you can source the .bashrc file again without error.