Skip to content
  • Home
  • About the Blog
  • About the Author
  • Sitemap

Abdur Rosyid's Blog

Just a few notes on mechanical engineering and robotics

How to Install ROS1 (Melodic)

July 5, 2021 by Abdur Rosyid

It is recommended to install an LTS ROS distribution, which is always to be installed on a certain LTS distribution of Linux Ubuntu. A specific ROS distribution can only be installed on a specific Linux Ubuntu distribution.

ROS can be installed from either source or from binary (Debian installer). It is recommended to install the core ROS packages from binary.

It is recommended to install the complete ROS Desktop-Full (from binary).

Step 1: Install ROS.

  • The documentation page for ROS installation: http://wiki.ros.org/ROS/Installation
  • The documentation page for ROS Melodic installation on various OS: http://wiki.ros.org/melodic/Installation
  • The documentation page for ROS Melodic installation on Linux Ubuntu: http://wiki.ros.org/melodic/Installation/Ubuntu

The installation instruction above already includes sourcing the ROS underlaying workspace in ~/.bashrc:

gedit ~/.bashrc

Then on the opened bashrc file, type:

source /opt/ros/melodic/setup.bash

and save the file.

To check the ROS installation, open a terminal and type the following to run ROS master:

roscore

Gazebo is by default already installed. To launch Gazebo, open a terminal and type the following command:

gazebo

Step 2: Create your overlaying catkin workspace, located in your home directory, and build it.

Let’s say you want to create an overlaying catkin workspace called “catkin_ws”:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws
catkin_make

After the “catkin_init_workspace” command is run, CMakeLists.txt file is generated inside the src folder.

After the “catkin_make” command is run, two folders namely “devel” and “build” are generated inside the catkin workspace.

Step 3: Source your overlaying catkin workspace in ~/.bashrc

From now on, each time we’ll have to start ROS commands that imply using our packages, we’ll have to source the workspace environment in each terminal:

source ~/catkin_ws/devel/setup.bash

Alternatively, to make it work automatically:

gedit ~/.bashrc

Then on the opened bashrc file, type:

source ~/catkin_ws/devel/setup.bash

and save the file.

Post navigation

Previous Post:

What to Learn in ROS

Next Post:

How to establish ROS1 network between multiple machines

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • STEM 101
  • Robotics
  • Kinematics
  • Dynamics
  • Control
  • Robot Operating System (ROS)
  • Robot Operating System (ROS2)
  • Software Development
  • Mechanics of Materials
  • Finite Element Analysis
  • Fluid Mechanics
  • Thermodynamics

Recent Posts

  • Pull Request on Github
  • Basics of Git and Github
  • Conda vs Docker
  • A Conda Cheat Sheet
  • Installing NVIDIA GPU Driver on Ubuntu

Archives

  • June 2025
  • July 2021
  • June 2021
  • March 2021
  • September 2020
  • April 2020
  • January 2015
  • April 2014
  • March 2014
  • March 2012
  • February 2012
  • June 2011
  • March 2008
© 2026 Abdur Rosyid's Blog | WordPress Theme by Superbthemes