Creating Workspace and Learning ROS PDF
Creating Workspace and Learning ROS PDF
2017
Understanding ROS
The ROS packages are the basic units of the ROS system. The distribution of ROS which we
are using is Indigo. We will use the catkin build system to build ROS packages. A build
system is responsible for generating 'targets'(executables/libraries) from a raw source code
that can be used by an end user.
The first requirement in creating ROS packages is to create a ROS catkin workspace.
After setting the catkin workspace, you can create your own package that has sample nodes
to demonstrate the working of ROS topics, messages, services, and actionlib.
Switch to the catkin workspace “src” folder and create the package using the following
command:
Syntax of catkin_create_pkg:
catkin_create_pkg [package_name] [dependency1] [dependency2]
Here is the example command to create the sample ROS package:
catkin_create_pkg sample_package roscpp rospy std_msgs
ERTS LAB
IIT-Bombay www.e-yantra.org
Robotics Competition
2017
After creating this package, build the package without adding any nodes using the
catkin_make command. This command must be executed from the catkin workspace path.
The following commands show you how to build an empty ROS package:
cd ~/catkin_ws/src/sample_package
mkdir scripts
mkdir launch
cd ~/catkin_ws
catkin_make
After a successful build, you can start adding nodes to the “scripts” folder inside this sample
package. You can also add your launch files in “launch” folder.
Important: To better understand the commands visit ROS wiki tutorial page and follow
the tutorial numbered 5 to 16.
ERTS LAB
IIT-Bombay www.e-yantra.org