1.2.4 ROS File system – part 2

Course subject(s) Module 1. ROS Essentials

In this second part you will learn more about the src folder in your workspace and ROS packages.

Summary:

ROS packages reside in the ‘src‘ space. In ROS, software is organised in ROS packages. A ROS package typically contains the following things:
– CMakeList.txt
– package.xml (These two files indicate that the folder is a ROS package file. More on these two later in the course)
- scripts/ (This folder contains all Python scripts. We will only use Python in this course)
- src/ (This folder contains all C++ source files. We will not use these in this course)

To create a new ROS package, we will use catkin:
$ cd <path_to_ros_ws>/src
$ catkin_create_pkg hrwros_week2 std_msgs

Please keep in mind that you don’t need to place the source files of any dependencies, such as std_msgs in the line above. Instead, you can simply install their binaries with the rosdep command:
$ rosdep install <package_name>

You can also install all ROS package dependencies in one command:
$ cd <path_to_ros_ws>/src
$ rosdep install --from-paths . --ignore-src -y

src is not the only space in your workspace: there is also the ‘devel‘ space. This contains all binary executables from your src spaces.

If you want more information on the folder structure of a catkin workspace, you can do so 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