Book Image

ROS Robotics Projects - Second Edition

By : Ramkumar Gandhinathan
Book Image

ROS Robotics Projects - Second Edition

By: Ramkumar Gandhinathan

Overview of this book

Nowadays, heavy industrial robots placed in workcells are being replaced by new age robots called cobots, which don't need workcells. They are used in manufacturing, retail, banks, energy, and healthcare, among other domains. One of the major reasons for this rapid growth in the robotics market is the introduction of an open source robotics framework called the Robot Operating System (ROS). This book covers projects in the latest ROS distribution, ROS Melodic Morenia with Ubuntu Bionic (18.04). Starting with the fundamentals, this updated edition of ROS Robotics Projects introduces you to ROS-2 and helps you understand how it is different from ROS-1. You'll be able to model and build an industrial mobile manipulator in ROS and simulate it in Gazebo 9. You'll then gain insights into handling complex robot applications using state machines and working with multiple robots at a time. This ROS book also introduces you to new and popular hardware such as Nvidia's Jetson Nano, Asus Tinker Board, and Beaglebone Black, and allows you to explore interfacing with ROS. You'll learn as you build interesting ROS projects such as self-driving cars, making use of deep learning, reinforcement learning, and other key AI concepts. By the end of the book, you'll have gained the confidence to build interesting and intricate projects with ROS.
Table of Contents (14 chapters)

Setting up ROS on VirtualBox

As you know, complete ROS support is only present on Ubuntu. So, what about Windows and macOS users? Can't they use ROS? Yes, they can, using a tool called VirtualBox (https://www.virtualbox.org/). VirtualBox allows us to install a guest OS without affecting the host OS. The virtual OS can work along with the host OS in a given specification of a virtual computer, such as the number of processors and RAM and hard disk size.

You can download VirtualBox for popular OSes from the following link: https://www.virtualbox.org/wiki/Downloads.

The complete installation procedure for Ubuntu on VirtualBox is shown in the following tutorial video on YouTube: https://www.youtube.com/watch?v=QbmRXJJKsvs.

The following is a screenshot of the VirtualBox GUI. You can see the virtual OS list on the left-hand side and the virtual PC configuration on the right-hand side. The buttons for creating a new virtual OS and starting the existing VirtualBox are on the top panel. The optimal virtual PC configuration is shown in the following screenshot:

The VirtualBox configuration

Here are the main specifications of the virtual PC:

  • Number of CPUs: 1
  • RAM: 4 GB
  • Display | Video Memory: 128 MB
  • Acceleration: 3D
  • Storage: 20 GB to 30 GB
  • Network adapter: NAT

In order to have hardware acceleration, you should install drivers from the VirtualBox Guest addons disc. After booting into the Ubuntu desktop, navigate to Devices | Insert Guest Addition CD Image. This will mount the CD image in Ubuntu and ask the user to run the script to install drivers. If we allow it, it will automatically install all of the drivers. After a reboot, you will get full acceleration on the Ubuntu guest.

There is no difference in ROS installation on VirtualBox. If the virtual network adapter is in NAT mode, the internet connection of the host OS will be shared with the guest OS, so the guest can work the same as the real OS. We now have ROS set up on VirtualBox.

The next section is an introduction to Docker.