-
Notifications
You must be signed in to change notification settings - Fork 1
Simulation
The entirety of the Driverless project relies on a simulation for testing the validity of algorithms. It is obvious that real-world testing and tuning will be required. However, simulations provide a great starting point both for new members to learn about Driverless and a way for senior members to quickly prototype new functionality to the driverless project.
Currently, MFE Driverless operates using two simulators:
- FS-Driverless-Simulator from the Formula Student community
- IPG CarMaker (currently under development)
To learn more about each, click on the links attached to them.
FS-Driverless-Simulator Basics and Setup
The Formula-Student community spent years getting an Unreal Engine simulation which works with ROS & ROS2. This is great for us because the MFE Driverless architecture stack is built on top of ROS2 middleware (DDS). The simulator can directly insert topic data into the ROS2 middleware layer, and the rest of our autonomous code and receive data and operate on it.
OS Requirements:
Windows 10+-
Ubuntu 22.04 LTSor aboveLTSversions
We recommend installing the binaries for your desired operating system. You have the option of building the sim from source, but we don't recommend this option as this takes lots of space and configuration. To install using binaries follow these following steps:
-
Clone our fork repository of the sim from here. Make sure you clone the repo at your root folder
~/. The simulator operates on absolute paths for configuration. This is an oversight from the developers, but pretty easy to work around. Thesettings.jsonfile describes the configuration for the car and sensors. -
Install the pre-existing binaries from here. Drag & drop the contents of the extracted file into the repo you cloned earlier.
-
At this point, your repository at
~/Formula-Student-Driverless-Simulatorwill look like (for Linux users). For Windows users, you will have a different executable instead ofFSDS.sh
.
├── AirSim
├── config
├── docker
├── docs
├── Engine
├── FSDS.sh
├── FSOnline
├── LICENSE
├── Manifest_NonUFSFiles_Linux.txt
├── maps
├── mkdocs.yml
├── operator
├── python
├── README.md
├── ros
├── ros2
├── settings.json
├── simulator
└── UE4Project- Verify that you have ROS2 installed first in your computer (sorry, Windows users). If not verify that you at least have a Docker container with ROS2 installed. If you are using a Docker container, perform the following steps in your Docker container.
- Side note for Docker users: Clone the our fork repo in the root of your Docker container as well. This
/ros2workspace in the repository is crucial when setting up the bridge between the sim and the rest of our code.
-
Execute
colcon build --symlink-installwhile in the root project directory of the simulator. This will create a/installfolder where you can source important commands from. -
Run
source /ros2/install/setup.bashto source the important message definitions for the simulator to pass data. -
Linux Users, execute
chmod +x ./FSDS.shto give your user permissions to run the sim then,./FSDS.sh. For windows users, runFSDS.exe. You should have the simulator running now. -
Run
ros2 run fsds_ros2_bridge fsds_ros2_bridge manual_node:=true, which will connect a bridge with the simulator. Make sure you are in the game in the simulator and not just the menu. Select a random map to get started. -
Congrats, your sensor data should be in the ROS2 DDS layer. You can now launch your ROS2 code (in the same environment) to process incoming sensor data!