NA of Moles

How to setup ROS Noetic in WSL through Ubuntu 20.04 Focal

Guide for the Robotics class

Scope: to install the environment needed for the labs without having to deal with Docker or dual booting in Ubuntu.

Target: PCs running Windows 10 or up supporting virtualization.

First you need to set-up WSL in your machine. From a Windows command line run:

wsl update
wsl install Ubuntu-20.04

And fill the username and password as you please.

Now you have should get a linux shell, in other case you can launch it from the start menu or from the dropdown menu of the terminal.

Let’s update some packages as a precaution and then continue.

sudo apt update
sudo apt upgrade -y

Now we start dealing with the core ROS installation. These commands are taken from the Docker repository

sudo apt-get update 
sudo apt-get install -q -y --no-install-recommends dirmngr gnupg2
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo  sh -c 'echo "deb http://packages.ros.org/ros/ubuntu focal main" >> /etc/apt/sources.list.d/ros1-latest.list'
sudo apt-get update 
sudo apt-get install -y --no-install-recommends ros-noetic-ros-core=1.5.0-1*
source "/opt/ros/noetic/setup.bash"
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

These are the commands for the “base” ROS installation taken from here

sudo apt-get update 
sudo apt-get install --no-install-recommends -y  build-essential  python3-rosdep  python3-rosinstall   python3-vcstools 
sudo rosdep init 
rosdep update --rosdistro noetic
sudo apt-get update 
sudo apt-get install -y --no-install-recommends ros-noetic-ros-base=1.5.0-1*

Now finally for the “perception” ROS package

sudo apt-get update
sudo apt-get install -y --no-install-recommends   ros-noetic-perception=1.5.0-1* 

Basically in the Dockerfile shared in class this was the first section. This is not a command!!!!

# Start from the ROS Noetic perception image
FROM ros:noetic-perception

Now we continue with the other installation commands:

sudo apt-get update
sudo apt-get install -y --no-install-recommends nano vim tmux gedit ros-noetic-rqt* net-tools iproute2 ros-noetic-plotjuggler* ros-noetic-foxglove-bridge ros-noetic-turtlesim ros-noetic-tf*

You should already be in the home directory but just in case:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
ln -s /opt/ros/noetic/share/catkin/cmake/toplevel.cmake src/CMakeLists.txt
catkin_make

To test it:

In three different tabs execute these commands in this order:

roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
Tags: