WSL and Installation of ROS
Previously on this page...….
- we took our first step towards our project of learning ROS and simulating a simple pick and place mobile robot.
- we started with installing wsl/vm, hope you have tried one of the steps personally am using wsl and also have installed on windows.
- For 3D cad software am using Fusion 360, also if you wish you can use your choice of software but make sure it has URDF exporter.
Starting WSL gui...
- If you have installed wsl on your pc one tip I want to give is that also install windows terminal, as we will using multiple windows of terminal, at least 3 windows will be in operation at a time.
- now if you are using Linux for first time, you will not be familiar with its commands and its inbuilt text editor, like windows come with notepad, Linux comes with Nano and you can use it in terminal.
- but first lets launch some gui apps from wsl, hope you have launched Xserver , if don't know what it is, have look of my previous post.
- open windows terminal or command prompt form start menu and type wsl or just find your ubuntu app from start menu and launch it.
- if you have launched ubuntu app for first time ,you will be asking for username and password, complete the installation process , here you need not type wsl.
- Now type or copy paste the following command:
export LIBGL_ALWAYS_INDIRECT=0
- Note: if you are using windows terminal first time, type "cd" which is Linux command for change directory, as windows terminal will open in /mnt/c/user name/...
- once you have typed the above commands just type 'Firefox' which will open Firefox from Linux.
- now there is problem, whenever you will launch a new terminal you have to type above command but what if these commands load on there own.
- Type the command :
- Just copy paste this command to terminal to have no errors, then your terminal will be like this:
- Now your mouse courser will not work in this window, use arrow keys to get to the bottom of this file and copy paste the export commands.
- Then press 'ctrl+o' , hit 'enter' and press 'ctrl+x' , this will exit the text editor.
- ctrl+o ===> is for write out i.e write in the name of
- enter will confirm your file name is same and save under this.
- ctrl+x ===>is for exiting the text editor
- Now '.bachrc' is base file for terminal, like '.bat' file in windows if you are for cs background you will be familiar with it.
- That's it if you want to test launch, terminal again and type "Firefox".
Accessing wsl in vscode:
- Vscode is a good text editor and it will provide a great experience across different programing languages, so download it from here its open source and free, make sure you download windows version.
- After installation, on left side bar there is button for extensions, click on it and search for Remote wsl extension by Microsoft, install it.
- now the Vscode will be installed at wsl, on left side you will find desktop like button it will be your remote wsl vscode, from now, by default vscode will be opening in ubuntu and if you want to open it for any other project in windows just go your work space folder and right click inside it to see option of open with vscode and the vscode will load in windows
- and if you want to open wsl just click on remote wsl button on left side and click on ubuntu and open it.
Installing ROS...…
- Now if you are using ROS on windows you have already installed ROS so you can skip the installation process.
- Now you are ready to install ROS go through this documentation from ROS wiki to install ROS and prepare your catkin work space if you are installing ROS melodic or noetic.
- These two distros are very popular and you will find a huge community over these two, am using ROS noetic but will be posting commands and other stuff for both of distros.
- Now if you are planning to use ROS for industrial projects then I will suggest to learn ROS2 as well with ROS1.
Suggestions...…
- hope you have installed ROS1, while going through documentation you have noticed that we need to source our devel space every time, to avoid that you can paste the source command to '.bashrc' so that it automatically source when ever you launch new terminal.
- One problem you may encounter after installing wsl is that your display will start flickering and screen will turn black...…π don't worry nothing is happened to your laptop or pc keep clam and follow my instructions:
- Connect an external display to pc/laptop via HDMI you see nothing is happening to external display.
- Go to intel website and download the latest driver according to your windows version which is mostly windows 10, so the driver version will be 30.0.100.9684 don't install beta version.
- once its downloaded install it your pc/laptop will restart at least 2 times wait until the message derivers installed successfully is popped and then try and try restart machine by removing external display.
- Before starting our project go through the beginner tutorials from ROS take your time to practice and learn how the things work in ROS.
- While following tutorials you will encounter some error try to solve them by your self by searching them on internet and if you don't find any solution to it then comment below so that I will try to solve it.
- One of the most common error you encounter is that your default python version will not be set to which, is used by ROS distro to solve this problem follow this site.
Upcoming.....
In next blog we will see:
- Some basic terms and concepts used in ROS
- Using 3D cad software
- Different files generated by exporter
- Gazebo


Comments
Post a Comment