Lecture - 3 - Robotics - Robot - Programming - Introdution - To - ROS (Module - 2) - Part - 2
Lecture - 3 - Robotics - Robot - Programming - Introdution - To - ROS (Module - 2) - Part - 2
INTRODUCTION TO ROS(PART_2)
CREDIT HOURS:5 HOURS
18-01-2024 2
Understanding catkin Workspace
18-01-2024 4
Build space,Development space, Install
space :
• The build space is where CMake is invoked to build the catkin packages in the
source space. CMake and catkin keep their cache information and other
intermediate files here.
• The development space (or devel space) is where built targets are placed prior to
being installed. The way targets are organized in the devel space is the same as
their layout when they are installed. This provides a useful testing and
development environment which does not require invoking the installation step.
• once the targets are built, they can be installed into the install space by invoking
the install target, usually with make install. The install space does not have to be
contained within the workspace.
18-01-2024 5
Creating and building our ROS Package
• Essentially, ROS packages are catkin packages which means that they should follow a particular
directory structure and contain a couple of files that identify them as a ROS package and help us
build the code in the packages.
• ROS packages reside in directories called catkin workspaces and therefore, we would have to
create and initialize a catkin workspace first.
• Note: catkin packages can be built as a standalone project but catkin also provides the concept
of workspaces, where you can build multiple, interdependent packages together all at once.
• $mkdir catkin_ws //create a workspace called 'catkin_ws'
$mkdir catkin_ws/src //create a source folder inside the workspace
$cd catkin_ws/ //move inside the catkin workspace
• $catkin_make //compile the workspace 18-01-2024 6
Create our new ROS Package
18-01-2024 7
Create our new ROS Package
18-01-2024 8
Build the workspace with the new empty packagen
and Make the workspace visible to the file system
• To build the workspace with the new package, we would have to go to the root of
the workspace and run the catkin_make command.
• To make the workspace and its packages visible to the file system so that we can
access these packages from anywhere, we would have to run the following
command:
• $source devel/setup.bash
18-01-2024 9