PIP INSTALL — ROS (Robot Operating System)

EA & HAM Club, NIT Warangal
10 min readMar 1, 2022

--

What is ROS?

  • It’s basically a software framework for programming robots.
  • It is a collection of tools, libraries and conventions that aim to simplify the task of creating complex and robust robot behavior.
  • With ROS, you can work with a simulated robot instead of the real thing. This makes testing and training easier and more effective.

Why ROS?

  • Provides lots of infrastructure, tools and capabilities
  • From drivers to state-of -the-algorithms, and with powerful developer tools, ROS has everything you need for your next robotics project. And it’s all open source.
  • Easy to try other people’s work and share your own i.e., it encourages collaboration. It has a global community.

For example, I want a face recognition system for my robot. There are ROS packages that you can use. You can just download them and add them to your project and you can get a face recognizer for free. Integration also becomes easy with ROS.

ROS Installation:

ROS needs an operating system that is open source so the operating system and ROS can be modified as per the requirements of application. Hence, most people prefer to run ROS on Linux, particularly Ubuntu. That doesn’t mean that ROS can’t run with Mac OS X or Windows 10 for that matter. But the support is limited and people may find themselves in a tough situation with little help from the community

So, if you have Windows OS or Mac OS , it is recommended to dual boot it with Windows. This enables you to choose which operating system to use when you power on your system.

After dual booting, when you power on your system each time, your screen shows up like this.

To check whether your system has legacy bios or UEFI GPT:

Tap the windows button and search “System Information”. There you can see your boot mode under BIOS mode. If it says Legacy, your system has BIOS . If it says UEFI, will it’s UEFI.

Most computers use GPT these days. MBR is older and GPT is a newer way of partitioning.

In the process of dual booting, while creating the live or bootable USB, some tools (like Rufus) ask you the type of disk partitioning in use. If you choose GPT with an MBR disk, the bootable USB might not work. So, it’s advised to check your partitioning scheme.

To check whether your system uses GPT or MBR:

Tap the windows button and search “Create and format disk partitions.

In here, right-click on the disk for which you want to check the partitioning scheme. In the right-click context menu, select Properties.

In the Properties, go to Volumes tab and look for Partition style.

What do you need?

A windows-10 laptop which has at least 8 GB of RAM and 20 GB of free disk space. (If you try to dual boot a laptop which has only 4 GB of RAM, it may also burn out. So, check out this properly. If you are having 4 GB of RAM, then see if you can get your RAM extended to 8 GB by a technician).

You will need a USB key (pen drive or USB drive) of at least 4 GB in size and no data in it and an external USB disk for making backup of your important existing data. It’s always nice to have a backup of your data, just in case if you mess up with the system while dealing with the disk partitions. It’s strongly recommended.

Now you know what you need for dual booting your laptop. So, now let’s see the steps for

Installing Ubuntu alongside Windows 10:

  1. Making backup of your data (optional but recommended)

It’s advised to copy all your important data that you cannot afford to lose on an external USB disk. You can use an external HDD (slower but cheaper) or SSD (faster but expensive) and copy the important files and folders on i.

2. Downloading Ubuntu

Ubuntu 18.04 version is preferred. There may be chances of breakdown if you try to dual boot Ubuntu 20.04.

https://releases.ubuntu.com/bionic/

Download desktop image from this. This should be around 2.5 GB in size

(Advised to check whether your system is satisfying the requirements or not).

3. Creating a live USB of Ubuntu

Download Rufus from this website.

https://rufus.ie/en/

This allows you to create a live Ubuntu USB.

Then next plug in your USB key of at least 4 GB size and have no data in it. Because, this device is going to be formatted.

Run the Rufus tool you just downloaded. It automatically identifies the plugged in USB but double check it anyway. Now, browse to the location of the downloaded Ubuntu ISO image and ensure it uses GPT partitioning scheme and UEFI target system.

4. Making some free space on your disk for Ubuntu installation:

Next tap on the windows button and search for “Create and format disk partitions”. Here, we are making up some free space on the disk for Ubuntu installation. Then right-click on the drive on which you want to partition and select shrink volume.

You can shrink any drive i.e., either C, D or E. It’s preferred no to partition the C drive. But if you have only one main partition which is C drive, (as shown in the picture ) then go for it.

You may install Ubuntu on 15 or 20 GB but you’ll soon start running out of disk space. So, it’s preferred to allocate 30–40 if you have at least 120 GB on disk. If you have 250 GB, allocate 60–80 GB to it or even more. Again, this space is your wish. You can allocate according to your usage of Ubuntu. But remember, approximately 20–25 GB of the space will go for all the Ubuntu OS files. So, if you are allotting 30 GB to Ubuntu, then you will have only 5–10 GB of free space on Ubuntu. So, keeping this point and your requirement of Ubuntu in mind, allocate the space. ( I personally gave around 100 GB of space for Ubuntu).

After you shrink, you should be able to see this as an unallocated space as shown in the picture.

5. Booting from live USB

Next, we need to boot from the above created live Ubuntu USB. To do that, go to boot setting by pressing F2/F10 or F12 at system start time and select to boot from the USB. Click on “Use a device”.

Then, recognize the USB device with its name and size.

Now this will power off your system and reboot into the disk you chose which should be the live USB disk. You should see a screen like this after a few seconds.

Start the installation procedure by clicking on the Install Ubuntu.

6. Installing Ubuntu

Then next, choose language and keyboard layout. On the next screen, choose Normal installation.

No need to download updates or install third party software just yet. You may do it after the installation process. Hit continue. It may take some time to go to the next step.

If you try to download updates and install media codes while installing, it sometimes creates issues during installation and may also cause the installation to fail. For this reason, it’s advised not to check that.

Installation takes two approaches based on what you see on the next screen.

a. You see the “Install Ubuntu alongside Windows Boot Manager”. If you see something like this, then you are in luck. You can select this method and hit continue.

The next screen will give you the option to create a partition for Ubuntu by dragging the divider. You can allocate appropriate disk space to Linux here. Ubuntu will create one partition of the allocated disk space and it will have root with home and a swap file of 2 GB in size under root itself.

b. You don’t see the “Install Ubuntu alongside Windows Boot Manager” option or it grayed out.

If you get like this, then on the Installation type screen, go with Something Else.

It will take you to the partitioning screen. Remember you had created some free space beforehand? You may choose to allocate the entire free space to root (swap file and home will be created automatically under root) or you can separate root, swap and home partitioning. Both methods are fine.

These are the steps for creating root, swap and home partitions separately.

Select the free space and click on the + sign.

It will provide you with the option to create a Linux partition. You are creating the Root partition. For size, 13 GB works (not guaranteed).So, to be on the safe side, give it 20 GB and anything above 25 GB is more than enough. Choose the size, select Ext 4 journaling file system for file type and / (means root) for the mount point and type of partition as logical and beginning of the space for location of new partition.

Clicking on OK will bring you to the partition screen

Next, create swap. Like previously, click on the + sign again. This time, use the file type as Swap area and every other is the same. For size, If you have 2 GB or less RAM, use swap double the size of RAM. If you have 3–6 GB of RAM, use a swap of the same size as RAM. If you have 8 GB or more RAM, you may use swap half the size of RAM.

In the similar fashion, create a Home partition. Allocate it maximum space (in fact allocate it rest of the free space) because this is where you’ll save music, pictures and downloaded files. Select Mount point as /home.

Once you are ready with Root, Swap and Home, click on Install Now. It’s almost done now.

Next, select a time zone when asked. And then you’ll be asked to enter a username, hostname (computer’s name) and a password.

Wait for 8–10 minutes to complete the installation.

Once the installation finishes, restart the system

You’ll be asked to remove the USB disk. You can remove the disk at this stage without worrying. The system reboots after this.

Remove USB and press Enter.

You do not need the live USB disk to use Linux anymore. You have installed Ubuntu on your computer’s disk. Remove the USB and keep it for later if you want to use it for installing Linux on some other system. You may also format it and use it for regular data storage or transfer.

If everything went smooth, you should see the grub screen once the system powers on. Here, you can choose Ubuntu to boot into Ubuntu and Windows boot manager to boot into Windows.

Yeah, that’s it. You have successfully dual booted your system. ☺

Now, to install ROS:

We are going to install ROS Melodic. It’s the best recommended ROS distribution for Ubuntu 18.04.

Boot into Ubuntu and open up your terminal and get back to home by typing cd /

And just copy paste the commands given in this link one by one in your terminal.

http://wiki.ros.org/melodic/Installation/Ubuntu

Incase of any doubt, follow this video tutorial by ROS’s official website

https://youtu.be/PowY8dV36DY

Note: This video shows how to install the ROS Noetic version. You can mimic this process similarly to install ROS Melodic. Go to the above mentioned ROS Melodic installation link and follow the instructions given in the above mentioned Youtube link.

Some more tutorials:

https://www.youtube.com/watch?v=u5QyjHIYwTQ&t=269s

https://www.youtube.com/watch?v=vfqN-RRt84Q&t=272s

References:

https://ros.org

--

--

EA & HAM Club, NIT Warangal
EA & HAM Club, NIT Warangal

Written by EA & HAM Club, NIT Warangal

A group of techies who love to explore new domains of technology which aims to attain and impart the knowledge.^BlogsCANbeAgreatWAYtoexchangeKNOWledge^

No responses yet