-
Notifications
You must be signed in to change notification settings - Fork 0
Working On Your Own Computer
We have set up the WSL-ROS environment specifically for this COM3528 lab course to ensure that you have all the right packages and tools available to you. Of course, this requires you to work on a University Managed Computer and - naturally - you may want to be able to work through this course material (and explore further) on your own device instead.
Note: Please be aware that you won't be able to connect to physical MiRos from your own computer due to network restrictions!
[Update] You can use the installer script available here, to automate the installation process that is described below (except VS Code).
The first option you can go for is to install all the required packages natively on Ubuntu. Detailed guidance on how to install Ubuntu 20.04 are out of scope of this guide, but some pointers are given below:
- You can download the latest Ubuntu 20.04 image from the official website.
- You'll need to write that image on a 4GB+ USB flash drive, in order to convert it into a bootable installation drive. We recommend using the Rufus software for this purpose.
- Boot from the USB flash drive and follow the installation instructions. Detailed explanations of all the options can be found on the web.
- If you have an existing Windows installation, it is possible to preserve it by setting up a dual boot configuration. We recommend using a separate hard drive for this purpose, rather than trying to fiddle with partitions on a single hard drive.
Further steps below assume you are on Ubuntu 20.04 and are logged in into an account with sudo (super-user) privileges.
Open the terminal and install the prerequisites
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install chrony ntpdate curl build-essential git
$ sudo ntpdate ntp.ubuntu.comAdd ROS repo and keys, and install ROS packages (make note of the long list - that is all one line):
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
$ sudo apt update
$ sudo apt install ros-noetic-desktop-full ros-noetic-rqt-* ros-noetic-gazebo-* ros-noetic-joy ros-noetic-teleop-twist-joy ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc ros-noetic-rgbd-launch ros-noetic-rosserial-arduino ros-noetic-amcl ros-noetic-map-server ros-noetic-move-base ros-noetic-rqt* ros-noetic-gmapping ros-noetic-navigation python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essentialDeploy, clean-up and reboot
$ sudo rosdep init
$ rosdep update
$ sudo apt upgrade
$ sudo apt autoremove
$ sudo apt autoclean
$ sudo rebootInstall catkin_tools and other MDK dependencies
$ sudo apt install python3-pip
Verify:
$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
$ sudo apt install python3-catkin-tools ffmpeg
$ sudo pip3 install apriltagNow you should have the necessary packages in the ROS framework to install MDK.
- You can download the latest version of the MDK from CQR's official website via this link.
- Move the archive from the Downloads folder to a location of your choice, e.g.
~/srcor~/pkgs. You can use the File Explorer (or Files, as it is properly called) to move files and create folders.
Note: This will be the actual MDK location, since the
~/mdkpath you probably got used to by now is only a soft link to this folder created during installation. Be careful not to accidently delete this folder!
- Open a terminal window inside the folder with the MDK archive and run the following commands:
$ tar -xvzf mdk_2-210921.tgz
$ cd mdk-210921/bin/script
$ ./install_mdk.sh- Close and re-open any terminal windows and compile the catkin workspace that you will be using for code development, as part of the MDK:
$ cd ~/mdk/catkin_ws/
$ catkin buildNow you can test your installation by launching Gazebo and Client GUI as described in Week 1.
Based on the instructions from here.
Update package index and install dependencies
$ sudo apt update
$ sudo apt install software-properties-common apt-transport-https wgetImport the Microsoft GPG key:
$ wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -Enable the Visual Studio Code repository:
$ sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"Install Visual Studio Code:
$ sudo apt install codeOnce done, launch VS Code, trust the workspace and install the following extensions:
- Python
- Remote-SSH
Refer to the Windows Subsystem for Linux Documentation for instructions on how to install and use WSL on Windows 10 or 11.
Ubuntu 20.04 should be installed by default when you install WSL but if not, or if you want to create an additional WSL distribution then see here.
We'd also recommend installing the Windows Terminal App.
Launch your Ubuntu 20.04 distro and then follow the steps outlined above above.
Graphical Applications are only supported natively in WSL when running on Windows 11 so if you're running Windows 10, then you will need to follow the additional steps below to get GUI apps (such as Gazebo and RViz) working...
First, you'll need to install the VcXsrv Windows X Server. You'll need to make sure you have this running before trying to launch any GUI applications from WSL (Gazebo simulations etc.) To make this easier, we've created a configuration file. Download this file, save it on your desktop and double click it to launch an X Server on your machine with the appropriate configurations. Once launched, an icon should be visible in your notification tray in the bottom right-hand corner of the Windows Desktop:
In Ubuntu, you'll need to then add the following lines to your ~/.bashrc:
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1
export GAZEBO_IP=127.0.0.1COM3528 Cognitive and Biomimetic Robotics
Academic Year 2021–2022
Alex Lucas | Department of Computer Science | The University of Sheffield
(Last updated: 24/03/2022)
The documentation within this Wiki is licensed under Creative Commons License CC BY-NC:
You are free to distribute, remix, adapt, and build upon this work (for non-commercial purposes only) as long as credit is given to the original author.