ELEMENTS of ROBOTICS Mordechai Ben-Ari Francesco Mondada Elements of Robotics Elements of Robotics Mordechai Ben-Ari • Francesco Mondada
Total Page:16
File Type:pdf, Size:1020Kb
MORDECHAI BEN-ARI, FRANCESCO MONDADA ELEMENTS OF ROBOTICS Mordechai Ben-Ari Francesco Mondada Elements of Robotics Elements of Robotics Mordechai Ben-Ari • Francesco Mondada Elements of Robotics Mordechai Ben-Ari Francesco Mondada Department of Science Teaching Laboratoire de Systèmes Robotiques Weizmann Institute of Science Ecole Polytechnique Fédérale de Lausanne Rehovot Lausanne Israel Switzerland ISBN 978-3-319-62532-4 ISBN 978-3-319-62533-1 (eBook) https://doi.org/10.1007/978-3-319-62533-1 Library of Congress Control Number: 2017950255 © The Editor(s) (if applicable) and The Author(s) 2018. This book is an open access publication. Open Access This book is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adap- tation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this book are included in the book’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the book’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publi- cation does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Printed on acid-free paper This Springer imprint is published by Springer Nature The registered company is Springer International Publishing AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland For Itay, Sahar and Nofar. Mordechai Ben-Ari For Luca, Nora, and Leonardo. Francesco Mondada Preface Robotics is a vibrant field which grows in importance from year to year. It is also a subject that students enjoy at all levels from kindergarten to graduate school. The aim of learning robotics varies with the age group. For young kids, robots are an educational toy; for students in middle- and high-schools, robotics can increase the motivation of students to study STEM (science, technology, engineering, mathe- matics); at the introductory university level, students can learn how the physics, mathematics, and computer science that they study can be applied to practical engineering projects; finally, upper level undergraduate and graduate students prepare for careers in robotics. This book is aimed at the middle of the age range: students in secondary schools and in their first years of university. We focus on robotics algorithms and their mathematical and physical principles. We go beyond trial-and-error play, but we don’t expect the student to be able to design and build robots and robotic algorithms that perform tasks in the real world. The presentation of the algorithms without advanced mathematics and engineering is necessarily simplified, but we believe that the concepts and algorithms of robotics can be learned and appreciated at this level, and can serve as a bridge to the study of robotics at the advanced undergraduate and graduate levels. The required background is a knowledge of programming, mathematics, and physics at the level of secondary schools or the first year of university. From mathematics: algebra, trigonometry, calculus, matrices, and probability. Appendix B provides tutorials for some of the more advanced mathematics. From physics: time, velocity, acceleration, force, and friction. Hardly a day goes by without the appearance of a new robot intended for educational purposes. Whatever the form and function of a robot, the scientific and engineering principles and algorithms remain the same. For this reason, the book is not based on any specific robot. In Chap. 1 we define a generic robot: a small autonomous mobile robot with differential drive and sensors capable of detecting the direction and distance to an object, as well as ground sensors that can detect markings on a table or floor. This definition is sufficiently general so that students should be able to implement most of algorithms on any educational robot. vii viii Preface The quality of the implementation may vary according to the capabilities of each platform, but the students will be able to learn robotics principles and how to go from theoretical algorithms to the behavior of a real robot. For similar reasons, we choose not to describe algorithms in any specific pro- gramming language. Not only do different platforms support different languages, but educational robots often use different programming approaches, such as textual programming and visual programming using blocks or states. We present algo- rithms in pseudocode and leave it to the students to implement these high-level descriptions in the language and environment for the robot they are using. The book contains a large number of activities, most of which ask you to implement algorithms and to explore their behavior. The robot you use may not have the capabilities to perform all the activities, so feel free to adapt them to your robot. This book arose from the development of learning materials for the Thymio educational robot (https://www.thymio.org). The book’s website http:// elementsofrobotics.net contains implementations of most of the activities for that robot. Some of the more advanced algorithms are difficult to implement on edu- cational robots so Python programs are provided. Please let us know if you implement the activities for other educational robots, and we will post a link on the book’s website. Chapter 1 presents an overview of the field of robotics and specifies the generic robot and the pseudocode used in the algorithms. Chapters 2–6 present the fun- damental concepts of autonomous mobile robots: sensors, reactive behavior, finite state machines, motion and odometry, and control. Chapters 7–16 describe more advanced robotics algorithms: obstacle avoidance, localization, mapping, fuzzy logic, image processing, neural networks, machine learning, swarm robotics, and the kinematics of robotic manipulators. A detailed overview of the content is given in Sect. 1.8. Acknowledgements This book arose from the work on the Thymio robot and the Aseba software system initiated by the second author’s research group at the Robotic Systems Laboratory of the Ecole Polytechnique Fédérale de Lausanne. We would like to thank all the students, engineers, teachers, and artists of the Thymio community without whose efforts this book could not have been written. Open access to this book was supported by the Ecole Polytechnique Fédérale de Lausanne and the National Centre of Competence in Research (NCCR) Robotics. Preface ix We are indebted to Jennifer S. Kay, Fanny Riedo, Amaury Dame, and Yves Piguet for their comments which enabled us to correct errors and clarify the presentation. We would like to thank the staff at Springer, in particular Helen Desmond and Beverley Ford, for their help and support. Rehovot, Israel Moti Ben-Ari Lausanne, Switzerland Francesco Mondada Contents 1 Robots and Their Applications.............................. 1 1.1 Classification of Robots ............................... 2 1.2 Industrial Robots..................................... 3 1.3 Autonomous Mobile Robots ............................ 4 1.4 Humanoid Robots.................................... 6 1.5 Educational Robots................................... 7 1.6 The Generic Robot ................................... 11 1.6.1 Differential Drive.............................. 11 1.6.2 Proximity Sensors ............................. 12 1.6.3 Ground Sensors ............................... 13 1.6.4 Embedded Computer ........................... 13 1.7 The Algorithmic Formalism ............................ 14 1.8 An Overview of the Content of the Book.................. 15 1.9 Summary .......................................... 18 1.10 Further Reading ..................................... 19 References............................................... 19 2 Sensors ................................................. 21 2.1 Classification of Sensors ............................... 22 2.2 Distance Sensors..................................... 22 2.2.1 Ultrasound Distance Sensors ..................... 23 2.2.2 Infrared Proximity Sensors ...................... 24 2.2.3 Optical Distance Sensors ........................ 24 2.2.4 Triangulating Sensors .......................... 26 2.2.5 Laser Scanners................................ 27 2.3 Cameras ........................................... 30 2.4 Other Sensors ....................................... 31 2.5 Range, Resolution, Precision, Accuracy ................... 32 xi xii Contents 2.6 Nonlinearity ........................................ 34 2.6.1 Linear Sensors................................ 34