You need one of the following:
- (Preferred) a standalone Ubuntu 20.04 system on your PC
- A Ubuntu 20.04 virtual machine on your Windows or MacOS system.
If you only have access to a Ubuntu 18.04 machine, You need to proceed with method 3.
Steps:
- Install ROS2 Galactic via Debian Packages. Install desktop version where hinted.
- Install Colcon:
sudo apt update && sudo apt install python3-colcon-common-extensions
. - Fork the repository on GitHub.
- Clone your folk:
git clone <url_to_your_folk>
. Cloning with SSH is easier when pushing, but you need to set up SSH key first - Install ROS2 dependencies:
sudo apt install python3-pip
pip install opencv-python
source /opt/ros/galactic/setup.bash
cd Triton-AI-Racer-ROS2
rosdep update
rosdep install --from-paths src --ignore-src -y -r
- Build:
source /opt/ros/galactic/setup.bash
cd Triton-AI-Racer-ROS2 # If you haven't done so
colcon build
The recommanded editor for Ubuntu is Visual Studio Code. It has handy ROS extension for handling ROS dependencies for intellisense.
With the latest WSL2 shipped with Windows 11 or Windows 10 Preview, you can now run Linux GUI apps natively on Windows, bringing back your favourite apps such as RVIZ2 and RQT, powerful ROS2 visualization tools.
This method is recommended if you enjoy working with Windows, or if your PC does not have enough space for a virtual machine.
IMPORTANT: As of now WSL2 does not support USB device passthrough, so you cannot connect Joystick or VESC to it. In addition, networking in WSL2 is funky at the moment (which only does NAT through virtual switch), making it hard to run ROS across multiple devices. For example, it is hard to run a joystick node on another machine and listen to it in WSL.
Steps:
- Follow WSL2 GUI tutorial to install Ubuntu and GUI support
- Following method 1 in your Linux subsystem.
- Execute
rviz2
and expect a Linux GUI to show up in Windows. Weird.
The best editor for WSL2 is Visual Studio Code. Install it in Windows and you can connect to your Linux subsystem, work on files, and install extension for ROS, Python, and C++ in it.
This method is only recommended if the aforementioned two methods do not work for you, or you are on a Ubuntu 18.04 machine that is hard to go to 20.04 (like Jetson as of December 2021).
Triton-AI-Racer-ROS2 does use docker for deployment. Using it for devop is advised if you do not want to mess up with your system and Python packages and prefer a consistent developing environment.
Steps:
- Install docker.
- Prepare a dockerfile with the installation scripts.
- Build the container.
- Run and mount your local src folder into the src folder in the container. This way your source code changes are non-volatile.
If you are not familiar with the concepts above, be careful with this method.
The best editor for docker is Visual Studio Code. You can connect to your container, work on files, and install extension for ROS, Python, and C++ in it.
Method | Performance | USB Devices | Space Requirement | Advantages |
---|---|---|---|---|
On native Ubuntu | Fast | Yes | New disk partition < 40GB | Performing, most compatable |
In Ubuntu VM | Slow | Yes | A Ubuntu VM < 40GB | Works with Windows / MacOS |
WSL2 | Fair | No | A Ubuntu Distro < 10GB | Lightweight, HW accel GUI |
Docker in Ubuntu | Fair | Yes | A Ubuntu Image < 5GB | Consistent environment |