Learning Robotics using Python
eBook - ePub

Learning Robotics using Python

Design, simulate, program, and prototype an autonomous mobile robot using ROS, OpenCV, PCL, and Python, 2nd Edition

Lentin Joseph

Compartir libro
  1. 280 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Learning Robotics using Python

Design, simulate, program, and prototype an autonomous mobile robot using ROS, OpenCV, PCL, and Python, 2nd Edition

Lentin Joseph

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Design, simulate, and program interactive robots

Key Features

  • 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

Book Description

Robot Operating System (ROS) is one of the most popular robotics software frameworks in research and industry. It has various features for implement 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.

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

Who this book is 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Learning Robotics using Python un PDF/ePUB en línea?
Sí, puedes acceder a Learning Robotics using Python de Lentin Joseph en formato PDF o ePUB, así como a otros libros populares de Ciencia de la computación y Hardware. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781788629973
Edición
2
Categoría
Hardware

Interfacing Actuators and Sensors to the Robot Controller

In the previous chapter, we discussed the selection of the hardware components needed to build our robot. The important components in a robot are actuators and sensors. Actuators provide mobility to the robot and sensors provide information about the robot environment. In this chapter, we will concentrate on the different types of actuators and sensors that we are going to use in this robot and how they can be interfaced with Tiva C LaunchPad, which is a 32 bit ARM micro controller board from Texas Instruments, working at 80 MHz. We will start by discussing actuators. The actuator that we are going to discuss first is a DC-geared motor with an encoder. A DC-geared motor works using direct current and has gear reduction to reduce the shaft speed and increase the torque of the final shaft. These kinds of motors are very economical and satisfy our robot design requirement. We will use this motor in our robot prototype.
In the first section of this chapter, we will deal with the design of our robot drive system. The drive system of our robot is a differential drive and consists of two DC-geared motors with encoders and a motor driver. The motor driver is controlled by Tiva C LaunchPad. We will look at the interfacing of the motor driver and quadrature encoder with Tiva C Launchpad. After that, we will look at some of the latest actuators that can replace the existing DC-geared motor with an encoder. If the desired robot needs more payload and accuracy, we have to switch to these kinds of actuators. Finally, we will look at some different sensors that are commonly used for robots.
In this chapter, we will cover:
  • Interfacing a DC-geared motor with Tiva C LaunchPad
  • Interfacing a quadrature encoder with Tiva C LaunchPad
  • An explanation of interfacing code
  • Interfacing Dynamixel actuators
  • Interfacing ultrasonic sensors and IR proximity sensors
  • Interfacing inertial measurement units (IMUs)

Technical requirements

You will need the necessary robot hardware component and Energia IDE set up in Ubuntu 16.04 LTS.

Interfacing DC geared motor to Tiva C LaunchPad

In the previous chapter, we selected a DC-geared motor with an encoder from Pololu and an embedded board from Texas Instruments, called Tiva C LaunchPad. We need the following components to interface the motor with LaunchPad:
  • Two Pololu metal gear motors, 37Dx73L mm with 64 counts per revolution encoder
  • Pololu wheel, 90x10 mm and a matching hub
  • Pololu dual VNH2SP30 motor driver carrier, MD03A
  • A sealed lead acid/lithium ion battery of 12V
  • A logic level convertor of 3.3V to 5V; visit https://www.sparkfun.com/products/11978.
  • A Tiva C LaunchPad and its compatible interfacing wires
The following diagram shows the interfacing circuit of two motors using Pololu H-Bridge:
Motor interfacing circuit
To interface with Launchpad, we have to connect a level shifter board in between these two motors. The motor driver works in 5V but the Launchpad works in 3.3V, so we have to connect a level shifter, as shown in the following diagram:
Level shifter circuit
The two geared DC motors are connected to OUT1A, OUT1B, and OUT2A, OUT2B of the motor driver. VIN (+) and GND (-) are the supply voltage of the motor. These DC motors can work with a 12V supply, so we give 12V as the input voltage. The motor driver will support an input voltage ranging from 5.5V to 16V.
The control signals/input pins of the motor drivers are on the left side of the driver. The first pin is 1DIAG/EN; in most cases, we leave this pin disconnected. These pins are externally pulled high in the driver board itself. The main use of this pin is to enable or disable the H-bridge chip. It is also used to monitor the faulty condition of the H-Bridge IC. Pins 1INA and 1INB control the direction of the rotation of the motor. The 1PWM pin will switch the motor to the ON and OFF state. We achieve speed control using PWM pins. The CS pin will sense the output current. It will output 0.13V per Ampere of the output current. The VIN and GND pins give the same input voltage that we supplied for the motor. We are not using these pins here. The +5V(IN) and GND pins are the supply for the motor driver IC. The supply to the motor driver and motors are different.
The following table shows the truth table of the input and output combinations:
INA
INB
DIAGA/ENA
DIAGB/ENB
OUTA
OUTB
CS
Operating mode
1
1
1
1
H
H
High Imp
Brake to Vcc
1
0
1
1
H
L
Isense = Iout / K
Clockwise (CW)
0
1
1
1
L
H
Isense = Iout / K
Counterclockwise (CCW)
0
0
1
1
L
L
High Imp
Breaker to GND
The value DIAG/EN pins are always high because these pins are externally pulled high in the driver board itself. Using the aforementioned signal combinations, we can move the robot in any direction and by adjusting the PWM signal, we can adjust the speed of the motor too. This is the basic logic behind controlling a DC motor using an H-Bridge circuit.
While interfacing motors to Launchpad, we may require a level shifter. This is because the output pins of Launchpad can only supply 3.3V but the motor driver needs 5V to trigger; so, we have to connect 3.3V to the 5V logic level convertor to start working.
The two motors work in a differential drive mechanism. The following section discusses the differential drive and its operation.

Differential wheeled robot

The robot we have designed is a differential wheeled/drive robot. In a differential wheeled robot, the movement is based on two separately driven wheels placed on either side of the robot's body. It can change its direction by changing the relative rate of rotation of its wheels, and hence, doesn't require additional steering motion. To balance the robot, a free turning wheel or caster wheels may be added. The following diagram shows a typical representation of a differential drive:
Differential wheeled robot
If the two motors are in the same direction, the robot will move forward or backward. If one motor has more speed than the other, then the robot turns to the slower motor side; so, to turn left, stop the left motor and move the right motor. The following diagram shows how we connect the two motors in our robot. The two motors are mounted on the opposite sides of the base plate and we put two casters in the front and back of the robot for balancing:
Top view of robot base
Next, we can program the motor controller using Launchpad according to the truth table data. Programming is done using an IDE called Energia (http://energia.nu/). We are programming Launchpad using the C++ language, very simila...

Índice