Lablet AP 101 - Robot Operating
System (ROS): Filesystem, Topics
and Services
Lecture 1 - Introduction to ROS
Dr. Mukunda Bharatheesha
22-04-2021 19:30 - 20:30
https://www.artpark.in/
Lecture contents
- Introduction to Robot Operating System (ROS)
- Middleware concept
- ROS Distributions
- ROS Installation from Binaries
- Exploring the installed software packages
- ROS Environment variables
- Installation from source (advanced users, only discussed in the lab)
- ROS file system
- ROS workspace
- Folder structure in ROS packages
- Workspace build tool
- Basic introduction to ROS Docker container
Introduction to ROS
- A collection of Open Source software tools to speed up the process of complex behavior
design with robots [1].
- Provides a generic middleware layer to exchange information between physical robot
layer and a high level application layer.
Application Layer - Intelligent interaction of a robot with its environment
through complex behaviors
ROS Middleware - Set of software tools that enable information exchange
between physical and application layer.
Operating System (Laptop with Linux), Raspberry-Pi (Rapsbian Buster) +
Physical Layer (Robot hardware such as Turtlebot, Robot Arms, etc)
Introduction to ROS
- ROS software tools have evolved (new software + improvements to old software
(bugfixes, etc)) over the last 11 years since March 2010
- These new developments are versioned and released as ROS Distributions by ROS
developers [2].
ROS Installation
- ROS software tools from a desired ROS distribution can be binary installed following the
instructions on the ROS Wiki [3]
- Widely used on Ubuntu Operating System (also available for Windows10 and Debian, but
will not be discussed or done in this lablet.)
- Usually the installation proceeds without errors if all the instructions on the Wiki page are
correctly followed, but a few potential failure cases exist
- Bad network / loss of connectivity during install.
- Mirror sync scheduled on the servers hosting the binaries and packages we are
installing
ROS Installation
ROS Installation - Environment variables
ROS Workspace - Directory structure
- A directory structure to organize source code in a ROS project - Source space (‘src’)
- A “build tool” is used to build the source files in a workspace
- ‘catkin’ is a commonly used build tool
- Building a workspace generates three additional spaces - ‘build’, ‘devel’,
‘logs’
- ‘build’ space contains build artefacts such as build tool logs and auto
generated test packages in case tests are configured.
- ‘devel’ space contains environment setup files to update ROS specific
environment variables to use the workspace contents, binaries of the
compiled source files, etc.
- ‘logs’ space contains logs of the workspace build process.
- Since ‘catkin’ is the most commonly used build tool, ROS workspaces are
often called catkin workspace.
ROS Workspace - Directory structure
ROS Workspace - ROS development package
- A ROS package is a “special” folder where code that is developed by “YOU” is written.
- Two files distinguish a ROS package folder from others
- Existence of package.xml
- Existence of CMakeLists.txt
$ catkin_create_pkg <your_package_name> <your_package_deps>
Run the above command in the ‘src’ space.
ROS Workspace - ROS development package
Running ROS in a Docker container
- Docker is a containerization tool to enable the creation of a stand-alone development
environment [4]
- Prevents polluting your own laptop or desktop environment with installations you may not
use later
- Common in production systems.
FROM osrf/ros:melodic-desktop-full
USER root
RUN apt-get -y update && \
apt-get install -y wget && \
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release
-sc` main" > /etc/apt/sources.list.d/ros-latest.list' && \
wget http://packages.ros.org/ros.key -O - | sudo apt-key add - && \
apt-get -y update && \
apt-get install -y python-catkin-tools
Running ROS in a Docker container
- Specific directories on your host computer can be mounted inside the container
- All runtime dependencies are only needed in the container
- More on this in the lab session on Saturday
References:
[1] https://www.ros.org/about-ros/
[2] http://wiki.ros.org/Distributions
[3] http://wiki.ros.org/melodic/Installation/Ubuntu
[4] https://www.docker.com/