Setup of the "ubm-f1tenth" environment
Linux/Mac
If you're on MacOS you'd have to install tigervnc-viewer through the website, otherwise on Linux you can do:
To remove the corrupted configs and restore the docker CLI config to default Run the following command: Now clone the repository and enter its folder. Now we're gonna build our docker environment running the following command: This will take a long time, around 10-30 minutes. You only have to do it once! Now start the docker container. And in as many other terminals as you want to access the simulation run: In one of these terminals bring up the simulation: Now that the simulation is up, you can see it by launching TigerVNC Viewer it will be in your windows apps. Connect to the server: - VNC Server:localhost:5901
- Password: [redacted]
You will see the car and the track!
In another one of the Visual Studio Code terminals start up the control stack:
Windows
For compatibility, it runs within WSL. This is a linux virtual machine provided by Microsoft that runs with near bare metal performance. Open a powershell prompt and install WSL:
To make sure wsl uses Ubuntu as the default distribution: Now open wsl by typing: By default, you are put in a mount on your C: drive. For read/write performance, we will create a folder in your linux home. Now we set up github to clone the repository in this directory using SSH keys, since passwords are deprecated. Press enter to accept the default file location. Set a password.Copy your SSH key: Go to https://github.com/settings/ssh/new and name your key, then paste it and click "Add SSH key". Now you can clone the repo: Install a virtual desktop agent: Do not close the powershell but go back to your Windows desktop, we have Docker Desktop and Visual Studio Code to install: https://docs.docker.com/desktop/install/windows-install/
https://code.visualstudio.com/download
Open Docker Desktop, go to general settings and ensure that "Use the WSL 2 based engine" is checked. Go back to your powershell. Navigate inside the repo and open it in Visual Studio code. This is your development enviroment. Cool! Now to install ROS2 in a docker container, use a new terminal within Visual Studio Code. This ensures it is the correct directory and also in WSL. It's perfectly fine to run this in a new terminal if the vs code one is not working. It might be solved by rebooting. This will take a long time, around ten minutes. You only have to do it once! Now start the docker container. And in as many other terminals as you want to access the simulation: In one of these terminals bring up the simulation: Now that the simulation is up, you can see it by launching TigerVNC Viewer it will be in your windows apps. Connect to the server: - VNC Server:
localhost:5901
- Password: [redacted]
You will see the car and the track!
In another one of the Visual Studio Code terminals start up the control stack:
Useful Information
When to Use colcon build
- After Cloning a New ROS2 Package or Project: If you’ve cloned a new ROS2 package or project into your workspace, run
colcon build
to compile it. - After Modifying Code or Configuration Files: If you make changes to source code or configuration files, you need to recompile using
colcon build
. - After Modifying CMakeLists.txt or package.xml: Any changes to these files require recompilation.
- When Adding New Dependencies: If you add new dependencies, use
colcon build
to update them. - To Perform a Clean Build: Use
colcon build --cmake-clean-cache
to remove the CMake cache and rebuild from scratch.
Command:
colcon build
Useful Options:
--packages-select <package_name>
: to compile only a specific package.
Additional Notes
-
Rebuild Docker Environment: Rebuild the environment only if modifications are made to the
Dockerfile
. -
Change Map: To change the map used in the simulation, modify the
sim.yaml
file located in thef1_tenth_gym_ros
directory. -
Control and Speed Profiles:
- Modify
control.py
only in theTUM_node
. - Create a speed profile (only if it doesn't exist already).
- Adjust lines 21 and 22 in
raceline.py
if needed.
When changing a map change: control.py, raceline.py, f1_tenth_gym_ros/config/sim_yaml, launch_config.yaml