# 1. Introduction#

Robotics is a fascinating field in which we study how to make sense of the world and how to reason about acting purposefully in the physical world. Robotics is more relevant than ever, as robots populate our factories, streets, skies, and even work inside our homes. How do these systems work? What sensors do they have and how do they perceive our world through these senses? What are the mechanisms by which they can move and act in their environment? And how do they choose how to act at any given moment? These questions are an incredibly broad and rich subject, and given the recent advances in artificial intelligence the field of robotics is bound to see many breakthroughs over the next few years.

This introductory text is designed to guide the reader through the *foundations* of modern robotics, while at the same time showing how practical systems can be implemented. The theoretical concepts in each chapter are explained informally without sacrificing rigor, but balance this with a unique hands-on approach. Theory is immediately put into practice, as every section in the book is interspersed with example code and can be executed as a python notebook, allowing students to experiment with implementations that are representative of many robotics systems. No experience is needed beyond a good basis in math, especially linear algebra and notions of statistics, and some knowledge of the python programming language. The code itself is based on popular open source libraries, most notably GTSAM and PyTorch, which provide a good starting point for those who want to further explore robotics as a career choice.

In this book, we proceed through a sequence of increasingly complex robotic systems. Each chapter is laid out in the same pattern, delving into how to represent the robot’s state, how to describe its actuators and sensors, the corresponding perception and planning methods and algorithms, and ending with a section on learning from data. The expressiveness of the state space, which is tied to how much we do or do not abstract away from reality, determines to a large degree the complexity of the corresponding algorithms. By gradually building up this richness, we ensure that each chapter builds upon the previous one, guiding the reader along a series of achievable steps. A key tool we use in each chapter is the use of graphical models to help explain how state, actions, and sensing share many commonalities across a diverse set of autonomous robots.

We begin, in Chapter 2, by considering a simple trash sorting robot. Pieces of trash arrive on a conveyor, and the robot’s task is to place these in an appropriate bin. For this first robotic system, we abstract away most all details that would confront a real trash sorting robot, focusing our attention on fundamental concepts from probability theory, both to solve a simple perception problem (categorizing pieces of trash) and to solve a planning problem (which bin to select). From there, in each chapter we incrementally add complexity to the system models and the mathematical methods for manipulating them, developing increasingly sophisticated algorithms to implement these methods. We consider a simple vacuum cleaning robot in Chapter 3, a mobile robot that navigates in a warehouse in Chapter 4, a two-wheeled, differential drive robot (DDR) in Chapter 5, self-driving cars in Chapter 6, and quadrotor drones in Chapter 7.

In the state, action, and sensing sections of each chapter we focus on the mathematical *models*. To model robots, we move from discrete state spaces and fairly abstract action and sensing, to continuous state spaces and real-world sensing in later sections. We introduce the special Euclidean group of order two, \(SE(2)\) for differential drive robots, and extend it to \(SE(3)\) for the case of drones. We develop the differential kinematics for wheeled mobile robots, both for omnidirectional robots (our logistics robot), and for robots with non-holonomic constraints. In the case of drones, we derive a model for the dynamics which includes propellor thrust, and aerodynamic properties such as drag. We take a similar approach with sensors. In Chapter 2, we introduce simple sensors that measure physical properties of a piece of trash. Then, in subsequent chapters, we consider an increasing array of sensors, including proximity sensors, RFID beacons, GPS, cameras, LIDAR, and Inertial Measurement Units (IMUs).

In other places, we focus on probabilistic methods for representing and reasoning about uncertainty. We introduce discrete probability distributions for simple classification problems, and develop maximum likelihood and maximum posteriori estimation methods for these using our trash sorting robot. We introduce continuous distributions, and specifically the uniform and Gaussian distributions, to model the motion of mobile robots and the effects of sensor noise. To reason about the effects of uncertainty, we introduce sampling-based methods, such as particle filtering and Markov localization, Kalman filters, Bayes nets, and Markov decision processes. In each case, we begin by formulating the appropriate mathematical models, and then proceed to describe algorithmic solutions (often illustrated with code).

In the remainder of this chapter, we give a slightly more detailed overview of the topics covered in this book.