Install ROS2 on Windows (with WSL2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial I will show you how to install ros2 using wsl2 on Windows we will first install wsl2 then install the Ubuntu app on Windows and finally install roster on top of that note that wsl2 is a great tool but maybe still a bit young and experimental so don't have too big expectations on what you can do it should work fine for the roster installation but maybe in the future you will have to do some debugging for functionalities that you need for your own roster application alright so knowing that let's get started so here on Windows you can just start a Powershell so you just press on the Windows key and you find Powershell that you can run as an administrator okay you click on yes if you have a pop-up then we are in a portion let's zoom in a bit and the first thing to do is to do WSL dash dash install this will will install wsl2 actually so let's do this and well it didn't do anything for me because I've already installed it okay then what you can do and it's very important you restart your computer and after you have restarted your computer we will need to change a few settings on windows so you press again the Windows key and you can search for features and you will find something like this turn Windows features on or off so you can maybe just write this if you don't find it directly okay and I will get to this window you can go down and you should see something like this virtual machine platform so you're gonna click here to enable that and if you have something like that Windows hypervisor platform you're also going to enable it okay now just a quick note here quick warning about that is if you were using other virtual machines like virtualbox for example when you turn on those parameters maybe after that virtualbox is not going to work correctly so make sure that if you want to so if you have the issue and if you want virtualbox to work then make sure that you uncheck those and that you restart the computer okay and on top of those two make sure also that you have Windows subsystem for Linux that is checked okay that's super super important okay so windows subsystem for Linux virtual machine and maybe that one if you find it Windows hypervisor platform I'm going to click on OK and then you wait a bit and you can see that now you need to restart the computer to install the changes so let's actually do that let's restart the computer now and back to the desktop so already make sure that you restart the computer okay that's very important and now you can also search for the store so the Microsoft store here let's open the Microsoft store because that's where we are going to install Ubuntu and well if that's the first time you open the Microsoft store well that was the first thing for me too but actually it works quite well so let's search here for Ubuntu so you just type Ubuntu and okay you have Ubuntu right here with no version number that should install the latest one but then you can also see you have for example here I have Ubuntu 18 Ubuntu 20 and Ubuntu 22. so I would say install the version that you want okay and so here we are going to install Ross to handle so I'm gonna choose 22.04 because well actually this default Ubuntu I think as for the recording time as I've tested the last time it will install Ubuntu 20 and not 22 so if you can see directly the version okay you choose that one so you choose 22 or you choose whatever you want but take the one with the version member and you just click on get and that's going to install Ubuntu 220. all right and now Ubuntu has been downloaded and you can just click on open and that's gonna install Ubuntu okay so let's click on OK here and let's choose a language okay continue let's choose uh username password so I'm just putting a weak password for this tutorial but okay okay that's fine okay and you can click on finish at the end great and now you can see you have a terminal and you are on Ubuntu and so I have the user add here with the password I've set and while this is just like I was on Ubuntu but in Windows so actually let's zoom in a bit and well it's recommended to do of course a sudo apt update and then sudo apt upgrade to upgrade the packages so let's put yes and let's wait a few minutes okay and let's do a pseudo apt or to remove just in case okay we can remove stuff that we don't need anymore great and now let's uh quit this so we are back to Windows and let's go to the store and one app that you may find useful is the GW SL so let's find this and that's gonna be that one okay so that it's gonna let you easily as you can see run graphical Linux app on Windows 10 well Windows 10 11 so you can just open this so you can actually install it so it's already installed for me I've installed it before but you can install it and then if you open it you can see here so basically at the bottom right here you can open a Linux shell okay it's going to open Ubuntu again and you can open apps okay um so you have different apps that you can open once you install them in Ubuntu okay when you install JW SL you may have a pop-up to ask you to allow the access so then you click on yes of course otherwise it's not gonna work and now well Ubuntu is installed on wsl2 so that should be enough and what we're gonna do now is to install ros2 okay and for this tutorial I'm going to install Ross to handle because we are on Ubuntu 22.04 here you can see here so the version of roster that corresponds to this Ubuntu version as you can see here is rust to handle okay so let's go to the installation page of ros2 handle and then in binary packages you can choose Debian packages and I'm going to show you the steps to follow to install ros2 so first we will need to check for the Locale I'm going to zoom in a bit okay so we will need to check for the location if you see utf-8 as you can see here we don't need to do anything else if you don't see utf-8 then make sure you run this line and then this one that one and that one so you run the four different commands one by one and if you want to copy and paste well here Yoko being from a web browser on Windows to a Ubuntu on WSL so if you want to copy and paste you can easily do so you select the text you copy the text and then you go you click to select to have the focus on this window and you do right click with your mouse and this is going to paste the line okay so you run those four commands only if you don't see utf-8 and then you can go down and we will need to set up the sources so to set up the sources we will add the Ubuntu Universe repository and you just well you just run all of the lines here one by one so you copy and then you click here and you right click okay so this one was already installed you add the universe repository so copy and then select right click you press enter here then we are going to install curls so you can just also run this command and then that one and then we can add the repository to your sources list okay so now we have set up the sources and we can go to the next step and we can do clear here maybe and then we need to update the packages so let's do a pseudo apt update all right so now you can see so before we had uh stuff with ubuntu.com now we also have packages.frost.org okay so if you see this you have the new sources forest and let's do a pseudo apt upgrade to make sure that we have everything upgraded okay that's very important now we can install roster so here you can choose to install just the bare bones okay you will not have any graphical tools just the bare minimum so you can run Eros to application but we can also install the desktop so we have the 2D and 3D simulation tools more demos okay tutorials and also debugging tools like rqt graph Etc so let's install this one so pseudo apt install browse Dash handle okay so every package is gonna start like this and then we are going to install desktop all right and that's quite a lot of stuff to install as you can see so we need to download 800 megabytes and install more than three gigabytes of space okay so make sure that of course you have enough space on Windows because this is going to be added to the Ubuntu app that you have installed so make sure you have enough space I'm gonna put yes and then let's wait for the installation to be done okay great now ros2 is installed and the last step I'm gonna do here in this tutorial is to actually set up the environment because as for now you can't just run or else two you need to actually Source a script okay a setup.bash script where you have installed prostu so that you can use it so basically we need to run that script every time you open a new session so what you can do instead is to add it to your bash essay which is a file that's going to be executed with bash comments every time you open a terminal so we can do Pico with so let's copy this and let's put it there okay Eco you put this line with double quotes and then two angle brackets okay make sure you have two and not just one in tilde slash Dot bash s and you can use the auto completion as you can see here to make sure you have the right five okay and so now if I Source The Bash SC which means that for example I have opened a new terminal I can use cross to command okay you can see I can press tab and have the auto completion for Rows 2 alright and congratulations you have successfully installed ros2 with wsl2 on windows thank you for watching now subscribe here to get more tutorials in the future also check out my online courses if you like what I teach links in the description and see you in the next one
Info
Channel: Robotics Back-End
Views: 27,438
Rating: undefined out of 5
Keywords: ros2 windows, ros2 wsl2, ros2 wsl, ros2 ubuntu wsl2, ros2 ubuntu windows, install ros2 on windows, install ros2 with wsl2, ros2, ros, ros2 tutorial, robotics back-end
Id: F3n0SMAFheM
Channel Id: undefined
Length: 12min 16sec (736 seconds)
Published: Mon Jan 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.