Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ROS Robotics By Example, Second Edition

You're reading from   ROS Robotics By Example, Second Edition Learning to control wheeled, limbed, and flying robots using ROS Kinetic Kame

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781788479592
Length 484 pages
Edition 2nd Edition
Languages
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Dr. Thomas L. Harman Dr. Thomas L. Harman
Author Profile Icon Dr. Thomas L. Harman
Dr. Thomas L. Harman
Lentin Joseph Lentin Joseph
Author Profile Icon Lentin Joseph
Lentin Joseph
Carol Fairchild Carol Fairchild
Author Profile Icon Carol Fairchild
Carol Fairchild
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Started with ROS 2. Creating Your First Two-Wheeled ROS Robot (in Simulation) FREE CHAPTER 3. Driving Around with TurtleBot 4. Navigating the World with TurtleBot 5. Creating Your First Robot Arm (in Simulation) 6. Wobbling Robot Arms Using Joint Control 7. Making a Robot Fly 8. Controlling Your Robots with External Devices 9. Flying a Mission with Crazyflie 10. Controlling Baxter with MATLAB© Index

Creating a catkin workspace

The next step is to create a catkin workspace. A catkin workspace is a directory (folder) in which you can create or modify existing catkin packages. The catkin structure simplifies the build and installation process for your ROS packages. The ROS wiki website is http://wiki.ros.org/catkin/Tutorials/create_a_workspace.

A catkin workspace can contain up to three or more different subdirectories (/build, /devel, and /src), each of which serve a different role in the software development process.

We will label our catkin workspace catkin_ws. To create the catkin workspace, type the following commands:

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

Even though the workspace is empty (there are no packages in the src folder, just a single CMakeLists.txt link), you can still build the workspace by typing the following commands:

$ cd ~/catkin_ws/
$ catkin_make

The catkin_make command creates the catkin workspace. If you view your current directory contents, you should now have the build and devel folders. Inside the devel folder there are now several setup.*sh files. We will source the setup.bash file to overlay this workspace on top of your ROS environment:

$ source ~/catkin_ws/devel/setup.bash

Remember to add this source command to your .bashrc file by typing the following command:

$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

To make sure your workspace is properly overlaid by the setup script, make sure the ROS_PACKAGE_PATH environment variable includes the directory you're in by typing the following command:

$ echo $ROS_PACKAGE_PATH

The output of the preceding command should be as follows:

/home/<username>/catkin_ws/src:/opt/ros/kinetic/share

Here, <username> is the name you chose for the user when Ubuntu was installed.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime