**E28: Mobile Robotics** **ENGR 28/CPSC 82** **Fall 2023** **[Matt Zucker](http://mzucker.github.io/swarthmore)** | Lecture: | Tue/Thu 9:55-11:10AM, Singer 221 | |-----------------|--------------------------------------------| | Office Hours: | Mon 10:30AM-11:30AM and by appointment | | Wizard session: | Tuesdays 7-9PM, Singer 224 | This course addresses the problems of guiding robots to act intelligently in dynamic, unpredictable environments. Major topics will include robot design, kinematics, navigation, control, sensor fusion, and perception under uncertainty. To explore these concepts, we will examine mobile robots, manipulators and positioning devices, and virtual agents. Projects will focus on programming real robots to execute tasks and to explore and interact with their environment. # Requirements **Prerequisites:** ENGR 19 or ENGR 56, or permission of the instructor. MATH 27 or 28 is strongly recommended. **Skills:** In practice, I expect you to understand elementary programming concepts, including basic loops, functions, and array processing. You should also be familiar with the process of converting a set of mathematical equations into a working computer program. Familiarity with Python is useful but not necessary. I also expect you to be comfortable with [linear algebra concepts](../linalg-reintroduction.pdf) such as matrices, linear transformations, transposes, and inverses. We will also be using related geometric concepts such as the dot product and vector norms. **Time:** I expect students to spend approximately 8 hours per week on this class (4 classes × 8 hours per class + [8 hours for paid student work](https://www.swarthmore.edu/student-employment/employment-faqs) = 40 hours). Although this figure will vary from individual to individual and week to week, you should plan to commit several hours outside of class to homework, reading, and projects each week. # Resources There is no textbook for the course; however, there will be assigned readings, and notes and pointers to external resources will be provided by student scribes and researchers ([see below](#toc4)). This course webpage at https://mzucker.github.io/swarthmore/e28_f2023 will be regularly updated with assignments, scribe notes, and reading, so please keep aware of the materials posted here. We will use the Edstem group at https://edstem.org/us/courses/45831/ throughout the semester to communicate course announcements and answer questions. Please use Piazza for all course-related communications -- this allows students to see common problems and to engage in discussions about course material. # Assignments Homework consisting of math, short answer questions, and small programming exercises will be assigned roughly weekly. Less frequently, we will have in-class quizzes, which will be announced in advance. There will be several regularly scheduled projects involving hands-on programming of real and simulated robots, as well as an open-ended, self-directed final project. Projects will be conducted in small groups, typically pairs of students. Due to frequent scheduling conflicts with other courses, there is no regular lab time; however, during the first week, we will form groups and arrange times to meet for short (~15 minutes) "kickoff" tutorials at the start of each new project. Other than those tutorials, project work will be self-scheduled. Grading will follow approximately the divisions shown below: * Homework/quizzes: 40% * Regular projects: 40% * Final project: 15% * Class participation: 5% Your participation grade encompasses involvement in class discussions, preparing thorough and readable scribe notes/researcher links, and posting constructively on Edstem. ## Collaboration and attribution * Feel free to collaborate with your classmates on homework; however, you must submit your own work. Duplicating others’ assignments verbatim (especially code!) is prohibited. * If you do discuss homework with your classmates, I expect you to disclose any such collaboration clearly in your submitted work. Err on the side of caution – it’s the best way to avoid awkward conversations about suspicious similarities between assignments. * Cite any external sources used, including the textbook, internet, discussions with other professors, etc. * Aside from raising technical and procedural questions on the course Edstem, do not collaborate on projects with others outside your group. * Do not post homework or project solutions on Edstem. Questions or answers that discuss solutions too closely will be deleted. Aside from the course-specific policies above, you are expected to understand and abide by the college's [policy on academic misconduct](https://www.swarthmore.edu/student-handbook/academic-policies#academic_misconduct). ## Late policy Homework will generally be assigned on Thursday, and due at the start of class the following Thursday. Homework assignments may be turned in up to a week late for half credit. Students get one free late homework turn-in without penalty. In contrast to homework, late projects or absences from quizzes which have not been excused in advance may be strongly penalized. I will be liberal in granting extensions for homeworks ***when requested in advance***. # Scribes/researchers Each week two or three students will collaborate to both capture the lecture material and provide pointers to further resources. Each student will work as either a *scribe*, whose role is to digest and synthesize the lecture material in a clear manner, or as a *researcher*, whose role it is to find outside resources related to the week's course material. The scribe and researcher students should collaborate to produce a single digital document (Google Doc or PDF are both acceptable) which should be sent to me by noon on Tuesday. You will be able to find a link to sign up for scribe and researcher slots on our [Edstem forum](https://edstem.org/us/courses/45831/). # Accommodations If you believe you need accommodations for a disability or a chronic medical condition, please contact Student Disability Services via email at [studentdisabilityservices@swarthmore.edu](studentdisabilityservices@swarthmore.edu) to arrange an appointment to discuss your needs. As appropriate, the office will issue students with documented disabilities or medical conditions a formal Accommodations Letter. Since accommodations require early planning and are not retroactive, please contact Student Disability Services as soon as possible. For details about the accommodations process, visit the [Student Disability Services website](https://www.swarthmore.edu/office-academic-success/welcome-to-student-disability-services). You are also welcome to contact me privately to discuss your academic needs. However, all disability-related accommodations must be arranged, in advance, through Student Disability Services. ***Even outside the context of accommodations for disabilities, if there is something I can do to facilitate your learning, please do not hesitate to contact me.*** # Learning goals Upon completing the course, students will be able to: * Understand physical, electrical, and mechanical principles underlying robotic sensors and actuators. * Understand the equations governing the motion of simple wheeled robots and implement code to solve them numerically. * Implement basic algorithms to control robots using feedback from sensors, and to navigate around a known environment. * Program and debug systems with hardware in the loop, including robotic sensors and actuators. * Understand how probabilistic inference can provide robustness in the face of uncertainty due to sensor limitations. * Evaluate the social, economic, and ethical impacts of robotic and automated systems. # Schedule Sep. 5 2023: Introduction Topics: * Syllabus, labs, Piazza * Big ideas and goals for the course * Robotics history Resources: * [Robotics key points timeline](../robotics-history.html) Sep. 7 2023: Rigid transformations Topics: * Math review: matrices, etc. * Orthogonal and rigid transformations * Relating coordinate frames Resources: * [A practical (re-)introduction to linear algeba](../linalg-reintroduction.pdf) * [Python/numpy/matplotlib tutorial](http://cs231n.github.io/python-numpy-tutorial/) * [Sample code from today](code/hello_numpy_rotations_2023_09_07.py) Scribe/researcher notes: * [Week 1 notes from Fall 2020 (Ando + Massari)](https://moodle.swarthmore.edu/pluginfile.php/868242/mod_resource/content/1/notes_week1_ando_massari.pdf) Assignments: * [Homework 1](homework1.html) Sep. 12 2023: Turtlebot intro; State machines Topics: * Rigid transforms, cont'd * ROS and Turtlebot 2 * State machines for robot behaviors Resources: * [Sample code from today](code/rigid_xforms_2023-09-12.py) * [Turtlebot 2 description](https://www.turtlebot.com/turtlebot2/) * Kobuki robot base [specifications](https://iclebo-kobuki.readthedocs.io/en/latest/specifications.html) and [anatomy](https://iclebo-kobuki.readthedocs.io/en/latest/anatomy.html) Sep. 14 2023: Differential drive kinematics Topics: * Relating linear and angular velocities * Estimating robot motion from wheel motion * Integrating motion over time Assignments: * [Project 1: Line Following](project1.html) Scribe/researcher notes: * [Zarate, Obiora-Egbuziem](https://moodle.swarthmore.edu/pluginfile.php/869556/mod_resource/content/1/week2_zarate_obiora-egbuziem.pdf) (2023-9-14): P1: Line following Sep. 19 2023: Diff drive cont'd; intro to sensors Topics: * Differential drive kinematics equations of motion * Transducers * Analog to digital conversion * Passive vs active sensing * Proprioception Resources: * [Siegwart et al. 2011: Sensors](https://moodle.swarthmore.edu/pluginfile.php/869935/mod_resource/content/1/siegwart_sec4.1.pdf) Sep. 21 2023: Sensors, cont'd Topics: * Analog to digital converters * Rotary encoders * Cameras and blob detection Scribe/researcher notes: * [Fang, Icten](https://moodle.swarthmore.edu/pluginfile.php/871770/mod_resource/content/1/ENGR%2028%20-%20Scribe%20and%20Researcher%20Notes%20for%20Sept%2019.pdf) Assignments: * [Homework 2](homework2.html) Sep. 26 2023: Motors Topics: * Mechanics intro/recap: SI units, forces, and torques * Intro to brushed DC motor * Steady-state ciruit model * Torque-speed curves and torque-power curves Resources: * [Hughes & Drury 2013: Motors](https://moodle.swarthmore.edu/pluginfile.php/869936/mod_resource/content/1/hughes_ch3.pdf) * [Motor image from whiteboard](images/motor.png) * [Motor whitepaper from Portescap](https://moodle.swarthmore.edu/pluginfile.php/871775/mod_resource/content/1/ed_wp_brush_dc_motor_basics.pdf) Sep. 28 2023: Motors, cont'd. Topics: * Gearing and motor efficiency Resources: * [Motor whitepaper from Portescap](https://moodle.swarthmore.edu/pluginfile.php/871775/mod_resource/content/1/ed_wp_brush_dc_motor_basics.pdf) * [Code from today](model_motor.py) Assignments: * [Homework 3](homework3.html) Scribe/researcher notes: * [Krueger, McCulloch](https://moodle.swarthmore.edu/pluginfile.php/872354/mod_resource/content/1/week4-krueger-mcculloch.pdf) Oct. 3 2023: Robotics and Society Topics: * Ethics * Technology trends * Labor and automation Resources: * [Slides](https://docs.google.com/presentation/d/11JmkW2O1xc2h7oAyNJ2BWnSoaVMrxQPRN_z_BwBA7l0/edit?usp=sharing) Oct. 5 2023: Navigation: Dijkstra's and A* Topics: * Robot navigation as graph search * Dijkstra's algorithm and A* * Application: footstep planning for legged robots Resources: * [Slides](https://moodle.swarthmore.edu/pluginfile.php/872959/mod_resource/content/1/Navigation%20-%20Footstep%20planning%20and%20A%20star.pdf) Scribe/researcher notes: * [Sherman, Poteet](https://moodle.swarthmore.edu/pluginfile.php/873532/mod_resource/content/1/week5-sherman-poteet.pdf) Oct. 10 2023: Intro to Kinematics Topics: * Intro to kinematic systems * Common configuration spaces Oct. 12 2023: Tricycle and car kinematics Topics: * Wheeled vehicle kinematics * Instantaneous center of curvature * Example systems: tricycle and car Resources: * [Tricycle diagram and worksheet](https://moodle.swarthmore.edu/pluginfile.php/873872/mod_resource/content/1/tricycle_kinematics.pdf) Assignments: * [Homework 4](homework4.html) Scribe/researcher notes: * [Jiang](https://moodle.swarthmore.edu/pluginfile.php/874756/mod_resource/content/1/week6_jiang.pdf) (2023-10-17): Fall break (2023-10-19): Fall break Oct. 24 2023: Dynamics & feedback control Topics: * Mechanics intro/recap: Newton's second law * Simple dynamical systems Oct. 26 2023: Pure pursuit, PD and PID control Topics: * Open-loop vs closed-loop control * Control of dynamical systems * Robot path following via pure pursuit * P, PD, and PID control Scribe/researcher notes: * [Khmaladze, Davoren](https://moodle.swarthmore.edu/pluginfile.php/880567/mod_resource/content/1/week7_khmaladze_davoren.pdf) Assignments: * [Project 2: Soccer](project2.html) (2023-9-28): P2: Soccer Oct. 31 2023: Intro to probabilistic robotics Topics: * Probability basics * Bayes rule * Localization and probabilistic filtering Resources: * [Probability cheatsheet](probability_cheatsheet.html) Assignments: * [Homework 5](homework5.html) Nov. 2 2023: Bayes filter Topics: * Discrete Bayes filter * Example application: hallway demo * Complexity analysis Resources: * [Code from today](bayes_filter_demo.py) Scribe/researcher notes: * [Week 8 - Yuan, Li](https://moodle.swarthmore.edu/pluginfile.php/881165/mod_resource/content/1/week8_yuan_li.pdf) Nov. 7 2023: Continuous random variables and sampling Topics: * Sampling discrete distributions * Real-valued random variables * Probability density functions Resources: * [Probability and sampling discussion questions](probability_discussion_questions.html) * [Code from today (edited for clarity)](random_sampling.py) Nov. 9 2023: Particle filter Topics: * Sampling from continuous distributions * Particle filter * Example application: range-only measurement against beacons Assignments: * [Project 3: Slalom race](project3.html) Scribe/researcher notes: * [Week 9 - Casalino, Bignotti](https://moodle.swarthmore.edu/pluginfile.php/882303/mod_resource/content/1/week9_casalino_bignotti.pdf) (2023-11-9): P4: Slalom Race Nov. 14 2023: Particle filter applications Topics: * Particle filter applications * Beam sensor models * Odometry motion models Assignments: * [Homework 6](homework6.html) Nov. 16 2023: Kalman filter Topics: * Normal distributions in 1D and 2D * Gaussian conditioning * Kalman filter Resources: * [Slides from today](kalman.pdf) * [Sample code from today](kalman_filter_demo.py) Scribe/researcher notes: * [Adolphe, Mickelson](https://moodle.swarthmore.edu/pluginfile.php/883330/mod_resource/content/1/week10-adolphe-mickelson.pdf) * [Bonus notes on EKF: Kim, Yamada](https://moodle.swarthmore.edu/pluginfile.php/885370/mod_resource/content/1/week11-kim-yamada.pdf) Nov. 21 2023: Project 3 work day Topics: * Work on robot races (2023-11-23): Thanksgiving Nov. 28 2023: Intro to manipulators Topics: * Serial chain manipulators * Problems in manipulation: FK, DK, IK * Forward kinematics Resources: * [Sample code from today](sympy-fk.py) Nov. 30 2023: Project 3 Race Day! Topics: * Race day! Scribe/researcher notes: * [Skeldon, Makin](https://moodle.swarthmore.edu/pluginfile.php/885369/mod_resource/content/1/week12-skeldon-makin.pdf) Dec. 5 2023: Differential and inverse kinematics Topics: * Analytical inverse kinematics * Ordinary least squares * Differential kinematics Dec. 7 2023: Differential kinematics, cont'd. Topics: * Algebraic vs geometric Jacobians * Force/torque relationships * Nonlinear least squares * Numerical inverse kinematics Scribe/researcher notes: * [Jordan](https://moodle.swarthmore.edu/pluginfile.php/886521/mod_resource/content/1/week13-jordan.pdf) Dec. 12 2023: Wrap-up Topics: * Final project technical description * Course summary Assignments: * [Homework 7](homework7.html) * [Final project](final_project.html)