ROS for Beginners: Basics, Motion, and OpenCV
4.1 (1,932 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
8,136 students enrolled

ROS for Beginners: Basics, Motion, and OpenCV

Become an expert and Learn Robotics with Robot Operating System (ROS) in little time and don't be lost in broad docs
4.1 (1,932 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
8,136 students enrolled
Created by Anis Koubaa
Last updated 7/2020
English [Auto], Italian [Auto]
Current price: $13.99 Original price: $19.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 10.5 hours on-demand video
  • 6 articles
  • 9 downloadable resources
  • 1 Practice Test
  • Full lifetime access
  • Access on mobile and TV
  • Assignments
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Understand ROS Ecosystem (topics, nodes, messages, services, actionlib)
  • Develop simple applications to control robot motion
  • Understand how a position and orientation are represented in ROS
  • Recognize how to develop a C++/Python ROS project
  • Develop simple computer vision programs with ROS and OpenCV
  • Knowledge in C++ and/or Python Programming language.
  • Want to learn ROS
  • Eager to learn robotics

News and Updates.

  • Dec 11

    • I added slides of the course and Arduino code

  • Nov 06.

    • two lectures added on launch files and how to run multiple nodes at the same time in ROS.

  • Oct 15.

    • one lecture added on how to make a turtlebot 2 robot by just applying the same code of turtlesim to demonstrate how ROS is modular.

  • Oct 3.

    • 3 lectures added on motion in ROS using Python (linear, rotation and  go to goal). New code available on github

  • Sep 14:

    • 3 lectures added in Section 4 on how to create a custom ROS message and a publisher/subscriber application that uses the custom ROS message. An example of IoTSensor message is considered.

  • Sep 07:

    • new Ubuntu 16.04 + ROS Kinetic virtual machine available for students (upon request) to learn ROS without having to install it.

  • Sep 03:

    • 11 lectures (1 hour) on ROSSERIAL Arduino with real demonstration on Arduino Hardware and Ultrasonic sensor

  • Aug 27:

    • Three new lectures on OpenCV with C++, including CvBridge and how to manage dependencies.

  • Aug 26:

    • new assignment Turtlesim motion in Python

  • Aug 15:

    • Quiz on Laser Scanners

    • Subscriber ROS node for laser scanners (C++/Python)

    • Save scan topic messages into a rosbag file and replay it

  • Aug 12:

    • new lecture connect Asus Live Pro RGBD camera to ROS as laser scanner

    • new lecture connect URG Hukoyo Laser Scanner to ROS

  • Aug 11:

    • new lectures on Laser Range Finder

    Pre-Installed Virtual Machine: New ROS users who face difficulties to install ROS on their own will be provided a pre-installed virtual machine after enrolling to this course so they car start learning ROS without bothering much with installation issues. For this, you can send me a private message to request to VM and you will receive the link.

Why am I  teaching this course?

Typically, new ROS users encounter a lot of difficulties when they start programming with ROS. Although there are so many tutorials, there are a  lot of tips and practical issues that could not be easily found in tutorials and not discussed and left to the developer luckiness. In general, although there are many documentations for ROS, several are very broad and it takes too long to grasp well the concepts. This is where this course plays a role and provides an added value by providing focused introduction to the BASICS of ROS. The course does not only presents the basic concepts of ROS, but also addresses two important fields in robotics: (1) motion, (2) perception. We will apply the general concepts of ROS in the context of robotic motion and perception. The course will provide you an opportunity to learn about OpenCV, the most powerful computer vision library, that promote robotic perception. 

My approach is to take you STEP BY STEP through the roadmap of learning ROS so that you learn the concepts in the right order and help you build an experience from one lecture to the other.

This is a course that provides the fundamental concepts and basics of Robot Operating System (ROS). This course intends to give beginner ROS users with a quick and focused introduction on the basics of ROS, in addition to practical tips that helps them manage better their first projects with ROS in C++ and Python. In particular, developing with C++ in ROS requires special care as compared to Python to configure well the compilation and runtime environment. This is presented in clear manner in this course. 

There are mainly three majors steps in the course:

  1. ROS Basics and Foundation:  which deals with the general ROS concepts that everyone has to know, like ROS topics, Services, Messages, Nodes, ...

  2. Motion in ROS: We apply the concepts learned in Step 1 to make a robot move. We will develop different trajectory in the context of a nice example simulating a cleaning robot. In particular, we illustrate how to represent the pose (position and orientation) of a robot in ROS, and how to send motion control message to make the robot move. We clearly demonstrate how to implement a linear motion, a rotational motion, and spiral motion and how all of these be integrated to simulate a cleaning application. This part will you the background you need to understand robot kinematics and how motion is represented in ROS.

  3. Perception in ROS: I will introduce how a robot see the environment using a camera, how the images are collected in ROS and how they are processed in OpenCV. 

Based on my experience, these are the most important things any new ROS user has to know to be able to go further with his own robotics project. 

I also provide some hands-on activities that allows the learner to assess his understanding and push him to practice the concepts he learned. 

My experience with ROS

I have been programming with ROS for many years both in academic and industrial projects. I am very passionate to develop program with ROS. I have also been teaching ROS at the University and providing training programs. I am R&D Director of Gaitech Robotics, and I have developed many ROS packages for robots and drones. I have been leading international scientific activities around ROS, and in particular, I am the editor of three volumes of books with Springer entitled Robot Operating System, The Complete Reference. I gained a lot of experience on what difficulties new users encounter to learn ROS and this contributed to pin right to the point addressing these problems through the different lectures of the course. 

Welcome to the World of ROS. 

Who this course is for:
  • Beginner ROS developers and users
  • Students at Universities learning ROS
  • Anyone interest to know about the basic concepts of ROS
  • Curious about robotics
  • Whoever wants to learn ROS without wasting time
Course content
Expand all 93 lectures 10:41:20
+ Introduction
3 lectures 08:51

This video provides answers to some common questions by students.

The video will be updated with new questions that commonly show up.

Frequently Asked Questions
+ ROS: 
How did it revolutionize robotics software development
17 lectures 01:03:17

Abstract. Robot Operating System (ROS) becomes nowadays the de-facto standard for developing robotics applications. The pre-birth initiatives were emerging from STanford AI Robot (STAIR) project and Personal Robots (PR) program, which aimed at creating dynamic software systems for robotics applications, until 2007 when Willow Garage, a major robotics investor, boosted the development of this initiative and contributed to the release of the first ROS software packages in 2009. The first version of ROS was released in 2010 and nowadays ROS becomes the largest ecosystem and platform for robotics software development. In just a few years of its release, ROS has witnessed a huge community with an increasing number of users and developers from academia and industry, as well as hobbyists. How did ROS revolutionize robotics software development in just a few years? In this presentation, I will give an overview of ROS and its evolution in the past years after its release. I will unveil the secrets of ROS that makes it a revolutionary solution for developing robotics applications. I will share my experience, as a computer scientist working on robotics, developing robotics applications in the pre-ROS and post-ROS times, and how ROS made a complete shift in the software engineering and development approaches for mobile robots. The presentation will also give a small overview of the main concepts of ROS and the most important libraries and packages that comes with it. Video demonstrations and real illustrations will be presented.

About this section
Overview about the Robotics and Internet-of-Things Lab
Our current R&D projects
Why did I decided to use ROS in my work?
The Robot Life Cycle
ROS Impact
Self-Driving Car Use Case
ROS Evolution
ROS Distributions (version) over Time
ROS Architecture
ROS Basic Concepts and Demo
ROS Communication Paradigms (Topics/Services/ActionLib)
ROS Path Planning and Navigation
Limitation of ROS
Some Contributions to ROS
+ Installation and Environment Setup
8 lectures 29:06

In this video, I present the different ROS distributions and discuss how to choose among them. Then, I give some practical hints and guidelines for the installation of ROS and how to choose the appropriate operating system. 

ROS Installation Tips
The Link to the Pre-Installed Virtual Machine

In this lecture, I demonstrate how to install a Ubuntu virtual machine on Mac-OS to install and work with ROS on it.

Preview 03:57

In this video, I show how to install ROS Melodic on Ubuntu Bionic using the virtual machine installed in the previous video.

The process is the same to install any other ROS version

Install ROS (Melodic) on Ubuntu (Bionic)

In the previous lectures, I have demonstrated how to install ROS Melodic.

Although any version of ROS should work for most of the examples to be provided, I recommend to install ROS Kinetic for this course. It is exactly the same way I demonstrated for ROS Melodic.

To install ROS Kinetic, you can simple follow the steps in this link

In the same way I presented in the previous lecture.

Why ROS Kinetic?

The only issue with ROS Melodic is that it does not have all the packages of Turtlebot2 simulator. Thus, I recommend using ROS Kinetic to be able to follow the examples that uses Turtlebot2 simulator. However, all other examples should work with any version.

Having problems installing ROS?

Some students still face problems to install ROS although the process is simple. This might be due to various reason and it is not easy to provide support on this.

If for any reason you cannot install ROS, then I recommend you to use my pre-installed virtual machine.

For this, just send me a message and I will reply with sending the link.

[UPDATE] Note. Which version of ROS to use in this course?

This video provides you some pointers on how to select a good IDE to develop projects with ROS. 

This is rather an information that is not clear for new ROS users. 

Which Integrated Development Environment (ID) to use with ROS?
[UPDATE] Note: My recommendation of editor to use
+ ROS Ecosystem
4 lectures 41:51

In this lecture, I will explain the difference between a workspace and package in ROS and how to create them, and how to organize your ROS project. 

ROS Workspace and ROS Package (Setting up your ROS projects)

In this practice test, you will assess your knowledge about the creation of a workspace and package in ros

ROS Workspace and ROS Package
8 questions

In this lecture, I present you can download ROS package (project) that contains the code I will be explaining during this course. It is recommended to download the code before starting the next lecture. 

Setup ROS Project of the course using GitHub

In this video, I present ROS ecosystem and packages, and explain how to start roscore, the main node in ROS.

The ROS Master Node

In this tutorial, I explain the concepts of ROS nodes, ROS topics and ROS messages which are the key subjects that any ROS user has to understand very well to proceed further. I provide a clear illustrations of these concepts through demonstrations.

ROS Topics, Nodes and Messages
ROS Filesystem and Ecosystem
ROS Filesystem and Ecosystem
13 questions
+ ROS Topics
7 lectures 01:18:33

In this lecture, I present an overview of the theoretical background of ROS topics communication paradigm. This lecture will allow you to understand how ROS topics work and better follow the next lectures of this section. 

Preview 10:24
Write a ROS Publisher and Subscriber in C++

In this video, you will learn how to write a publisher node and a subscriber node in Python using ROS. You will understand to which extent using Python makes coding in ROS much simpler. 

Write a ROS Publisher and Subscriber in Python
In this assignment, you will apply the knowledge you learned in the previous lecture to make a robot move and track its location. You will learn which topics are used to control robot motion and determine its position. Let's get started!
Do-It-Yourself: Write your First ROS Program to Control the Motion of a Robot
4 questions
Create Custom ROS Messages: Overview
Create a Custom ROS Message: Implementation
IoTSensor Custom Message Publisher/Subscriber Applications
+ ROS Services
6 lectures 33:51
In this assignment, you perform some additional operation for ROS services of the Turtlesim simulator, to understand more the concept.
Do-It-Yourself: ROS Service Hands-On Practice
10 questions

When you write a ROS service, there are certain steps that you must follow. This video describes this steps before going to implementation details.

Steps to Write a ROS Service

In this video, I describe the ROS service to be implemented.

AddTwoInts Service Overview

In this lecture, I demonstrate how to wrote a service file and request response messages

Create the Service File and Request/Response Messages
Write ROS Service (Client/Server) in Python
Writing a ROS Service (Client/Service) in C++
In this exercise, you will develop a new ROS service by applying the concepts that you have learned in this section. The objective is to create a ROS service where a client sends two float numbers, width and height to the server, then the server will respond the area of the rectangle.
Rectangle Aera ROS Service (with video solution)
10 questions
+ Motion in ROS
9 lectures 01:33:21
Moving in a Straight Line
Rotate Left and Right
Spiral Control and Clearning Application
The objective of this assignment is to apply the concepts of the motion section to build a program in Python that does the same thing as the C++ version explained in the lectures.
Turtlesim Motion in Python
1 question
Assignment Solution: Linear Motion in ROS (Python)
Assignment Solution: Rotation Motion in ROS (Python)
Assignment Solution: Go-to-Goal Motion in ROS (Python)

In this video, I show how to use the same code of Turtlesim robot to make the robot Turtlebot 2 move. The only change needed is the topic name.

Turtlebot 2 Robot Motion
+ ROS Tools and Utilities
3 lectures 26:46
ROS Network Configuration

In this lecture, I explain the concept of launch files in ROS, and illustrate how to create a launch file and how to execute it with roslaunch to start multiple nodes at the same time. I also show why they are needed and important.

Launch Files (Part I): Running multiple nodes with roslaunch
Launch Files (Part II): including a launch file and define parameters
+ Perception I: Computer Vision in ROS with OpenCV
15 lectures 01:50:54

In this video, I present a brief overview of OpenCV and its functionalities for computer vision and images processing. 

Preview 04:18

In this video, I present how to install openCV for ROS and also other utilities that we will need in the practical lectures. 

Install OpenCV for ROS

In this lecture, I demonstrate how to open and saves images from and to files. 

Preview 06:10

In this video, I present the data structures used to manipulate images in OpenCV after loading them into the memory, and also the structure of a pixel and how it is represented. I present the different operations that could be done on these data structures to determine the properties of an image. 

OpenCV: Pixels and Image Structure (Python)

In this video, I present the different image encoding available in OpenCV and how to convert an image from one an encoding to another. Basically, we present grayscale, RGB, and Hue Saturation Value (HSV) encoding. 

OpenCV: Image Encoding (Python)

In this video, I explain how to use OpenCV to read a video stream from a USB camera and from a video file. 

OpenCV: Video Streams Input (Python)

In this video, I demonstrate some basic functionalities to draw shapes with OpenCv.

OpenCV: Drawing Shapes

In this video, I explain the functionality of CvBridge that converts images from ROS format to OpenCV format and vice-versa. 

CvBridge is an important tool in ROS to take benefit of all the powerful features of OpenCV in computer vision and image processing. 

CvBridge: Bridging OpenCV and ROS

The lecture describes how to transform an image into a binary image using thresholding techniques in OpenCV.

It discusses the difference between simple thresholding and adaptive thresholding and illustrate them using a real coding example.

Preview 09:47

In this video, I explain how to a filter a color for object detection using openCV. I explain why we need to use the HSV color space for color filtering and detection, and then apply it to detect a tennis ball with yellow color.

This is the first lecture in a series of lectures on tennis ball tracking.

Color Filtering in OpenCV (Tennis Ball use case)

In this video, I explain the concept of contours detection in OpenCV, also known as Edge detection. I demonstrate how to find contours and how to get their properties, like area, perimeter, enclosing circle, central point, ...

Contour detection will be used in the next video about ball detection to identify the properties of the ball detected in an image.

Contours Detection and Processing in OpenCV

In this video, I put all together and write a program that detects a tennis ball, determine its position in the image and surround it with a circle.

After finishing this video, you will need to do the next assignment which revises all the concepts learned in this section.

Tennis Ball Detection using OpenCV

Working with OpenCV in C++ in ROS presents additional challenges in particular adding appropriate dependencies. In this next videos, I will present how to work with OpenCV in C++ in ROS.

In this video, I will present how to read a video stream, process it and display it.

OpenCV (C++) 
Video Input/Output

In this video, I present how to open an image file and save a copy of it using OpenCV with C++.

OpenCV (C++) 
Open and Save Images

In this video, I present how to process ROS images with CvBridge in C++ with ROS and how to convert them from OpenCV format to ROS format and vice-versa. I also present what are the dependencies that must be added in the CMakeLists.txt to compile and execute the program.

OpenCV (C++) 
CvBridge: Bridging Images between OpenCV and ROS
In this project, you will extend the ball detection program by applying the concepts you learn in OpenCV and ROS to develop ball tracking programs that read video frames from a video file, a ROS Image topic and a USB camera through ROS. Let's get started!
Computer Vision Project: Ball Tracking with OpenCV and ROS
4 questions
+ Perception II: Laser Range Finders (Laser Scanner)
9 lectures 01:11:38

In this lecture, I present the main characteristics of laser range finders which help understanding which device to purchase for a certain robotics application.

Laser Range Finders Characteristics
Laser Range Finders Quiz
4 questions

In this video, I present a set of commercially available laser range finder and describe their characteristics and difference between them.

Commercial Laser Range Finder Devices

In this video, I demonstrate how to connect the Asus Live Pro RGBD Camera with ROS Kinetic and what are the different ROS packages that must be started to load the driver and convert the depth image of the camera into a laser scanner topic that provide information about the distance to obstacles.

Connect Asus Live Pro RGBD Camera as a Laser Scanner

In this lecture, I demonstrate how to connect URG sensor to ROS, visualize with rviz, and compare it with Asus Live Pro Camera.

Connect Hokuyo URG 4LX Laser Scanner with ROS

In this lecture, I show how to record laser scanner messages into a rosbag file (log files of ROS) and how to replay the same experiment and visualize it in Rviz.

Save Laser Scan Messages into a Bag File and Replay Them

In this lecture, I show how to write a ROS node for a subscriber to a scan topic and how to process scan data to derive statistics like max, min and average ranges

Write a ROS Node (Python) as a Subscriber to a Laser Scanner

In this lecture, I show how to write a ROS node in C++ for a subscriber to a scan topic and how to process scan data to derive statistics like max, min and average ranges. I also present my C++ libraries that I developed for processing data coming from laser scanner. I show how to include them in the ROS node and add them as libraries in CMakeLists.

Write a ROS Node (C++) as a Subscriber to a Laser Scanner