Setting up ROS on Linux Mint 20 (Ulyana)

What is ROS?

From http://wiki.ros.org/ROS/Introduction

ROS is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management. It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers

ROS will run on your existing OS and can be easily install as per instructions provided on ROS wiki.  As per the documentation, ROS is supported on Debian and Ubuntu and has ready repos for the same.

Luckiy Mint 20 is based on Ubuntu 2-0.04 (focal) so we can directly use most of the commands for the installation. 

Though the repos can be added via the GUI, it is faster from the command line. 

Let us see what steps should we take to go through the installation:

  1. First we need to add the ROS repo to our Linux distro.
    1. Command given for Ubuntu is: sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    2. Here if you are using ubuntu the lsb_release -sc is replaced with 'focal' if you use this directly on Linux Mint it will be replace by 'Ulayana' in this case and our repo will not work.
    3. So instead of the above command directly use the following:
      1. sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list'
  2. Since this is an external repo we need setup the keys for the same
    1. curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
      1. If curl is not installed install it normally (sudo apt install curl).
  3. Update the repo list now:
    1. sudo apt update
  4. Next install the ROS desktop.  There are a lot of options, best would be to just install the full if you are just starting. This will aviod any missing packages.
    1. Keep in mind the full download will be around 500MB and will take up around 2GB of space, so be prepared for the same.  The download and package setup can take up some time.
    2. sudo apt install ros-noetic-desktop-full
  5. Once the installation is successful, we need to make sure ROS env is properly setup, we need to source the ROS setup.bash script form /opt/ros/noetic
    1. This can be done simply using the following command:
      1. source /opt/ros/noetic/setup.bash
    2. But since we are going to use this frequently, we will add this to our .bashrc, to do the same either you can edit the .bashrc file or append a line to the above command to the file.
      1. echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
      2. This will add the above line to our .bashrc and it will make sure the env is setup every time we use the terminal.
      3. Now either close the termainal and ropen it or run the following command (The following command need not be run every time)
      4. source .bashrc
  6. ROS Dependencies for building packages
    1. There are some python packages that will be needed later for building packages etc, let us install those also:
    2. sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
      1. This will take another 40MB of space
  7. ROSdep
    1. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.
    2. To install the same run: (If you ran the previous install rosdep was already installed, so no need to re-install it again, jump to initalize part)
      1. sudo apt install python3-rosdep
    3. Initalize rosdep via:
      1. sudo rosdep init
      2. rosdep update

So now your ROS enviornment is ready!!!

 

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
Enter the characters shown in the image.
Are you a robot?
Address

OpenSourceCook.in
"Natraj"  Bungalow,
Colony No.7,  Sr.No. 38.
(Lane Behind Sai Baba Mandir)
Kale Borate Nagar, Hadapsar,
Pune - 411028.
Get Directions