Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Hands-On ROS for Robotics Programming
Hands-On ROS for Robotics Programming

Hands-On ROS for Robotics Programming: Program highly autonomous and AI-capable mobile robots powered by ROS

Arrow left icon
Profile Icon Bernardo Ronquillo Japón
Arrow right icon
$31.99 $35.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (2 Ratings)
eBook Feb 2020 432 pages 1st Edition
eBook
$31.99 $35.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Bernardo Ronquillo Japón
Arrow right icon
$31.99 $35.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (2 Ratings)
eBook Feb 2020 432 pages 1st Edition
eBook
$31.99 $35.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$31.99 $35.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

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
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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

Hands-On ROS for Robotics Programming

Assembling the Robot

This chapter will provide you with a variety of practical assembly guidelines about the mobile robot that the content of this book is based on. With a very practical approach in mind, we'll deep dive into the characteristics of GoPiGo3 and what makes it an ideal platform to learn robotics.

First, we will focus on the hardware and talk about the components that every robot is composed of including the mechanical parts and embedded system, sensor, and motors.

After completing the GoPiGo3 assembly section, you will be acquiring manual skills so that you can start manipulating typical components in robotics. You will also be driven to adopt a systematic approach of applying partial verification tests while assembling your robot, also known as unit tests.

After introducing the GoPiGo3 robot in the first section of this chapter, we will explain these concepts in depth, including the embedded controller, the GoPiGo3 board, and the embedded computer, the Raspberry Pi.

Next, we will describe the sensors and actuators that the robot will use, grouped into what we will call the electromechanics.

Finally, we will provide you with some useful guidelines so that assembling the robot is straightforward. Then, we will test the GoPiGo3 robot using its easy-to-start software, DexterOS. Even though we will adopt Ubuntu as an operating system for running ROS later in this book, it is recommended that you start with DexterOS so that you familiarize yourself with the hardware while avoiding specific software programming tasks, which is something that will be left for later chapters.

In this chapter, we will cover the following topics:

  • Understanding the GoPiGo3 robot
  • Getting familiar with the embedded hardware – GoPiGo3 board and Raspberry Pi
  • Deep diving into the electromechanics motors, sensors, and 2D camera
  • Putting it all together
  • Hardware testing using Bloxter (visual programming) under DexterOS

Understanding the GoPiGo3 robot

GoPiGo3 is a Raspberry Pi-based robot car manufactured by Dexter Industries. It is intended to be used as an educational kit for learning about both robotics and programming, two complementary perspectives that clearly show the transversal knowledge you should acquire to become a robotics engineer. We'll explain what this means by letting Nicole Parrot, Director of Engineering at Modular Robotics, explain it in her own words:

"The GoPiGo originated from a Kickstarter campaign in early 2014 when the Raspberry Pi was still somewhat new. The first users were hobbyists, but soon teachers and coding club volunteers were sharing their GoPiGo with their students. This lead to various changes being made to the board to make a classroom-ready robot. It's robust, it has a full list of features, and it's still based on the Raspberry Pi! The latest iteration has been around since 2017 and is a stable platform.

A Raspberry Pi-based robot offers quite a few advantages in the classroom. It can be programmed in an array of languages, it can be independent of the school Wi-Fi while not requiring Bluetooth, and it can perform advanced applications right on the board, such as computer vision and data collection. The GoPiGo with DexterOS comes with scientific libraries all preinstalled. The GoPiGo with Raspbian for Robots allows the user to install whatever libraries and tools are required for the project at hand. It comes with two Python libraries: easygopigo3.py and gopigo3.py. Both of these offer high-level control of the robot and low-level control, depending on the user's technical skills.

The GoPiGo has become the premier go-to robot for universities, researchers, and engineers seeking a simple, well-documented robot for the Raspberry Pi."

Ready to dive into robotics? Let's go!

The robotics perspective

From the robotics perspective, you will learn how to work with the basic parts:

  • Motors, which allow the robot to move from one point to another. In GoPiGo3, we have DC motors with built-in encoders that provide a precise motion. This is one of the main upgrades from GoPiGo2, where the encoders were external to the motors and not very accurate.
  • Sensors, which acquire information from the environment, such as the distance to near objects, luminosity, acceleration, and so on.
  • The controller—that is, the GoPiGo3 red board—handles the physical interface with sensors and actuators. This is the real-time component that allows GoPiGo3 to interact with the physical world.
  • A single-board computer (SBC) Raspberry Pi 3B+, which provides processing capacity. As such, it works under an operating system, typically a Linux-based distribution, providing wide flexibility from a software point of view.

Most educational kits stop at a level-3 controller; they do not include a level-4 single-board computer. The software in the controller is a small program (only one) that is embedded in the board. Every time you want to modify the code for the robot, you have to fully replace the existing program and flash the new version from an external computer while using the serial connection over a USB port.

A classic example of this is an Arduino-controlled robot. Here, the Arduino board plays the role of our GoPiGo3 board, and if you have worked with it, you will surely remember how you needed to transfer the new program from the Arduino IDE on your laptop to the robot through a USB cable.

The programming perspective

From the programming perspective, GoPiGo3 allows you to start easy by learning a visual programming language, Bloxter, a fork of the open source Google Blockly, that was specifically developed for GoPiGo3. This is a very comfortable prerequisite when it comes to learning about the basic concepts of writing software programs.

But if you are reading this book, we are sure you already know how to program in one of the many available languages, that is, C, C++, Java, JavaScript, or Python. Dexter Industries provides various open source libraries (https://github.com/DexterInd/GoPiGo3/tree/master/Software) that you can use to program GoPiGo3. Some of them are as follows:

  • C
  • C#
  • Go
  • Java
  • Node.js (JavaScript)
  • Python
  • Scratch

In any case, in this first chapter, we encourage you to only use Bloxter to emphasize the robotics perspective and become familiar with the hardware you have in your hands. After that, you may use your choice of language, given the many GoPiGo3 application programming interfaces (APIs) that are available.

In this book, we will focus on Python as the primary language to program in ROS. The Python language is easier to learn while still being very powerful and predominant in robotics and computer science. After going through some Python examples in Chapter 2, Unit Testing GoPiGo3, we will get started with the Robot Operating System (ROS), which isn't an actual programming language but a development application framework for robots. As such, we will show you how to adapt your Python programs with wrappers so that they can also run within ROS as pieces for building high-level functionalities.

You will appreciate the added value of such a jump to ROS when you discover how many more things GoPiGo3 can do when its Python base of code is wrapped with ROS. This software upgrade provides GoPiGo3 with a toolkit that allows students, creators, and engineers to understand how robots work. Furthermore, you should be aware that the ROS is commonly used in professional environments.

Robot kit and resources

At a high level, we can group the hardware of the robot into two sets:

  • Electromechanics: This refers to the sensors and actuators that allow it to interact with the physical world.
  • Embedded hardware: The electronic boards that allows it to acquire a signal from the sensors, convert it into a digital signal, and provide the processing logic and send commands to the actuators. Here, we typically have two types of electronic boards:
    • The controller, which serves as the physical interface with the sensors and actuators—that is, the GoPiGo3 board. The controller deals with both analog and digital signals from the electromechanical devices, transforming them into digital signals that can be processed by a CPU.
    • The computer, which provides us with the means to implement intelligent logic. In most robots, this is an SBC. In the case of GoPiGo3, this is the Raspberry Pi running a Linux OS distribution, such as Raspbian or Ubuntu.

Although you could directly connect digital devices to the Raspberry Pi through its general purpose input/output (GPIO) pins, from a functional point of view, it is better to interface all the sensors and actuators through the controller—that is, the GoPiGo3 board: keep the interface with the physical world at the controller level and do the processing and computation at the computer level.

If you are a regular Raspberry Pi user and own the board, you only need to purchase the GoPiGo3 Robot Base Kit (https://www.dexterindustries.com/product/gopigo3-robot-base-kit/). This kit includes the following:

  • GoPiGo3 board (red board)
  • Chassis (frame, wheels, hardware)
  • Motors
  • Encoders
  • Power battery pack and cable
  • Screwdriver for assembly

The following image shows all the parts that are included:

Image courtesy: Dexter Industries: https://shop.dexterindustries.com/media/catalog/product/cache/4/thumbnail/1800x2400/9df78eab33525d08d6e5fb8d27136e95/g/p/gpg3_components_rgb.jpg

The following image shows the assembled kit (without the Raspberry Pi):

Image courtesy: Dexter Industries: https://32414320wji53mwwch1u68ce-wpengine.netdna-ssl.com/wp-content/uploads/2017/05/GPG3_BaseKit_2.jpg

The batteries (8 AA 1.2 V) are not included. Although you can use cheaper replaceable units, it is strongly advised that you use rechargeable batteries. In the long term, it will be cost-effective and environmentally friendly.

Apart from the kit, you will need to add a Raspberry Pi 3 and its Micro SD card; otherwise, especially if you are new to the Raspberry Pi world, you would be better off buying the GoPiGo3 Beginner Starter Kit (https://www.dexterindustries.com/product/gopigo-beginner-starter-kit/), which includes the Raspberry Pi 3 and its accessories, as well as an orientable distance sensor equipped with a servo-motor, allowing it to cover a 180° field of view. This sensor set is composed of the following:

The following image shows the final aspect of the Beginner Starter Kit, once it's been assembled. The same result can be obtained with the Robot Base Kit by adding the Raspberry Pi and the orientable distance sensor:

Image courtesy: Dexter Industries: https://www.robotshop.com/media/catalog/product/cache/image/380x380/9df78eab33525d08d6e5fb8d27136e95/g/o/gopigo3-beginner-starter-kit.jpg

Now that we've looked at the GoPiGo3 robot, it's time to cover the technical details regarding the embedded hardware and the electromechanics.

Getting familiar with the embedded hardware

Do you remember which hardware is for what? The GoPiGo3 board is for interfacing with sensors and actuators, while Raspberry Pi is used for computing tasks. We will cover these topics in detail here.

The GoPiGo3 board

This customized board (https://www.dexterindustries.com/GoPiGo/learning/hardware-port-description/) provides the general features that are expected from a controller:

  • Real-time communication with sensors and actuators.
  • Interface input/output (I/O) through a serial peripheral interface (SPI) that feeds the data from the sensors to the Raspberry Pi and may also receive commands for the actuators (also from the Raspberry Pi, after running the logic in its CPU for every step of the control loop).
  • One single program loaded on board, known as the firmware. Since the goal of this software is to implement a communication protocol while the computer implements the logic, it doesn't need to be changed unless you decide to upgrade it when a new version is available.

Let's briefly explain the input/output interface protocol that we mentioned in the preceding bullet point list. SPI is a bus that's used to send data between microcontrollers and external devices, which are sensors, in our case. It uses separate clock and data lines, along with a select line to choose the device to talk to. The side of the connection that generates the clock is called the master, which is the Raspberry Pi in our case, while the other side is called the slave, which is the GoPiGo3 board. This way, both boards are synchronized, resulting in a faster form of communication than asynchronous serial, which is the typical communication protocol in general-purpose boards such as Arduino.

You can find out more about the SPI protocol in an easy-to-follow tutorial at https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi. Communication over SPI with the Raspberry Pi occurs through the headers interface, which can be seen in the top part of GoPiGo3 board in the following image. Only five out of the 40 GPIO pins are needed for such an interface:

Image courtesy: Dexter Industries: https://32414320wji53mwwch1u68ce-wpengine.netdna-ssl.com/wp-content/uploads/2014/07/GoPiGo3-Bottom_annotated-600x441.jpg

For interfacing with devices, the board provides the following (a top view of the board can be seen in the next diagram):

  • Two I2C ports—two Grove ports connected to the Raspberry Pi I2C bus through a level-conversion chip
  • One serial port—one Grove port connected to serial pins on the Raspberry Pi through a level-conversion chip
  • Two analog-digital ports—two Grove ports connected to the GoPiGo3 microcontroller
  • Two servo ports for the PWM type servomotor:
Image courtesy: Dexter Industries: https://32414320wji53mwwch1u68ce-wpengine.netdna-ssl.com/wp-content/uploads/2014/07/GoPiGo3-Top-768x565.jpg

Let's explain these new concepts:

  • Serial port: This is the complimentary communication protocol we mentioned previously when we talked about the SPI. While the last is synchronous (it needs five interface pins), the serial port is asynchronous—that is, there is no clock signal to follow and only two pins are needed: Tx for data transmission and Rx for data reception. In GoPiGo3, this port is directly connected to the Raspberry Pi serial pins through a level-conversion chip.
  • I2C ports: As its name suggests, this uses the I2C communication protocol. Just like SPI, it is a synchronous protocol, faster than asynchronous serial. I2C uses two lines, SDA for data and SCL for the clock signal. The third and fourth wires are for the power supply: VIN at 5V and the GND ground—that is, a 0V reference. SDA is bidirectional, so any of the connected devices can send or receive data. In these two ports, you will connect the distance sensor and the line follower sensor.
  • Analog-digital: These ports can connect to analog, digital, or I2C Grove devices. We will be connecting to one of the analog-digital port, the IMU sensor. We will talk about this in more detail later.
  • Servo ports, that connect PWM servomotors: These are cheaper and easier to control than encoder-equipped motors, all while offering enough accuracy to control the orientation of the support they will hold. In GoPiGo3, we can attach the distance sensor or the Pi camera to a servo motor. Pulse Width Modulation (PWM) technology refers to having control in a continuous range by changing the duty cycle of the voltage supply, resulting in an equivalent output ranging from 0V to 5V: 0V is the 0% duty cycle, while 100% corresponds to 5V being applied during the entirety of the cycle. By applying 5V for a percentage of the period lower than 100%, you get continuous control of the position, ranging from 0 to 180° rotation of the motor shaft. For an explanation about this, along with some useful figures, go to https://www.jameco.com/jameco/workshop/howitworks/how-servo-motors-work.html.

Raspberry Pi 3B+

Raspberry Pi has the largest community both in terms of education and the industry, which makes it the best single-board computer of choice when developing embedded software for robots or for Internet of Things (IoT) devices. The following image shows the Raspberry Pi 3B+, the most common model that powers GoPiGo3:

Image courtesy: https://en.wikipedia.org/wiki/File:Raspberry_Pi_3_B%2B_(39906369025).png, License CC BY-SA 2.0

The main characteristics of Raspberry Pi 3B+ are as follows:

  • A Central Processing Unit (CPU) composed of four Cortex-A53 1.4 GHz.
  • A Graphics Processing Unit (GPU) is a Broadcom VideoCore IV at 250 MHz.
  • The Synchronous Dynamic Random-Access Memory (SDRAM) is 1 GB, which is shared with the GPU.
  • On-board storage is provided through a MicroSDHC slot. You can choose whatever micro SD card size fits your needs. In any case, the general recommendation is to use a class-10 micro SD of 16 GB capacity—10 means that it is able to be written at 10 Mb/second.

Let's go over the functionality of each of these components:

  • The CPU provides the computation capacity to run all kinds of algorithms. This is where the intelligence of our robot resides.
  • The GPU's mission is to handle computer graphics and image processing. In our case, it will mostly be devoted to processing the images from the Pi camera and providing computer vision capabilities.
  • SDRAM has 1 GB volatile storage that's shared with the GPU, so this is a balance of how much memory you assign to the GPU (by default, it takes up to 64 Mb). RAM is where the program is loaded so that it can be executed.
  • On-board microSD card is the persistent storage that contains the operating system as well as all the installed software.

Raspberry Pi runs an operating system, typically a Linux-based distribution such as Debian or Ubuntu.

Although Raspbian—the Debian-based distro by the Raspberry Pi Foundation—is the official distribution, we will be using Ubuntu—supported by Canonical—because it's the platform that Open Robotics (https://www.openrobotics.org) uses to deliver a version of ROS every year, synchronized with the yearly versions of Ubuntu.

Why does a robot need a CPU?

Apart from the fact that this book's goal is to get you some hands-on experience with ROS—and for that, you need a Linux OS to install the software on—if you really want to create a smart robot, you need the processing capacity to run compute-intensive algorithms, and that is what a CPU such as Raspberry Pi provides.

Why is this computation needed? Because a smart robot has to integrate information from the environment with the logic of the task at hand to be able to complete it successfully. Let's use the example of carrying one object from its current position to a target destination. To do so, devices such as a laser distance sensor, a 3D camera, and/or a GPS provide the robot with information from the environment. These sources of data have to be combined so that the robot is able to locate itself in the environment. By supplying a target destination, it also has to compute the optimum path to carry the object on, something that it is called path planning. When executing such a path plan, it has to detect obstacles that may appear along the path and avoid them without losing focus of the goal. Hence, every step of the task involves executing an algorithm in the CPU of the robot.

This is one of the many practical scenarios that you will learn to solve using ROS, which is currently the de facto industry standard for the development of robotics applications.

Deep diving into the electromechanics

As explained in GoPiGo's official documentation (https://www.dexterindustries.com/GoPiGo/learning/technical-specifications-for-the-gopigo-raspberry-pi-robotics-kit/), the specifications of the GoPiGo3 robot are as follows:

  • Operating voltage: 7V-12V
  • External interfaces:
    • I2C ports: Two Grove ports connected to the Raspberry Pi I2C bus through a level-conversion chip
    • Serial ports: One Grove port connected to the serial pins on the Raspberry Pi through a level-conversion chip
    • Analog digital ports: Two Grove ports connected to the GoPiGo3 microcontroller
  • Encoders: Two magnetic encoders with six pulse counts per rotation (with 120:1 gear reduction for a total of 720 pulses per wheel rotation)
  • Wheels diameter: 66.5 mm
  • Distance between wheels: 117 mm
  • More: Design information is available at the official GitHub repository (https://github.com/DexterInd/GoPiGo3)

This is just a summary of what we explained in the section titled The GoPiGo3 board. In this section, we will concentrate on describing the devices that are connected to the GoPiGo3 board.

The most useful sensors

The sensors we are going to mount onto the GoPiGo3 are the ones that we need in order to accomplish the top-level task of the robot—that is, navigation with motion planning, while keeping costs low. These sensors are as follows:

  • Distance sensor
  • Line follower
  • Inertial Measurement Unit (IMU) sensor
  • 2D camera

In the case of using the line-follower sensor, since the robot will follow a marked path on the floor (usually painted in black), the motion-planning part can be skipped and navigation will be much easier. If there is an obstacle on the path, you will have to apply an algorithm to move around the obstacle and return to the path—that is, place the line-follower sensor above the black line again.

Now, we should take the time to understand what information each sensor provides. Later in this book, you will encounter such a navigation problem and the algorithms that can be used to implement it.

Distance sensor

The simple distance sensor allows us to measure the distance to the object in front of it. It has a small laser that measures the distance to an object. The sensor applies the time of flight method for a very fast and accurate distance reading. The product page can be viewed at https://www.dexterindustries.com/product/distance-sensor/:

Image courtesy: Dexter Industries: https://shop.dexterindustries.com/media/catalog/product/cache/4/image/1800x2400/9df78eab33525d08d6e5fb8d27136e95/d/e/dexter-industries-raspberry-pi-robot-distance-sensor-for-robots-front-of-sensor-1.jpg

You can connect the distance sensor to any of the two I2C ports. Be aware that the GoPiGo3 software libraries will not ask you to specify which of the two ports you are using. This will be detected automatically.

You can mount the sensor onto a servo package to scan a wide angle of about 180°. The servomotor can be connected to either servo port 1 or servo port 2. The product page can be viewed at https://www.dexterindustries.com/product/servo-package/:

Image courtesy: Modular Robotics: https://www.dexterindustries.com/wp-content/uploads/2019/09/GoPiGo3-Molded-Servo-Frontal-300x200.jpg

In Chapter 2, Unit Testing of GoPiGo3, there is a specific test you can run with your robot to check that this unit works properly.

Line follower

The line follower of GoPiGo3 is composed of six pairs of LED phototransistors. The LED emitter is the right-most part of each pair when you position the sensor in front of you to read the letters. This can be seen in the following photograph, which is a picture of the powered sensor, although you cannot yet see the LED light beams:

Why don't you see them in the picture? Because LEDs emit infrared light, which can't be detected by your eyes; however, it can be revealed by a phone camera (by default, the optics of these cameras do not include infrared filters). So, if, later on, you find that the line follower does not work properly, the first thing you must check is the hardware. To do this, simply take a photo with the camera app that ships with your smartphone.

In the following image, the sensor view has been intentionally blurred so that you can see the rays and confirm that the light beams come from the right-hand side of the LED phototransistor. The receiving part—that is, the phototransistor—is the component that detects whether there is reflected light coming from the LED emitter. The product page for this component can be viewed at https://www.dexterindustries.com/product/line-follower-sensor/:

Now, you are in a position to understand the working principles of the line-follower sensor:

  • If the rays are reflected off the floor because it is white, the phototransistor receives the mirrored beam and provides this information in the data sensor stream.
  • If the sensor is over a black surface, the phototransistor does not receive any reflected light and lets the robot know.

Reflection makes the sensor electronics report a signal close to 1 (white surface), while absorption provides a value close to 0 (black surface). But what if the sensor is far away from the floor or not facing it? Well, from the point of view of the sensor, absorption is equivalent to the lack of reflection. Therefore, the reported signal is close to zero. This property allows GoPiGo3 not only to follow a black path on the ground, but also to walk along edges avoiding drops that could damage the robot.

Since you have six pairs, you will have six signals, where each reports 0 or 1. These six numbers will allow us to infer how well centered the robot is over a black line. The sensor's specifications are as follows:

The following is a bottom view of the emitter-receiver. This face is the one that has to be a few millimeters above the floor to ensure a proper reflection of the LED's emission:

Image courtesy: Modular Robotics: https://shop.dexterindustries.com/media/catalog/product/cache/4/thumbnail/1800x2400/9df78eab33525d08d6e5fb8d27136e95/l/i/linefollower_bottom.jpg

The following image shows the line follower sensor mounted on the GoPiGo3 at the proper position—that is, above the floor:

Image courtesy: Modular Robotics: http://www.dexterindustries.com/wp-content/uploads/2019/03/linefollowerinaction.jpg

For instructions on how to assemble and calibrate the sensor, go to https://www.dexterindustries.com/GoPiGo/line-follower-v2-black-board-getting-started/. For connecting, you can use either of the two available I2C connectors on the line-follower sensor. Remember that one of them will be in use by the distance sensor.

The line follower can also be connected to one of the AD ports if you are using Raspbian For Robots (https://www.dexterindustries.com/raspberry-pi-robot-software/). It's for more advanced use, and coding for this setup is slightly different.

For the purposes of introducing robotics, we will take it easy by connecting the sensor to an I2C port and use the more friendly DexterOS (https://www.dexterindustries.com/dexteros/). In Chapter 2, Unit Testing of GoPiGo3, we will go over a specific test you can run with your robot to check that this unit works properly.

IMU sensor

The IMU sensor allows us to measure the orientation of the robot, as well as obtain an estimation of its position as it moves. The product page of the Dexter Industries IMU can be viewed at https://www.dexterindustries.com/product/imu-sensor/. The respective aspect of the sensor can be seen in the following image:

Image courtesy: Dexter Industries: https://shop.dexterindustries.com/media/catalog/product/cache/4/thumbnail/1800x2400/9df78eab33525d08d6e5fb8d27136e95/i/m/imu-sensor_mount2-800x800.jpg

In the following image, you can see it mounted on the GoPiGo3. To connect to the robot, you only have to plug it into either AD1 or AD2 on the GoPiGo board:

Image courtesy: Dexter Industries: https://shop.dexterindustries.com/media/catalog/product/cache/4/thumbnail/1800x2400/9df78eab33525d08d6e5fb8d27136e95/i/m/imu-sensor_gpg3_3.jpg

This IMU has nine degrees of freedom (DOF), plus temperature measurement capabilities. Let's talk about each sensor of the IMU and what kind of data they provide:

  • Let's start with the simpler one, the temperature. This provides the ambient room temperature and can be used in combination with the rest of the sensors to create, for example, a temperature map of a room, by taking measurements at several locations as the GoPiGo3 covers the surface.
  • The accelerometer is an absolute sensor because its value is always referred to as zero acceleration (static object). It provides a value for each of the three axes, X, Y, and Z:
    • It is good for measuring the inclination of the robot (an angle whose cosine is the vertical acceleration divided by the value of gravity = 9.81 m/s²) and the free-fall condition, which is equivalent to a 90° ramp and is a vertical wall (gravity is continuously detected by the sensor—that is, 9.81 m/s², if the object stays in a horizontal plane).
    • The accelerometer is not as accurate for the measurement of velocity because this value is not directly provided by the sensor. We can obtain it by performing the integral of the acceleration signal over time, which produces cumulative errors (drift), mainly coming from the sensor noise (electronics) and the measurement error itself. This is where the gyroscope comes into the picture to provide an accurate speed measurement.
    • The gyroscope is a differential sensor that provides the three rotations (X, Y, and Z axes) with respect to an arbitrary reference. What they really provide is the rotation velocity. This means that they are accurate for measuring rotation velocities, but not good for measuring angular position (you have to integrate of the speed signal over time, accumulating measurement errors and sensor noise, thereby producing drift).

A six-DOF IMU will be one that combines the accelerometer (three DOFs) and gyroscope (three DOFs):

  • The accelerometer accurately measures the inclination with respect to the vertical. It does not have drift in the medium/long term, but is not accurate for short-term measurements.
  • The gyroscope accurately measures rotation velocities, but they have drift. This means that they are not good for medium/long-term measurements.

By combining the six values from the accelerometer and gyroscope, it is possible to obtain an improved measurement of the orientation. This is expressed by means of the Euler angles—α, β, γas shown in the following diagram:

Image courtesy: https://commons.wikimedia.org/wiki/File:Euler_angles_zxz_int%2Baxes.png, License CC BY-SA 4.0

Something's that's more commonly used than the Euler angles are the Tait-Bryan version or navigation angles, roll-pitch-yaw, which can be defined as follows:

Image courtesy: https://es.m.wikipedia.org/wiki/Archivo:Flight_dynamics_with_text.png, License CC BY-SA 3.0

These angles are obtained by applying a special filter, called a complimentary filter, to the sensor's signals. It works like this:

  • For the signal from the accelerometer, it behaves as a low-pass filter since we trust its medium/long-term measurement.
  • For the signal from the gyroscope, it behaves as a high-pass filter since we trust its short-term measurement.

Mathematically, the complimentary filter is expressed as follows:

Here, A and B has to sum 1. These constants are determined by the calibration of the sensor, and typical values include A = 0.98, B = 0.02. The complimentary filter offers very similar results to the Kalman filter, which is the best linear (unbiased) estimator (BLE) but more computationally intensive.

Now, we have three rotations (about the X, Y, Z axes), but they are not absolute angles just yet:

  • Thanks to the accelerometer, the orientation with respect to the vertical is an absolute reference, but for the orientation on the horizontal plane we are lacking such a reference because the gyroscope is a differential sensor.
  • This is where the magnetometer appears to give us the orientation (three axes X, Y, Z) of the Earth's magnetic field.

Therefore, with our 6 + 3 = 9 DOFs IMU, we have the absolute orientation of our robot, with the gravity and the magnetic field vectors as references. In Chapter 2, Unit Testing of GoPiGo3, we'll go over a specific test you can run with your robot to check that this unit works properly.

Pi Camera

The Pi Camera is a custom 2D camera with a Camera Serial Interface (CSI). The following image shows the two physical components—that is, the camera's electronic board and a ribbon cable:

Image courtesy: https://commons.wikimedia.org/wiki/File:Raspberry_Pi_Camera_Module_v2_with_ribbon.jpg, License CC BY-SA 4.0

In the following image, we can see how the ribbon is connected to the CSI port of the Raspberry Pi:

Image courtesy: https://www.flickr.com/photos/nez/9398354549/in/photostream by Andrew, License: CC BY-SA 2.0

The Pi Camera is able to provide an HD resolution (1920 x 1080 pixels) up to a frame rate of 30 frames per second (FPS). You can find the possible configurations for this in the documentation at https://picamera.readthedocs.io/en/release-1.12/fov.html. In Chapter 2, Unit Testing of GoPiGo3, we'll go over a specific test that you can run with your robot to check that this unit works properly.

Putting it all together

Now that you are familiar with the hardware, it is time to put everything together, connect it, and run a quick test to check that GoPiGo3 works properly. The assembly process is very well documented in a step-by-step guide in the official documentation, along with plenty of figures and photos; you can find this documentation at https://www.dexterindustries.com/GoPiGo/get-started-with-the-gopigo3-raspberry-pi-robot/1-assemble-gopigo3/.

Alternatively, you can use the Workbench training environment at https://edu.workbencheducation.com/ and register a personal account for free to go through the same assembly process while registering your progress. If you do, then follow the two assembly stages that are covered in the official documentation from the manufacturer:

Be aware that the cable of each motor has to be plugged into the connector on the same side. If you do this the other way around, then when you command a forward motion with the GoPiGo3 API libraries, the robot will go backward, and vice versa. If you find this happens to you, you just have to exchange the connectors so that it works properly.

To attach the Pi Camera, follow the instructions at https://www.dexterindustries.com/GoPiGo/get-started-with-the-gopigo3-raspberry-pi-robot/4-attach-the-camera-and-distance-sensor-to-the-raspberry-pi-robot. These extend upon the Raspberry Pi part.

Once you've assembled the base kit, you can proceed with the sensors:

The following image shows the GoPiGo3 with the three sensors attached to it:

Be aware that the Z axis of the IMU sensor should point in the forward direction, the X axis should point to the left wheel, and—as a consequence—the Y axis should be along the vertical axis and pointing up. When properly calibrated and placed on a horizontal surface, the two angles, pitch and roll, will be zero, and if Z points to the magnetic south, the yaw angle will be zero too.

Quick hardware test

To perform a quick test and focus on the hardware at hand, we will use DexterOS, the Raspbian-based distro created by Dexter Industries to allow the user to get started quickly. Details of the operating system are provided at https://www.dexterindustries.com/dexteros/. Instead of having to deal with a full Linux desktop, Dexter Industries has simplified the interface by providing a simple web environment.

You can access it by connecting to the Wi-Fi access point called GoPiGo (a password won't be needed). This way, you will be connected directly to the robot with your laptop. Before installing it, let's review the resources we have available.

Resources

There are at least three sites/repositories that you will manage while working with the robot:

Getting started with DexterOS

After going through stages 1 and 2 of the Putting it all together section, you should go through the steps at https://www.dexterindustries.com/dexteros/get-dexteros-operating-system-for-raspberry-pi-robotics/, where you can download the image file of the operating system and follow the instructions to burn a micro SD card with the Etcher app (https://www.balena.io/etcher/). Follow these steps to get started with DexterOS:

  1. Once you have placed the card in the slot of the Raspberry Pi, switch the GoPiGo board on and connect to the Wi-Fi network it creates (its SSID is GoPiGo, without a password).
  1. After that, go to to http://mygopigo.com or http://10.10.10.10 to gain access to the robot's enviroment, where the landing page looks as follows. You can find the step-by-step procedure at https://edu.workbencheducation.com/cwists/preview/26657x:

Be aware that if you keep your laptop's internet connection (wired), then you should connect to the robot IP address http://10.10.10.10. If you need help, you can visit the DexterOS forum at https://forum.dexterindustries.com/c/DexterOS.

From this point on, as you saw on the landing page, you can do the following:

  • DRIVE: thereby moving the robot in all directions with a basic control panel.
  • LEARN: by following the guided tutorials in Bloxter—one of the languages of choice—or Python using Jupyter Lab notebooks.
  • Code in Bloxter: the visual programming language based on the open source Blockly by Google (https://github.com/google/blockly).
  • Code in Python: the main environment that we will use to develop our training in robotics.

Next, we will start coding with Bloxter.

Coding with Bloxter

Of the available programming languages, Bloxter gives you the opportunity to learn about robotics without the complexities of typing out code. Using a visual interface, you can arrange and connect blocks and quickly develop basic programs to control GoPiGo3. Let's get started:

  1. By clicking LEARN in the landing page and then clicking Lessons in Bloxter, you can access the available lessons, as shown in the following screenshot:
  1. Select the one you prefer, taking into account that they are ordered by increasing difficulty:

You are encouraged to complete the LEARN section for the Bloxter part before starting Chapter 2, Unit Testing of GoPiGo3. The lessons are easy to follow, and they teach you more about GoPiGo3 than what you could get by simply reading the documentation.

Calibrating the robot

Follow these steps to calibrate the robot:

  1. Get back to the main page, http://mygopigo.com/, and click on the upper right-hand icon of the landing page. A help screen will pop up with two buttons, one for calibration and another for checking the battery status, as shown in the following screenshot:
  1. Check the vital signs by clicking Check Vital Signs:
  1. Now, click the former button, Test the precision of your robot and calibrate it. You will see the following screen:
  1. Adjust the dimensions so they match those of your robot:
    • Wheel Diameter: Mark a distance of 2 meters on the floor and click the Drive 2m button. If GoPiGo3 arrives just at the finish line, 66.5 mm is OK. If it does not arrive, you should increase the diameter a bit; if it goes past the finish line, you should reduce it. Test this again. By trial and error, you will find the diameter that best fits your own robot.
    • Distance between wheels: This procedure is very similar, with the only difference, that, in this case, the robot will rotate about itself when you press Spin a full rotation. If GoPiGo3 gives a complete turn of 360°, 117 mm is OK. If it does not complete the turn, you should reduce the distance; if it turns more than 360°, you should increase it instead. Test this again. By trial and error, you will be able to adjust this distance, just like in the case of the wheel diameter.

Driving the robot

To drive the robot, follow these steps:

  1. Close the help window and select the DRIVE item on the main page.
  2. By clicking this button, you gain access to a panel where there are controls to move the robot forward/backward and rotate it right/left. Go ahead and check that GoPiGo3 moves as expected.
  3. Whenever you need to stop the motion, press the spacebar of the keyboard:

Next, we will check the sensors.

Checking the sensors

Follow these steps to check the sensors:

  1. Go back to the main page and click Code in Bloxter.
  2. On the right-hand side of the screen, you will see a sliding window, where you can indicate what port you have connected to each sensor. For the purposes of our example, we have set this arrangement:
    • The distance sensor plugged to I2C-1, the I2C on the left-hand side of GoPiGo3
    • The line follower to I2C-2, the I2C on the right-hand side
    • The IMU sensor to AD1 (on the left-hand side)
  1. As soon as you select a port in DexterOS, you will be able to make a selection for each drop-down menu that appears, which is all about the real-time data coming from the sensors, as shown in the following screenshot:
  1. Check all three—that is, the distance sensor, line follower, and IMU—to provide readings. In the distance sensor, you may obtain an error unknown message. Don't worry about that; the sensor isn't damaged, it's just a software bug. When we use Python in the next chapter, you will definitely obtain good readings.
  1. Finally, let's take a look at the data of the more complex sensor, the IMU. After setting its connection to AD1, the window will prompt you—when you select either Inertial Measurement Unit or Inertial Measurement Unit (data)—to spin the robot in the air for 3 seconds to calibrate its orientation. This way, we obtain the absolute orientation reference by combining Earth's gravity and magnetic fields. Then, if we select Inertial Measurement Unit from the drop-down list, we will see the Euler angles that were reported in real time. If they've been calibrated properly, we should find the following:
    • All three angles of the Euler heading (yaw, roll, and pitch) are zero when GoPiGo3 is on a horizontal surface and facing east. In this situation, the Z axis (painted in the sensor) is pointing South.
    • In this position, if you rotate GoPiGo3 with your hands over 90° around the Z axis, then the roll angle will be 90° and the X axis will be pointing up (to the cenith).
    • Getting back to the original position, if you rotate GoPiGo3 with your hands +90° around the X axis, the pitch angle will be 90° and the Y axis will be pointing south.

The physical position of the IMU in GoPiGo3 can be seen in the following image:

We will learn how to use the Pi Camera in the next chapter, when we make use of Python to program the robot.

Shutting down the robot

To finish your first journey with GoPiGo3, just long-press the black button of GoPiGo's red board. After a few seconds, the red LED will stop blinking, meaning that the shutdown process has completed.

Summary

In this chapter, we familiarized ourselves with the GoPiGo3 hardware by learning about the physical principles of the sensors and the motor the kit has. We checked that they worked properly by running some quick tests so that we can start programming tasks.

In the next chapter, we will learn how to program GoPiGo3 with Python while we execute some unit tests for each of its main components: the servomotors, distance sensor, line follower, IMU, and the Pi Camera.

Questions

  1. Is it mandatory for a robot to have a computer such as Raspberry Pi?

A) Yes, because the computer powers the controller board.
B) No, because the computer is only needed for visualizing the software code on a screen. It may work alone with the controller if a program has been flashed to it.
C) Not really; you could write a small program that controls the robot and flash it to the chip of the controller. Every time you power the robot, it will execute the program in an endless loop.

  1. What kind of radiation is emitted by the distance sensor of GoPiGo3?

A) Laser
B) Infrared
C) Ultrasound

  1. Why can't you see the light being emitted by the line-follower sensor?

A) Because the sensor has to be previously activated with a software command
B) It does not emit light but a magnetic field
C) It does not emit anything in the visible range of light

  1. What is the purpose of the serial port of the GoPiGo red board?

A) To allow us to program it in the same manner that you would use with an Arduino board, where you use the serial port to flash a program to the chip of the microcontroller.
B) To synchronously transmit data from the sensor to the board.
C) To access the serial pins of the GPIO from Raspberry Pi.

  1. Does an IMU sensor provide an absolute orientation of the robot?

A) Yes, since this is the goal of putting an accelerometer and a gyroscope together.
B) Only if the IMU includes a magnetometer.
C) Only in the case of IMU sensors with six degrees of freedom.

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn fundamental ROS concepts and apply them to solve navigation tasks
  • Work with single board computers to program smart behavior in mobile robots
  • Understand how specific characteristics of the physical environment influence your robot’s performance

Description

Connecting a physical robot to a robot simulation using the Robot Operating System (ROS) infrastructure is one of the most common challenges faced by ROS engineers. With this book, you'll learn how to simulate a robot in a virtual environment and achieve desired behavior in equivalent real-world scenarios. This book starts with an introduction to GoPiGo3 and the sensors and actuators with which it is equipped. You'll then work with GoPiGo3's digital twin by creating a 3D model from scratch and running a simulation in ROS using Gazebo. Next, the book will show you how to use GoPiGo3 to build and run an autonomous mobile robot that is aware of its surroundings. Finally, you'll find out how a robot can learn tasks that have not been programmed in the code but are acquired by observing its environment. You'll even cover topics such as deep learning and reinforcement learning. By the end of this robot programming book, you'll be well-versed with the basics of building specific-purpose applications in robotics and developing highly intelligent autonomous robots from scratch.

Who is this book for?

If you are an engineer looking to build AI-powered robots using the ROS framework, this book is for you. Robotics enthusiasts and hobbyists who want to develop their own ROS robotics projects will also find this book useful. Knowledge of Python and/or C++ programming and familiarity with single board computers such as Raspberry Pi is necessary to get the most out of this book.

What you will learn

  • Get to grips with developing environment-aware robots
  • Gain insights into how your robots will react in physical environments
  • Break down a desired behavior into a chain of robot actions
  • Relate data from sensors with context to produce adaptive responses
  • Apply reinforcement learning to allow your robot to learn by trial and error
  • Implement deep learning to enable your robot to recognize its surroundings

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 26, 2020
Length: 432 pages
Edition : 1st
Language : English
ISBN-13 : 9781838552886
Category :
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
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 26, 2020
Length: 432 pages
Edition : 1st
Language : English
ISBN-13 : 9781838552886
Category :
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 $5 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 $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 173.97
ROS Robotics Projects
$54.99
Mastering ROS for Robotics Programming
$69.99
Hands-On ROS for Robotics Programming
$48.99
Total $ 173.97 Stars icon

Table of Contents

18 Chapters
Section 1: Physical Robot Assembly and Testing Chevron down icon Chevron up icon
Assembling the Robot Chevron down icon Chevron up icon
Unit Testing of GoPiGo3 Chevron down icon Chevron up icon
Getting Started with ROS Chevron down icon Chevron up icon
Section 2: Robot Simulation with Gazebo Chevron down icon Chevron up icon
Creating the Virtual Two-Wheeled ROS Robot Chevron down icon Chevron up icon
Simulating Robot Behavior with Gazebo Chevron down icon Chevron up icon
Section 3: Autonomous Navigation Using SLAM Chevron down icon Chevron up icon
Programming in ROS - Commands and Tools Chevron down icon Chevron up icon
Robot Control and Simulation Chevron down icon Chevron up icon
Virtual SLAM and Navigation Using Gazebo Chevron down icon Chevron up icon
SLAM for Robot Navigation Chevron down icon Chevron up icon
Section 4: Adaptive Robot Behavior Using Machine Learning Chevron down icon Chevron up icon
Applying Machine Learning in Robotics Chevron down icon Chevron up icon
Machine Learning with OpenAI Gym Chevron down icon Chevron up icon
Achieve a Goal through Reinforcement Learning Chevron down icon Chevron up icon
Assessment Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(2 Ratings)
5 star 50%
4 star 0%
3 star 50%
2 star 0%
1 star 0%
Rohith Apr 20, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book along with the development kit it uses is a very powerful tool to learn ROS. Although ROS is very vast in itself, this book covers most of the basics, commands, tools like simulators and visualizers and has added links to dive deeper. As far as robotics programming is concerned, it starts from learning about sensors, communications, and then gradually proceeds to use the ROS navigation stack, SLAM and reinforcement learning to give the robot an intelligent behavior. Briefly touches on machine learning and computer vision as well. Would recommend for anyone who wants to learn ROS with an actual hardware setup
Amazon Verified review Amazon
B Nov 15, 2021
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
It's unfortunate that a book written last year is already out of date. It's a major rev down on Ubuntu, which I could live with, but it uses ROS instead of ROS2. ROS2 is the future and was out at the time of publication, and should have had all the necessary packages. The choice to go with ROS definitely limits the lifespan of the text. I was hoping the GitHub might have code for both, but no such luck.
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.