Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Learning Robotics using Python
Learning Robotics using Python

Learning Robotics using Python: Design, simulate, program, and prototype an autonomous mobile robot using ROS, OpenCV, PCL, and Python , Second Edition

Arrow left icon
Profile Icon Lentin Joseph
Arrow right icon
₱1113.99 ₱1591.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.1 (8 Ratings)
eBook Jun 2018 280 pages 2nd Edition
eBook
₱1113.99 ₱1591.99
Paperback
₱1989.99
Subscription
Free Trial
Arrow left icon
Profile Icon Lentin Joseph
Arrow right icon
₱1113.99 ₱1591.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.1 (8 Ratings)
eBook Jun 2018 280 pages 2nd Edition
eBook
₱1113.99 ₱1591.99
Paperback
₱1989.99
Subscription
Free Trial
eBook
₱1113.99 ₱1591.99
Paperback
₱1989.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learning Robotics using Python

Getting Started with Robot Operating System

The main aim of this book is to teach you how to build an autonomous mobile robot from scratch. The robot will be programmed using ROS and its operations will be simulated using a simulator called Gazebo. You will also see the robot's mechanical design, circuit design, embedded programming, and high-level software programming using ROS in the upcoming chapters.

In this chapter, we will start with the basics of ROS, how to install it, how to write a basic application using ROS and Python, and the basics of Gazebo. This chapter will be the foundation of your autonomous robotics project. If you are already aware of the basics of ROS, and already have it installed on your system, you may skip this chapter. However, you can still go through this chapter later to refresh your memory as to the basics of ROS.

This chapter will cover the following topics:

  • Introduction to ROS
  • Installing ROS Kinetic on Ubuntu 16.04.3
  • Introducing, installing, and testing Gazebo

Let's start programming robots using Python and Robot Operating System (ROS).

Technical requirements

Introduction to ROS

ROS is a software framework used for creating robotic applications. The main aim of the ROS framework is to provide the capabilities that you can use to create powerful robotics applications that can be reused for other robots. ROS has a collection of software tools, libraries, and collection of packages that makes robot software development easy.

ROS is a complete open source project licensed under the BSD (https://opensource.org/licenses/BSD-3-Clause) license. We can use it for research and commercial applications. Even though ROS stands for Robot Operating System, it is not a real operating system. Rather, it is a meta-operating system, which provides the features of a real operating system. Here are the major features that ROS provides:

  • Message passing interface: This is the core feature of ROS, and it enables interprocess communication. Using this message-passing capability, the ROS program can communicate with its linked systems and exchange data. We will learn more technical terms concerning the exchange of data between ROS programs/nodes in the coming sections and chapters.
  • Hardware abstraction: ROS has a degree of abstraction that enables developers to create robot-agnostic applications. These kinds of application can be used with any robot; the developers need only worry about the underlying robot hardware.
  • Package management: The ROS nodes are organized in packages called ROS packages. ROS packages consist of source codes, configuration files, build files, and so on. We create the package, build the package, and install the package. There is a build system in ROS that helps to build these packages. The package management in ROS makes ROS development more systematic and organized.
  • Third-party library integration: The ROS framework is integrated with many third-party libraries, such as Open-CV, PCL, OpenNI, and so on. This helps developers to create all kinds of application in ROS.
  • Low-level device control: When we work with robots, we may need to work with low-level devices, such as those that control I/O pins, sending data through serial ports, and so on. This can also be done using ROS.
  • Distributed computing: The amount of computation required to process the data from robot sensors is very high. Using ROS, we can easily distribute the computation to a cluster of computing nodes. This distributes the computing power and allows you to process the data faster than you could using a single computer.
  • Code reuse: The main goal of ROS is code reuse. Code reuse enables the growth of a good research and development community around the world. ROS executables are called nodes. These executables can be grouped into a single entity called a ROS package. A group of packages is called a meta package, and both packages and meta packages can be shared and distributed.
  • Language independence: The ROS framework can be programmed using popular languages (such as Python, C++, and Lisp). The nodes can be written in any language and can communicate through ROS without any issues.
  • Easy testing: ROS has a built-in unit/integration test framework called rostest to test ROS packages.
  • Scaling: ROS can be scaled to perform complex computation in robots.
  • Free and open source: The source code of ROS is open and it's absolutely free to use. The core part of ROS is licensed under a BSD license, and it can be reused in commercial and closed source products.

ROS is a combination of plumbing (message passing), tools, capabilities, and ecosystem. There are powerful tools in ROS to debug and visualize the robot data. There are inbuilt robot capabilities in ROS, such as robot navigation, localization, mapping, manipulation, and so on. They help to create powerful robotics applications.

The following image shows the ROS equation:

The ROS equation
Refer to http://wiki.ros.org/ROS/Introduction for more information on ROS.

ROS concepts

There are three main organizational levels in ROS:

  • The ROS filesystem
  • The ROS computation graph
  • The ROS community

The ROS filesystem

The ROS filesystem mainly covers how ROS files are organized on the disk. The following are the main terms that we have to understand when working with the ROS filesystem:

  • Packages: ROS packages are the individual unit of the ROS software framework. A ROS package may contain source code, third-party libraries, configuration files, and so on. ROS packages can be reused and shared.
  • Package manifests: The manifests (package.xml) file will have all the details of the packages, including the name, description, license, and, more importantly, the dependencies of the package.
  • Message (msg) types: Message descriptions are stored in the msg folder in a package. ROS messages are data structures for sending data through ROS's message-passing system. Message definitions are stored in a file with the .msg extension.
  • Service (srv) types: Service descriptions are stored in the srv folder with the .srv extension. The srv file defines the request and response data structure for the service in ROS.

The ROS Computation Graph

The ROS Computation Graph is the peer-to-peer network of ROS systems that processes data. The basic features of ROS Computation Graph are nodes, ROS Master, the parameter server, messages, and services:

  • Nodes: The ROS node is a process that uses ROS functionalities to process the data. A node basically computes. For example, a node can process the laser scanner data to check whether there is any collision. A ROS node is written with the help of an ROS client library (such as roscpp and rospy), which will be discussed in the upcoming section.
  • ROS Master: The ROS nodes can connect to each other using a program called ROS Master. This provides the name, registration, and lookup to the rest of the computation graph. Without starting the master, the nodes will not find each other and send messages.
  • Parameter server: The ROS parameters are static values that are stored in a global location called the parameter server. From the parameter server, all the nodes can access these values. We can even set the scope of the parameter server as private or public so that it can access one node or access all nodes.
  • ROS topics: The ROS nodes communicate with each other using a named bus called ROS topic. The data flows through the topic in the form of messages. The sending of messages over a topic is called publishing, and receiving the data through a topic is called subscribing.
  • Messages: A ROS message is a data type that can consist of primitive data types, such as integers, floating points, and Booleans. The ROS messages flow through the ROS topic. A topic can only send/receive one type of message at a time. We can create our own message definition and send it through the topics.
  • Services: We have seen that the publish/subscribe model using ROS topics is a very easy way of communicating. This communication method is a one-to-many mode of communication, meaning that a topic can be subscribed to by any number of nodes. In some cases, we may also require a request/reply kind of interaction, which is usually used in distributed systems. This kind of interaction can be done using ROS services. The ROS services work in a similar way to ROS topics in that they have a message type definition. Using that message definition, we can send the service request to another node that provides the service. The result of the service will be sent as a reply. The node has to wait until the result is received from the other node.
  • Bags: These are formats in which to save and play back the ROS topics. ROS bags are an important tool to log the sensor data and the processed data. These bags can be used later for testing our algorithm offline.

The following diagram shows how topics and services work between the nodes and the Master:

Communication between the ROS nodes and the ROS Master

In the preceding diagram, you can see two ROS nodes with the ROS Master in between them. One thing we have to remember is, before starting any nodes in ROS, you should start the ROS Master. The ROS Master acts like a mediator between nodes for exchanging information about other ROS nodes in order to establish communication. Say that Node 1 wants to publish a topic called /xyz with message type abc. It will first approach the ROS Master, and says I am going to publish a topic called /xyz with message type abc and share its details. When another node, say Node 2, wants to subscribe to the same topic of /xyz with the message type of abc, the Master will share the information about Node 1 and allocate a port to start communication between these two nodes directly without communicating with the ROS Master.

The ROS services works in the same way. The ROS Master is a kind of DNS server, which can share the node details when the second node requests a topic or service from the first node. The communication protocol ROS uses is TCPROS (http://wiki.ros.org/ROS/TCPROS), which basically uses TCP/IP sockets for the communication.

The ROS community level

The ROS community consists of ROS developers and researchers who can create and maintain packages and exchange new information related to existing packages, newly released packages, and other news related to the ROS framework. The ROS community provides the following services:

  • Distributions: A ROS distribution has a set of packages that come with a specific version. The distribution that we are using in this book is ROS Kinetic. There are other versions available, such as ROS Lunar and Indigo, which has a specific version that we can install. It is easier to maintain the packages in each distribution. In most cases, the packages inside a distribution will be relatively stable.
  • Repositories: The online repositories are the locations where we keep our packages. Normally, developers keep a set of similar packages called meta packages in a repository. We can also keep an individual package in a single repository. We can simply clone these repositories and build or reuse the packages.
  • The ROS wiki: The ROS wiki is the place where almost all the documentation of ROS is available. You can learn about ROS, from its most basic concepts to the most advanced programming, using the ROS wiki (http://wiki.ros.org).
  • Mailing lists: If you want to get updates regarding ROS, you can subscribe to the ROS mailing list (http://lists.ros.org/mailman/listinfo/ros-users). You can also get the latest ROS news from ROS Discourse (https://discourse.ros.org).
  • ROS answers: This is very similar to the Stack Overflow website. You can ask questions related to ROS in this portal, and you might get support from developers across the world (https://answers.ros.org/questions/).

There are many other features available in ROS; you can refer to the ROS official website at www.ros.org for more information. For now, we will move on to the installation procedure of ROS.

Installing ROS on Ubuntu

As per our previous discussion, we know that ROS is a metaoperating system that is installed on a host system. ROS is completely supported on Ubuntu /Linux and in the experimental stages on Windows and OS X. Some of the latest ROS distributions are as follows:

Distribution

Release date

ROS Melodic Morenia

May 23 2018

ROS Lunar Loggerhead

May 23 2017

ROS Kinetic Kame

May 23 2016

ROS Indigo Igloo

July 22 2014

We will now look at the installation procedure of the stable, long-term support (LTS) distribution of ROS called Kinetic on Ubuntu 16.04.3 LTS. ROS Kinetic Kame will be primarily targeted at Ubuntu 16.04 LTS. You can also find instructions to set up ROS in the latest LTS Melodic Morenia on Ubuntu 18.04 LTS after looking at the following instructions. If you are a Windows or OS X user, you can install Ubuntu in a VirtualBox application before installing ROS on it. The link to download VirtualBox is https://www.virtualbox.org/wiki/Downloads.

You can find the complete instructions for doing this at http://wiki.ros.org/kinetic/Installation/Ubuntu.

The steps are as follows:

  1. Configure your Ubuntu repositories to allow restricted, universe, and multiverse downloadable files. We can configure it using Ubuntu's Software & Update tool. We can get this tool by simply searching on the Ubuntu Unity search menu and ticking the shown in the following screenshot:
Ubuntu's Software & Update tool
  1. Set up your system to accept ROS packages from packages.ros.org. ROS Kinetic is supported only on Ubuntu 15.10 and 16.04. The following command will store packages.ros.org in Ubuntu's apt repository list:
    $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  1. Next, we have to add apt-keys. An apt-key is used to manage the list of keys used by apt to authenticate the packages. Packages that have been authenticated using these keys will be considered trusted. The following command will add apt-keys for the ROS packages:
    sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116  
  1. After adding the apt-keys, we have to update the Ubuntu package list. The following command will add and update the ROS packages, along with the Ubuntu packages:
    $ sudo apt-get update
  1. After updating the ROS packages, we can install the packages. The following command will install all the necessary packages, tools, and libraries of ROS:
      $ sudo apt-get install ros-kinetic-desktop-full 
  1. We may need to install additional packages even after the desktop full installation. Each additional installation will be mentioned in the appropriate section. The desktop full install will take some time. After the installation of ROS, you will almost be done. The next step is to initialize rosdep, which enables you to easily install the system dependencies for ROS source packages:
$ sudo rosdep init    
$ rosdep update
  1. To access ROS's tools and commands on the current bash shell, we can add ROS environmental variables to the .bashrc file. This will execute at the beginning of each bash session. The following is a command to add the ROS variable to .bashrc:
    echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc   

The following command will execute the .bashrc script on the current shell to generate the change in the current shell:

    source ~/.bashrc  
  1. A useful tool to install the dependency of a package is rosinstall. This tool has to be installed separately. It enables you to easily download many source trees for the ROS package with one command:
    $ sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential  
The installation of the latest LTS Melodic is similar to the preceding instructions. You can install Melodic along with Ubuntu 18.04 LTS. You can find the complete instructions at http://wiki.ros.org/melodic/Installation/Ubuntu.

After the installation of ROS, we will discuss how to create a sample package in ROS. Before creating the package, we have to create a ROS workspace. The packages are created in the ROS workspace. We will use the catkin build system, which is a set of tools that is used to build packages in ROS. The catkin build system generates an executable or shared library from the source code. ROS Kinetic uses the catkin build system to build packages. Let's look at what catkin is.

Introducing catkin

Catkin is the official build system of ROS. Before catkin, ROS used the rosbuild system to build packages. Its replacement is catkin on the latest ROS version. Catkin combines CMake macros and Python scripts to provide the same normal workflow that CMake produces. Catkin provides better distribution of packages, better cross-compilation, and better portability than the rosbuild system. For more information, refer to wiki.ros.org/catkin.

Catkin workspace is a folder where you can modify, build, and install catkin packages.

Let's check how to create an ROS catkin workspace.

The following command will create a parent directory called catkin_ws and a subfolder called src:

    $ mkdir -p ~/catkin_ws/src  

Switch directory to the src folder using the following command. We will create our packages in the src folder:

    $ cd ~/catkin_ws/src  

Initialize the catkin workspace using the following command:

    $ catkin_init_workspace  

After you initialize the catkin workspace, you can simply build the package (even if there is no source file) using the following command:

    $ cd ~/catkin_ws/
    $ catkin_make  

The catkin_make command is used to build packages inside the src directory. After building the packages, we will see a build and devel folder in catkin_ws The executables are stored in the build folder. In the devel folder, there are shell script files to add the workspace on the ROS environment.

Creating a ROS package

In this section, we will look at how to create a sample package that contains two Python nodes. One of the nodes is used to publish a Hello World string message on a topic called /hello_pub and the other node will subscribe to this topic.

A catkin ROS package can be created using the catkin_create_pkg command in ROS.

The package is created inside the src folder that we created during the creation of the workspace. Before creating the packages, switch to the src folder using the following command:

    $ cd ~/catkin_ws/src  

The following command will create a hello_world package with std_msgs dependencies, which contain standard message definitions. The rospy is the Python client library for ROS:

    $ catkin_create_pkg hello_world std_msgs rospy  

This is the message we get upon a successful creation:

    Created file hello_world/package.xml 
    Created file hello_world/CMakeLists.txt 
    Created folder hello_world/src 
    Successfully created files in /home/lentin/catkin_ws/src/hello_world. 
Please adjust the values in package.xml.

After the successful creation of the hello_world package, we need to add two Python nodes or scripts to demonstrate the subscribing and publishing of topics.

First, create a folder named scripts in the hello_world package using the following command:

    $ mkdir scripts  

Switch to the scripts folder and create a script named hello_world_publisher.py and another script called hello_world_subscriber.py to publish and subscribe to the hello world message. The following section covers the code and function of these scripts or nodes:

Hello_world_publisher.py

The hello_world_publisher.py node basically publishes a greeting message called hello world to a topic called /hello_pub. The greeting message is published to the topic at a rate of 10 Hz.

Here is a diagram that shows how the interaction between the two ROS nodes works:

Communication between the publisher and subscriber node
The full code of this book is available at https://github.com/qboticslabs/learning_robotics_2nd_ed.

The step-by-step explanation of how this code works is as follows:

  1. We need to import rospy if we are writing a ROS Python node. It contains Python APIs to interact with ROS topics, services, and so on.
  2. To send the hello world message, we have to import a String message data type from the std_msgs package. The std_msgs package has the message definition for standard data types. We can import using the following lines of code:
    #!/usr/bin/env python 
    import rospy 
    from std_msgs.msg import String 
  1. The following line of code creates a publisher object to a topic called hello_pub. The message type is String and the queue_size value is 10. If the subscriber is not fast enough to receive the data, we can use the queue_size option to buffer it:
    def talker():
        pub = rospy.Publisher('hello_pub', String, queue_size=10)   
  1. The following line of code initializes a ROS node. It will also assign a name to the node. If two nodes are running with the same node name, one will shut down. If we want to run both, use anonymous=True flag as shown in the following code:
    rospy.init_node('hello_world_publisher', anonymous=True)  
  1. The following line creates a rate object called r. Using a sleep() method in the Rate object, we can update the loop at the desired rate. Here, we are giving the rate the value of 10:
    r = rospy.Rate(10) # 10hz   
  1. The following loop will check whether rospy constructs the rospy.is_shutdown() flag. Then, it executes the loop. If we click on Ctrl + C, this loop will exit.

Inside the loop, a hello world message is printed on the Terminal and published on the hello_pub topic with a rate of 10 Hz:

    while not rospy.is_shutdown():  
        str = "hello world %s"%rospy.get_time()  
        rospy.loginfo(str)  
        pub.publish(str)  
        r.sleep() 
  1. The following code has Python __main__ check and calls the talker() function. The code will keep on executing the talker(), and when Ctrl + C is pressed the node will get shut down:
if __name__ == '__main__':  
    try:  
        talker()  
    except rospy.ROSInterruptException: pass 

After publishing the topic, we will see how to subscribe to it. The following section covers the code needed to subscribe to the hello_pub topic.

Hello_world_subscriber.py

The subscriber code is as follows:

#!/usr/bin/env python 
import rospy 
from std_msgs.msg import String 

The following code is a callback function that is executed when a message reaches the hello_pub topic. The data variable contains the message from the topic, and it will print using rospy.loginfo():

def callback(data): 
    rospy.loginfo(rospy.get_caller_id()+"I heard %s",data.data) 
 

The following steps will start the node with a hello_world_subscriber name and start subscribing to the /hello_pub topic:

  1. The data type of the message is String, and when a message arrives on this topic, a method called callback will be called:
    def listener(): 
       rospy.init_node('hello_world_subscriber', 
anonymous=True) rospy.Subscriber("hello_pub", String, callback)
  1. The following code will keep your node from exiting until the node is shut down:
       rospy.spin() 
  1. The following is the main section of the Python code. The main section will call the listener() method, which will subscribe to the /hello_pub topic:
if __name__ == '__main__': 
    listener() 
  1. After saving two Python nodes, you need to change the permission to executable using the chmod commands:
    chmod +x hello_world_publisher.py
    chmod +x hello_world_subscriber.py
  1. After changing the file permission, build the package using the catkin_make command:
    cd ~/catkin_ws
    catkin_make
  1. The following command adds the current ROS workspace path in all terminals so that we can access the ROS packages inside this workspace:
    echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
    source ~/.bashrc  

The following is the output of the subscriber and publisher nodes:

Output of the hello world node
  1. First, we need to run roscore before starting the nodes. The roscore command or ROS master is needed to communicate between nodes. So, the first command is as follows:
    $ roscore
  1. After executing roscore, run each node using the following commands:
    • The following command will run the publisher:
    $ rosrun hello_world hello_world_publisher.py  
    • The following command will run the subscriber node. This node subscribes to the hello_pub topic, as shown in the following code:
    $ rosrun hello_world hello_world_subscriber.py  

We have covered some of the basics of ROS. Now, we will see what Gazebo is and how we can work with Gazebo using ROS.

Introducing Gazebo

Gazebo is a free and open source robot simulator in which we can test our own algorithms, design robots, and test robots in different simulated environments. Gazebo can accurately and efficiently simulate complex robots in indoor and outdoor environments. Gazebo is built with a physics engine with which we can create high-quality graphics and rendering.

The features of Gazebo are as follows:

  • Dynamic simulation: Gazebo can simulate the dynamics of a robot using physics engines such as Open Dynamics Engine (ODE). (http://opende.sourceforge.net/), Bullet (http://bulletphysics.org/wordpress/), Simbody (https://simtk.org/home/simbody/), and DART (http://dartsim.github.io/).
  • Advanced 3D graphics: Gazebo provides high-quality rendering, lighting, shadows, and texturing using the OGRE framework (http://www.ogre3d.org/).
  • Sensor support: Gazebo supports a wide range of sensors, including laser range finders, Kinect-style sensors, 2D/3D cameras, and so on. We can also use it to simulate noise to test audio sensors.
  • Plugins: We can develop custom plugins for the robot, sensors, and environmental controls. Plugins can access Gazebo's API.
  • Robot models: Gazebo provides models for popular robots, such as PR2, Pioneer 2 DX, iRobot Create, and TurtleBot. We can also build custom models of robots.
  • TCP/IP transport: We can run simulations on a remote machine and a Gazebo interface through a socket-based message-passing service.
  • Cloud simulation: We can run simulations on the cloud server using the CloudSim framework (http://cloudsim.io/).
  • Command-line tools: Extensive command-line tools are used to check and log simulations.

Installing Gazebo

Gazebo can be installed as a standalone application or an integrated application along with ROS. In this chapter, we will use Gazebo along with ROS to simulation a robot's behavior and to test our written code using the ROS framework.

If you want to try the latest Gazebo simulator yourself, you can follow the steps given at http://gazebosim.org/download.

To work with Gazebo and ROS, we don't need to install them separately because Gazebo comes with the ROS desktop full installation.

The ROS package that integrates Gazebo with ROS is called gazebo_ros_pkgs. There are wrappers around the standalone Gazebo. This package provides the necessary interface to simulate a robot in Gazebo using ROS message services.

The complete gazebo_ros_pkgs can be installed in ROS Indigo using the following command:

    $ sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-
ros-control

Testing Gazebo with the ROS interface

Assuming that the ROS environment is properly set up, we can start roscore before starting Gazebo using the following command:

    $ roscore  

The following command will run Gazebo using ROS:

    $ rosrun gazebo_ros gazebo  

Gazebo runs two executables-the Gazebo server and the Gazebo client. The Gazebo server will execute the simulation process and the Gazebo client can be the Gazebo GUI. Using the previous command, the Gazebo client and server will run in parallel.

The Gazebo GUI is shown in the following screenshot:

The Gazebo simulator

After starting Gazebo, the following topics will be generated:

$ rostopic list  
/gazebo/link_states  
/gazebo/model_states  
/gazebo/parameter_descriptions  
/gazebo/parameter_updates  
/gazebo/set_link_state  
/gazebo/set_model_state  

We can run the server and client separately using the following commands:

  • Run the Gazebo server using the following command:
    $ rosrun gazebo_ros gzserver  
  • Run the Gazebo client using the following command:
    $ rosrun gazebo_ros gzclient  

Summary

This chapter was an introduction to Robot Operating System. The main goal of this chapter was to give you an overview of ROS, its features, how to install it, the basic concepts of ROS, and how to program it using Python. Along with this, we have looked at a robotics simulator called Gazebo, which can work with ROS. We have seen how to install and run Gazebo. In the next chapter, we will look at the basic concepts of differential drive robots.

Questions

  1. What are the important features of ROS?
  2. What are the different levels of concepts in ROS?
  3. What is ROS catkin build system?
  4. What are ROS topics and messages?
  5. What are the different concepts of the ROS Computation Graph?
  6. What is the main function of the ROS Master?
  7. What are the important features of Gazebo?
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Design, simulate, build, and program an interactive autonomous mobile robot
  • • Leverage the power of ROS, Gazebo, and Python to enhance your robotic skills
  • • A hands-on guide to creating an autonomous mobile robot with the help of ROS and Python

Description

Robot Operating System (ROS) is one of the most popular robotics software frameworks in research and industry. It has various features for implementing different capabilities in a robot without implementing them from scratch. This book starts by showing you the fundamentals of ROS so you understand the basics of differential robots. Then, you'll learn about robot modeling and how to design and simulate it using ROS. Moving on, we'll design robot hardware and interfacing actuators. Then, you'll learn to configure and program depth sensors and LIDARs using ROS. Finally, you'll create a GUI for your robot using the Qt framework. By the end of this tutorial, you'll have a clear idea of how to integrate and assemble everything into a robot and how to bundle the software package.

Who is this book for?

This book is for those who are conducting research in mobile robotics and autonomous navigation. As well as the robotics research domain, this book is also for the robot hobbyist community. You’re expected to have a basic understanding of Linux commands and Python.

What you will learn

  • • Design a differential robot from scratch
  • • Model a differential robot using ROS and URDF
  • • Simulate a differential robot using ROS and Gazebo
  • • Design robot hardware electronics
  • • Interface robot actuators with embedded boards
  • • Explore the interfacing of different 3D depth cameras in ROS
  • • Implement autonomous navigation in ChefBot
  • • Create a GUI for robot control

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 27, 2018
Length: 280 pages
Edition : 2nd
Language : English
ISBN-13 : 9781788629973
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 27, 2018
Length: 280 pages
Edition : 2nd
Language : English
ISBN-13 : 9781788629973
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 7,297.97
Learning Robotics using Python
₱1989.99
ROS Robotics By Example, Second Edition
₱2806.99
Python Robotics Projects
₱2500.99
Total 7,297.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Getting Started with Robot Operating System Chevron down icon Chevron up icon
Understanding the Basics of Differential Robots Chevron down icon Chevron up icon
Modeling the Differential Drive Robot Chevron down icon Chevron up icon
Simulating a Differential Drive Robot Using ROS Chevron down icon Chevron up icon
Designing ChefBot Hardware and Circuits Chevron down icon Chevron up icon
Interfacing Actuators and Sensors to the Robot Controller Chevron down icon Chevron up icon
Interfacing Vision Sensors with ROS Chevron down icon Chevron up icon
Building ChefBot Hardware and the Integration of Software Chevron down icon Chevron up icon
Designing a GUI for a Robot Using Qt and Python Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.1
(8 Ratings)
5 star 37.5%
4 star 12.5%
3 star 12.5%
2 star 0%
1 star 37.5%
Filter icon Filter
Top Reviews

Filter reviews by




Neeraj Jan 24, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A good book to learn robotics for beginners.
Amazon Verified review Amazon
Mathew Bob Aug 29, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This will be very useful to start building a new autonomous mobile robot
Amazon Verified review Amazon
Tao W. Sep 14, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It is a nice start for building a ROS system both in hardware and software, in every aspects of a robotic system.
Amazon Verified review Amazon
Praveen Nov 20, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Read few pages of the book and felt it is good for people who are starting to learn robotics. The book has info about how to design robot in CAD but there is no info about the ways to manufacture the robot(like 3D printing). I request the author to kindly include a couple of pages on manufacturing the hardware. Thank you.
Amazon Verified review Amazon
D Morris Nov 23, 2018
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Nicely organized intro to ROS. But i am not able to read more than half-way through, since at some point in the Kindle book, as when I scroll on to subsequent pages, the text columns narrow until they are a single-character wide, see the photo. So I only managed to read the first third or half of the book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.