1.2.3 ROS File system – part 1

Course subject(s) Module 1. ROS Essentials

This lesson consists of two videos about the ROS File system. In this first part you will mainly focus on setting up your workspace with catkin.

Important note

The video mentions working with the older ROS version Kinetic. The course currently uses Melodic, therefore you should source the appropriate file: opt/ros/melodic/setup.bash.

ROS file system – nomenclature

ROS workspace (catkin workspace) consists of different subspaces. A workspace is a folder to organize ROS project files. ROS uses catkin, which is a build tool to compile source files into binary files. Your code goes into the src workspace folder and catkin manages the other ones. A catkin ROS workspace contains three main spaces:

src space: contains source code, this will be your main work folder
devel space: contains setup files for the project ROS environment
build space: contains the compiled binary files
If you’d like to read some more about these spaces, you can do so here.

We will now guide you through the creation of our own catkin workspace in ROS. This workspace will just be used as an example to show you the process, and won’t be used anymore after this.

First, create a new folder for your workspace:
$ mkdir -p new_ros_ws/src

You can use the ls command to verify the new folder that was created.
Next move to your newly created workspace using the command cd new_ros_ws.
Thereafter, setup the correct ROS environment using the command source /opt/ros/kinetic/setup.bash. Finally, we initialize catkin:
$ catkin init
$ catkin build

Warning!

If you independently follow the tutorials on ROS Wiki, you might come across the command catkin_make. That is different to what we use in our course which is catkin. Don’t try and mix the two! They are not compatible. You can read up on catkin here.

Creative Commons License
Hello (Real) World with ROS - Robot Operating System by TU Delft OpenCourseWare is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://online-learning.tudelft.nl/courses/hello-real-world-with-ros-robot-operating-systems//.
Back to top