...
Some computer models won’t work perfectly right away (especially graphics cards) so you may have to do some extra setup. Below are some common models with special setup instructions
- Dell XPS 15 9570
- Must disable windows safe boot and change SATA mode to AHCI before install!
- Post install Script (installs proper drivers for GPU, makes things run better)
- Run post install script from https://github.com/JackHack96/dell-xps-9570-ubuntu-respin
- Note that you must install curl (“sudo apt install curl”)
- The provided command requires “sudo “to be added to the start
- Must disable windows safe boot and change SATA mode to AHCI before install!
- Post install Script (installs proper drivers for GPU, makes things run better)
- Microsoft Surface Series 7kb1ky
- guide
- installing
- linux
- on_
- Some Hardware on Surfaces simply does not work on Ubuntu:
- https://www.reddit.com/r/SurfaceLinux/comments/ 7kazwp
- 7kb1ky/ current
- guide_installing_ state
- linux_ of
- on_surfaceseries_devices/
- Some Hardware on Surfaces simply does not work on Ubuntu:
VM Setup (Alright, Probably Slow)
...
Once installed, ensure that your VM is working well (e.g. can connect to the internet, not too slow, etc). If the VM’s performance is very laggy, you may have to increase the RAM and number of cores dedicated to the VM (https://www.techrepublic.com/article/how-to-improve-virtualbox-guest-performance-in-five-steps/ , section 2)
Docker Setup (Windows 10/11, non-Ubuntu 20.04 Linux, MacOS) (Good)
Alternatively, you can also set up ROS2 using a virtualized system on your Windows, Linux, or MacOS machine. This is easier and less risky than setting up dual boot, but slower than a dual boot, but much faster than a VM.
What is Docker?
Docker is an open source platform that enables developers to build, deploy, run, update and manage containers—standardized, executable components that combine application source code with the operating system libraries and dependencies required to run that code in any environment.
TL;DR: Docker lets you build images for your programs exactly the way you want them to be setup. You tell it what base image to use to create your image from (e.g: we want to use Ubuntu 20.04, so we might take the Ubuntu 20.04 image), and then inside a "Dockerfile", we'll pull in that image, and then install whatever we need to run our program via the traditional Linux commands. In our case, that's ROS2. These Dockerfiles are code files that describe which image to pull down to use, and then what commands to use to install whatever is needed for your program.
Then you build the Dockerfile into a new image with all the dependencies for your program. Next, you open up the image and run your code-- now that we're using the image, we'll call it a container. You interact with the container via a terminal on your laptop, just like you're SSHing into another computer.
These Docker containers traditionally don't allow GUI applications, but through a bit of work, we can get those going too :].
Windows for Docker Setup Instructions
- Install WSL2 on your computer. This is Windows Subsystem for Linux, which allows developers to run a Linux environment without a separate virtual machine or dual booting. It's used by Docker to run its backend. If you're on Windows 10 version 2004 and higher (Build 19041 and higher), visit this page; all you have to do is run one command in Windows Powershell! If you're on an older build, see these manual steps.
- Install Docker Desktop via the instructions.
- Install VcXsrv, an application for the X Window System Display server. The X Window System Display server used by various operating systems for running their graphical applications. We'll VcXserv on Windows, and then we'll send all the graphical application traffic from our Docker container to our X server running on Windows, allowing us to run our graphical applications straight out of the box.
- We'll need to change the display number on VcXsrv to 0 so Docker knows where to find our server. Navigate to `C:\Program Files\VcXsrv`, or wherever you installed VcXsrv, and launch
xlaunch.exe
. In the display settings window, navigate to the bottom and change Display Number from -1 to 0, and hit next until you can closexlaunch
. - Fantastic, you've installed everything you need to run Docker graphically! Next up, open Windows Powershell (as an administrator should help). Next, we're going to pull down and show you how to use a pre-built Ubuntu 20.04 image with ROS2 Foxy installed, so you can get going with the rest of the software training.
- Run
docker pull osrf/ros-foxy-desktop
in Powershell. This will download the image, straight from the Open Source Robotics Foundation (the people behind ROS). If you need ROS2 Galactic for post-training dev work, useosrf/ros-galactic-desktop
. - Next, we'll go ahead and run this image. Before we do this, we'll need to pass a lot of flags to the
docker run
command, so I'll explain them here:-
the -v flag shares a folder from your host machine (your Windows computer) to the Docker container. In this example, we're mappingv C:\Users\path\to\folder:/code/dev_ws
C:\Users\path\to\folder
to/code/dev_ws
in the container. Any changes made in the Docker container will be reflected on your folder on Windows, and any changes made to your folder on Windows will be reflected in the Docker container. This is incredibly useful, because now we can code on Windows but run and test on the container in Linux.-it
runs the container with an interactive shell. If you didn't pass-it
, the container would run in the background and you would have no way of interacting with it (unless you useddocker exec
later).-e
sets an environment variable inside the Docker container. We'll be using this to tell the Ubuntu container where to send the graphical traffic via theDISPLAY
environment variable.--name
sets a name for the Docker container for use later. We'll call our Docker containeruwrt_dev_container
.
- Now, the actual
docker run
command you'll be using; please change the first path of the-v
flag to an absolute path of wherever you plan on storing your ROS2 workspace. In this example, we're sharing our entireC:\Users\Owner\Documents\Code
folder to the container:-
docker run --name uwrt_dev_container -e DISPLAY=host.docker.internal:0.0 -it -v C:\Users\Owner\Documents\code:/code/dev_ws osrf/ros-foxy-desktop
-
- You should now be inside the Docker container! Feel free to look around by running any typical Linux commands. ROS2 Foxy (or Galactic, whichever you chose) is pre-installed in this container.
- Run
- Useful Docker commands from here out:
- Stopping the container: `docker stop container-name`
- Restarting the container after stopping:
docker start container-name
- Pausing the container:
docker pause container-name
- Unpausing the container: `docker pause container--name`
- Opening a new shell for the container: `docker exec -it <mycontainer> bash`
Windows Setup (Not Preferred)
...