http://hades.mech.northwestern.edu/api.php?action=feedcontributions&user=Lynch&feedformat=atomMech - User contributions [en]2020-07-10T07:47:07ZUser contributionsMediaWiki 1.18.2http://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-06-23T16:16:31Z<p>Lynch: /* Updated first edition: Significant corrections (Errata for original first edition here) */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 4 ===<br />
<br />
* Exercise 4.21: The question should begin "For each <math>T</math> below..." (instead of "For each <math>T \in SE(3)</math> below...") since the first part of the problem is determining whether <math>T</math> is indeed an element of <math>SE(3)</math>.<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force <math>F_{ij}(q)</math>, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
<br />
=== Chapter 11 ===<br />
<br />
* Chapter 11.5, Equations (11.52) and (11.53) (and nearby text): The term <math>K_{fp}</math> in Equations (11.52) and (11.53) should be <math>(K_{fp}+I)</math>, where <math>I</math> is the identity matrix. In the text immediately after Equation (11.51), the term "positive-definite" should be eliminated. In the text immediately after Equation (11.53), <math>K_{fp}</math> should be replaced by <math>(K_{fp}+I)</math>.<br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li, Jose Capco, Chen Wang</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-06-23T15:00:17Z<p>Lynch: </p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 4 ===<br />
<br />
* Exercise 4.21: The question should begin "For each <math>T</math> below..." (instead of "For each <math>T \in SE(3)</math> below...") since the first part of the problem is determining whether <math>T</math> is indeed an element of <math>SE(3)</math>.<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force <math>F_{ij}(q)</math>, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
<br />
=== Chapter 11 ===<br />
<br />
* Chapter 11.5, Equations (11.52) and (11.53) and nearby text: <br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li, Jose Capco, Chen Wang</div>Lynchhttp://hades.mech.northwestern.edu/index.php/ME_333_Introduction_to_MechatronicsME 333 Introduction to Mechatronics2020-06-13T16:02:20Z<p>Lynch: /* Approximate Syllabus */</p>
<hr />
<div>'''Winter Quarter 2020'''<br />
<br />
'''First day of class is Tuesday January 7.'''<br />
* Section 20: Prof. Nick Marchuk (nick.marchuk@gmail.com), T Th, 11:00-12:20, Tech LR4<br />
* Section 21: Prof. Nick Marchuk (nick.marchuk@gmail.com), T Th, 12:30-1:50, Tech LR4 <br />
* TAs: <br />
** Huan Weng<br />
** German Espinosa<br />
<br />
* '''Final demo''' (in lieu of final exam): Monday Mar 16 3-5 PM (12:30-1:50 section) and Wednesday Mar 18 9-11 AM (11-12:20 section) <br />
* Office Hours in Ford B100: <br />
** TuWThF 4-5pm with Prof. Marchuk in Ford B100, or by appt<br />
<br />
* Quick links:<br />
** [http://www.it.northwestern.edu/education/login.html Canvas Course Management System]<br />
** [[NU32 Videos|NU32 Videos]]<br />
** [[NU32 Software|NU32 Software]]<br />
** [https://docs.google.com/forms/d/1LkHw5Lthzfudmoc3s3vediJe34B4qfFAnEiTqxew5IE/viewform?usp=send_form Report a typo or bug in the book]<br />
<br />
<br />
== Purpose of this Course ==<br />
<br />
The purpose of this course is to '''provide tools that help you express your creativity'''. Maybe you want to build a robot, or a piece of kinetic art, or an automatic ball-throwing device to entertain your dog; maybe you've identified a market for a new smart product and you'd like to prototype the device. This course provides fundamentals of mechatronics to give you confidence to take on these projects. You are encouraged to take what you learn in this course and apply it in ME 433 Advanced Mechatronics, DSGN 360 Design Competition, senior design projects, or independent projects.<br />
<br />
== Approximate Syllabus ==<br />
<br />
This course is for students who want to build microprocessor-controlled electromechanical devices. <br />
<br />
To do this, ME 333 focuses on three topics: (1) general C programming; (2) Microchip PIC microcontroller architecture and C programming specific to the PIC (e.g., using the PIC's peripherals, such as analog inputs, digital I/O, counters/timers, comm ports, etc.); and (3) interfacing the PIC to sensors and actuators, some theory of sensor and actuator operation, and interface circuitry and signal processing. <br />
<br />
'''You will do a lot of programming in this course!''' If you are certain you hate programming, then this is not the course for you. But knowing how to program is very useful for any modern engineer. The language we will use is C, a fairly low-level language that works well for microcontrollers, which is more portable and not nearly as painful and low-level as assembly language. If you don't know C, that's not a problem, most students don't before taking ME 333; but you should plan to learn it, and rather quickly. You will have all the materials you need to start learning C before class starts, and '''the first assignment on C is due on the first day of class'''! The reason: even though we start out with C, that's not the main goal of this course. The main goal is to teach you about microcontrollers and mechatronics. Plus some students already have C background.<br />
<br />
You will bring your laptop to each class. As the quarter progresses, we will be handing out other equipment that you will need to bring to class, such as the NU32 development board that breaks out the [http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC32MX795F512H PIC32MX795F512H] microcontroller.<br />
<br />
'''It is essential you do the assigned reading and watch the videos in advance of class.''' You will have an assignment and/or lecture comprehension questions (L-comps) due before every class, turned in electronically on Canvas. (This includes the very first day of class!) Once a week we will have a short quiz. Most classes will have a combination of a brief review, Q&A, and working individually or in small groups on problems while the instructors help answer any questions.<br />
<br />
Topics we will cover, time depending, include:<br />
<br />
* introduction to C programming<br />
* introduction to the PIC32 hardware, and programming the PIC32 in C<br />
* digital I/O<br />
* counters/timers and interrupts<br />
* analog input<br />
* sensor smorgasbord<br />
* digital signal processing: filters and FFTs<br />
* analog output and pulse-width modulation<br />
* brushed permanent magnet DC motors: theory and control<br />
* stepper motors and RC servo motors<br />
* communication by SPI, I2C, and RS-232<br />
<br />
== Checklist to Complete Before the First Day of Class ==<br />
<br />
By the first day of class, you should:<br />
<br />
* Complete the reading and assignment 1, which is '''due the first day of class!''' The first assignments are designed to get you up to speed on the C programming language, which we will use throughout the course.<br />
* Have a laptop with at least 2 USB ports. Any operating system is fine. One port will be used to program and communicate with your PIC microcontroller, and the other will be used for your portable oscilloscope. <br />
* Be prepared to buy your class kit, consisting of the portable nScope oscilloscope, the NU32 PIC32 development board, textbook, and lots of other goodies. Price $125 if you are starting from scratch; $75 if you already have the nScope. <br />
* Buy your class kit [http://it.mccormick.northwestern.edu/matlab/student_license/login.php '''here''']. If you already have the oscilloscope and multimeter from this year's ME 233 offering, you should choose "ME 333 (nScope not needed ($75))" for the price of $75. If you do not have the oscilloscope and multimeter, you should choose "ME 333 (including nScope ($125))" for the price of $125. You will not be able to start the course until you have completed the purchase of your kit. If you decide to drop the course, you will be refunded the purchase price upon return of all the equipment in working shape.<br />
<br />
== Student Contract ==<br />
<br />
By signing up for this course, you agree to complete the checklist above before the course starts. You agree to stay engaged during the class period; even if your computer is open, no facebook or other distractions that will lessen your contribution to the class. You understand that learning from classmates, and helping classmates, is encouraged, up to the stage of conceptualizing solutions. You are not allowed to fully complete a solution in a team. You understand that plagiarism is not tolerated. You will report instances of plagiarism you are aware of. Plagiarism includes, but is not limited to:<br />
<br />
* Allowing another student to copy your work.<br />
* Copying another student's work, in whole or in part.<br />
* Transforming copied sections of code or solutions to try to disguise their origin.<br />
* Borrowing code or solutions from others not in the course, e.g., code found on the internet, without attribution. Borrowing code found on the internet is acceptable if the source is clearly indicated in your code comments, and if you understand how the code works.<br />
<br />
On our part (faculty and TAs), we commit to do our best to provide you a curriculum and set of experimental materials to get you up to speed on sophisticated mechatronics integration as quickly and efficiently as possible, while giving you a foundation in concepts needed to go further in future projects and courses.<br />
<br />
== Prerequisite ==<br />
<br />
ME 233 Electronics Design or similar (EECS 221, 225, BME 305) is required. You will be expected to analyze circuits with resistors, capacitors, inductors, diodes, transistors, and op-amps. You can find refresher material and a sample quiz at [[ME_333_Circuits_Review_Material|this page]] and in Appendix B of the book.<br />
<br />
== Reading ==<br />
<br />
Required:<br />
<br />
* Textbook: "Embedded Computing and Mechatronics with the PIC32 Microcontroller" ([http://www.amazon.com/gp/product/0124201652/ Amazon], [http://store.elsevier.com/product.jsp?isbn=9780124201651 Elsevier]). Sample chapters, including the appendix "A Crash Course in C" can be found in the [[Media:EmbeddedComputingMechatronicsSampleChapters.pdf|freely downloadable sample chapters]]. <br />
** '''The textbook is included in the class kit, you do not need to buy it online or at the bookstore!'''<br />
* Optional: [[Media:EssentialC.pdf|Essential C]] is also a very nice intro to C. Let us know about other online C resources you find particularly useful.<br />
* [[Media:PIC32MXDS-Dec2013.pdf|PIC32MX5xx/6xx/7xx Family Data Sheet (Dec 2013)]]<br />
* [[Media:PIC32RefManual-Dec2013.pdf|PIC32 Reference Manual (Dec 2013)]]<br />
<br />
Find a typo in the book or a bug in the code? Report it [https://docs.google.com/forms/d/1LkHw5Lthzfudmoc3s3vediJe34B4qfFAnEiTqxew5IE/viewform?usp=send_form here]<br />
<!--<br />
Useful, but not required:<br />
* [http://www.amazon.com/Programming-32-bit-Microcontrollers-Exploring-Technology/dp/0750687096/ref=sr_1_1?ie=UTF8&s=books&qid=1294091438&sr=8-1-spell Programming 32-bit Microcontrollers in C: Exploring the PIC32] by Lucio Di Jasio. This is an easy to read and informative exploration of the PIC32.<br />
* Other C resources, such as [http://publications.gbdirect.co.uk/c_book/ online] as well as this [[Media:CBook.pdf|pdf version]] of "The C Book," and the classic [http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?s=books&ie=UTF8&qid=1294091625&sr=1-1 C Programming Language] reference book by Kernighan and Ritchie<br />
--><br />
<br />
== Grading ==<br />
<br />
Grades will be approximately 40% quizzes and 60% assignments and L-comps (including the final project). We will have short quizzes once a week at the beginning of class covering material on the previous assignment. (Your lowest quiz score, assignment score, and L-comp score will be dropped.) We will have a final project and demo in lieu of a final exam.<br />
<br />
All quizzes, assignments, and L-comps have equal weight, regardless of how many points they are graded out of. If one assignment is graded out of 20 points, and the next out of 40, the formula for calculating your total grade for these two assignments would be 0.5*(score1/20) + 0.5*(score2/40).<br />
<br />
== Homework Submission ==<br />
<br />
All homework will be submitted using the [http://www.it.northwestern.edu/education/login.html Canvas Course Management System]. Homework should be submitted by 11 AM on the day it is due (i.e., before the first section of the day). Late homework will not be accepted.<br />
<br />
Here are a few guidelines/tips associated with homework submissions:<br />
<br />
* Upload files individually. No zip archives!<br />
<br />
* Submit written responses as PDFs. <br />
<br />
* If you upload a PDF of handwritten work, make sure that the text appears clearly and the picture is oriented portrait style. <br />
<br />
* When asked to submit C code for a given programming assignment, we are only concerned with receiving the relevant source files, i.e., all *.c and *.h files. <br />
<br />
* When writing your responses, please follow any instructions on how to write your response. For example, if we ask for a snippet of code, please do not submit your entire C program with header files and a main routine. We typically are only expecting a few lines of code that solve the problem.<br />
<br />
* Be neat and make sure your answers are easy to follow. Messy hard-to-follow assignments make TAs cranky, and you don't want cranky TAs grading your assignment!<br />
<br />
* It helps both us and you if you format your code nicely. Clean looking code is easier for us to grade and easier for you to debug. Text editors with IDEs such as Visual Studio Code, Netbeans and MPLAB X have tools for auto-formatting code. For example, highlighting a region and hitting Alt+Shift+f (Linux and Windows) will format that region according to your local formatting preferences.<br />
<br />
* When you compile your code, pay attention to any compiler warnings. They are there for a reason! You should be able to eventually get your code to produce no warnings. Often if a piece of code is not working, the warnings will give a clue as to why.<br />
<br />
== Schedule ==<br />
<br />
This course is (partially) "flipped": you watch video lectures and do readings in advance of class, and during class, you should have plenty of opportunity for questions and interaction with the instructors and TAs as you work on assignments. The purpose of this is to try to maximize the value of the class time. In a typical lecture, 80% of the material is the same every time it is given, and the other 20% is interactive and variable based on student questions. In a flipped class, we hope to flip this percentage, to better tailor the class to student needs. You will have time with the instructors while your brains are actually on and working on the material (not just scribbling notes), the times when you are most likely to have questions. Making the video lectures available should also allow you to spend more or less time on the lecture portion, depending on your prior background. If the material is difficult for you, you can pause or rewind.<br />
<br />
'''Please keep track of any questions you have as you watch the videos!''' Bring these questions to class; it will make for a livelier classroom. <br />
<br />
All videos can be found at this page: [[NU32 Videos|'''NU32 Videos''']] and sample code at the bottom of [[NU32 Software|'''NU32 Software''']]. We will cover almost all of the Appendix, a Crash Course in C, in the first 1.5 weeks of class, so you can work ahead and do all the readings, watch all the videos, and do all the problems, if you have time over the break. But at a minimum, you must do the winter break assignment. <br />
<br />
We will have video lecture comprehension questions (L-comps) due before every class, assignments due every Tuesday, and quizzes every Thursday (on the material covered in the assignment turned in on Thursday). L-comps and assignments are turned in using Canvas before 11 AM the day of the class. The weekly rhythm will be:<br />
<br />
* before Tuesday: turn in assignment on material from previous week and L-comps on videos for the next class<br />
* Tuesday in class: discuss assignment, brief recap and Q&A on new videos, start on next assignment<br />
* before Thursday: turn in L-comps on videos for next class<br />
* Thursday in class: brief quiz on material in assignment turned in on Thursday, recap and discuss videos, continue with assignment<br />
<br />
'''Winter Break'''<br />
: '''Reading due for first class''': pages 515-527 in the [[Media:EmbeddedComputingMechatronicsSampleChapters.pdf|freely downloadable sample chapters]]<br />
: '''Videos''': 1-7 of Appendix A [[NU32 Videos]]. Answer the lecture comprehension (L-comp) questions in CANVAS. <br />
: '''Assignment''': Exercises 1-4, 6-8, 10-11, 16-17 of Appendix A.<br />
: '''Demonstration''': Make a video of your HelloWorld.c program and upload in CANVAS.<br />
<br />
'''Class 1''' (T 1/7) <br />
: '''Assignment due''': L-comp and exercise solutions, and demo video, for the Winter Break assignment by 11am on CANVAS. <br />
: '''In-class demo:''' Bring your laptop to class to make changes to HelloWorld.c<br />
: '''Assignment discussion'''<br />
: '''Brief review of videos and readings'''<br />
: '''Discussion'''<br />
: '''Begin next assignment:''' Appendix A exercises 18-19, 21-22, 27-28, 30-32, 34-35. <br />
: '''Demonstration''': Exercise 34.<br />
<br />
At home:<br />
: Videos and L-comps: 8-16 of a Crash Course in C. <br />
: Reading: Through page 562 of a Crash Course in C, and the rest of the Appendix as reference.<br />
<br />
'''Class 2''' (Th 1/9)<br />
: '''Before 11 AM:''' Turn in demo video for Exercise 34. <br />
: '''Assignment discussion'''<br />
: '''Brief review of videos, readings, and L-comps'''<br />
: '''Discussion'''<br />
: '''Begin next assignment:''' Exercise 35. <br />
: '''Demonstration''': Exercise 35.<br />
<br />
At home:<br />
: Videos (and L-comps): 17 of a Crash Course in C.<br />
: Reading: Rest of a Crash Course in C as reference<br />
<br />
: '''Note: Programming Party, Monday Jan 13, 6:00-8:00pm, Ford B100'''<br />
<br />
'''Class 3''' (T 1/14)<br />
: '''Before 11 AM:''' Turn in assignment, L-comps, and demo video.<br />
: '''Assignment discussion'''<br />
: '''Brief review of videos, readings, and L-comps'''<br />
: '''Discussion'''<br />
: '''In-class assignment: Quiz review'''<br />
<br />
At home:<br />
: Assignment: Study. <br />
<br />
'''Class 4''' (Th 1/16)<br />
: '''Quiz:''' On C. <br />
: '''Discussion''' Chapter 1<br />
<br />
At home:<br />
: Videos (no L-comps): Chapter 1 (for your specific OS)<br />
: Reading: Chapter 1: Quickstart<br />
: Download, install, and compile all software as indicated through the end of Chapter 1.3. See [[NU32 Software | NU32 Software]]<br />
<br />
'''Class 5''' (T 1/21)<br />
: '''Before 11 AM''': Watch Chapter 1 videos (no L-comps), install all software from Chapter 1<br />
: '''In class demonstration''': Compile helloWorld and talkingPIC for NU32.<br />
: '''Go over PIC32 software'''<br />
<br />
At home:<br />
: Videos (and L-comps): 1-4 from Chapter 2.<br />
: Reading: Complete Chapter 1 (quickstart) and Chapter 2. <br />
: Assignment: Problems 3-16 of Chapter 2. You will need the [[Media:PIC32MXDS-Dec2013.pdf|PIC32MX5xx/6xx/7xx Family Data Sheet (Dec 2013)]] and the [[Media:PIC32RefManual-Dec2013.pdf|PIC32 Reference Manual (Dec 2013)]].<br />
: Pay for your equipment.<br />
<br />
'''Class 6''' (Th 1/23)<br />
: Turn in Chapter 2 L-comps<br />
: Quiz on Chapter 1<br />
<br />
At home:<br />
: Videos (and L-comps): All of Chapter 3. <br />
: Reading: Complete Chapter 3.<br />
: Homework for Chapters 2<br />
<br />
'''Class 7''' (T 1/28)<br />
: '''Before 11 AM''': Turn in Homework from Chapter 2, L-comps for Chapter 3 videos, read Chapter 3<br />
: Review Quiz, Chapter 3, L-comps, and Homework<br />
<br />
At home:<br />
: Videos (and L-comps): All of Chapter 4. <br />
: Reading: Complete Chapter 4.<br />
: Homework for next Tuesday: Chapter 3, problems 1-9 (skip 5 for now, that will be a demo later). Chapter 4, problems 1, 2, and 4<br />
<br />
'''Class 8''' (Th 1/30)<br />
: '''Before 11 AM''': Turn in Chapter 4 L-comp.<br />
: Quiz on Chapter 2<br />
: '''Discussion of video and L-comp for Chapter 4'''<br />
: '''Brief intro to Chapter 4'''<br />
: In class demo: helloworld and talkingPic on the NU32<br />
<br />
At home:<br />
: Make sure your NU32 works, test simplePIC and talking PIC<br />
<br />
'''Class 9''' (T 2/4)<br />
: '''Before 11 AM''': Chapter 3 and 4 homework<br />
: Example programs with the USER button and LEDs<br />
<br />
'''Class 10''' (Th 2/6)<br />
: No quiz this week<br />
: More example programs<br />
<br />
'''Class 11''' (T 2/11)<br />
: '''Brief intro to Chapter 5'''<br />
<br />
At home:<br />
: Videos and L-comps on Chapter 5 <br />
: Reading: Complete Chapter 5. Start Chapter 6.<br />
: Homework: Chapter 5 (use no optimization for all exercises): Exercises 3, 4. Chapter 6: Exercises 1, 4, 5, 8, 9, 16.<br />
<br />
'''Class 12''' (Th 2/13)<br />
: Quiz on Chapter 3 and 4 and buttons and LEDs<br />
: '''Discussion of video and L-comp for Chapter 5'''<br />
: '''Brief intro to Chapter 6'''<br />
<br />
At home:<br />
: Videos and L-comps on Chapter 6 <br />
: Continue homework for Chapter 5 and 6<br />
<br />
<br />
'''Class 13''' (T 2/18)<br />
: '''Before 11 AM''': Turn in Homework from Chapter 5 and 6, L-comps for Chapter 6 videos<br />
: '''Brief intro to Chapter 24, and digital i/o and counter/timers'''<br />
<br />
At home:<br />
: Videos and L-comps on Chapters 7 and 8<br />
: Reading: Chapters 7 and 8<br />
: Assignment: Chapter 7: Exercises 1,2. Chapter 8: Exercise 1. Chapter 9: Exercise 1. Chapter 10: Exercise 1,2.<br />
<br />
'''Class 14''' (Th 2/20)<br />
: '''Quiz on Chapter 5 and 6'''<br />
: '''Brief intro to output compare'''<br />
<br />
At home:<br />
: Videos and L-comps on Chapters 9 and 10<br />
: Reading: Chapters 9 and 10<br />
: Assignment: : Chapter 24.1.2, 24.2.1 and 2, 24.3.1 and 2<br />
<br />
'''Class 15''' (T 2/25)<br />
: '''Before 11 AM''': L-comps from Chapter 9, 10 and 23, Assignment from Chapter 7-10<br />
: '''Discussion of turned-in homework'''<br />
: '''Discussion of L-comps'''<br />
: '''Intro to Chapter 23 and 24'''<br />
<br />
At home:<br />
: Homework: Chapter 24.5, 24.7, and 24.8.<br />
<br />
'''Class 16''' (Th 2/27)<br />
: '''Quiz on Chapter 7-10'''<br />
: Review Chapter 24<br />
:'''Work on assignment'''<br />
<br />
At home:<br />
: Complete Chapter 24<br />
<br />
'''Class 17''' (T 3/3)<br />
: '''Before 11 AM''': Upload solutions and demo for Ch 24<br />
: '''Discussion of turned-in homework'''<br />
: Discussion of Chapter 25 and 28<br />
: Hand out motors<br />
<br />
At home: <br />
: Assignment: : Read Chapter 28 through 28.4.1. Turn in your responses to 28.4.1 #7, 28.4.7 #7, 28.4.9 #8 <br />
<br />
'''Class 18''' (Th 3/5)<br />
: '''Quiz on Chapter 23, PID Control.'''<br />
: Discussion of Chapter 26 and 27<br />
<br />
At home:<br />
: Continue Chapter 28<br />
: L-comps for Chapter 27<br />
<br />
'''Class 19''' (T 3/10) <br />
: '''Before 11 AM''': L-comps<br />
: Discussion of Chapter 29<br />
<br />
At home:<br />
: Complete Chapter 28: 28.4.10 #5, 28.4.12 #5.<br />
: Sign up for a time slot to demonstrate your final assignment: [https://docs.google.com/spreadsheets/d/1reEmJ7B2UCTsKIef9iCSJKDipg_J4DuTVHDbNA6Ls-0/edit?usp=sharing google_sheet]<br />
<br />
'''Class 20''' (Th 3/12)<br />
: '''Final Quiz, on Chapter 25, 26 and 27'''<br />
<br />
'''Final Demo''': <br />
: In person, on Monday 3/16, 3-5 PM, or Wednesday 3/18, 9-11 AM. <br />
: Electronic submission by Wednesday 3/18, 11 AM.<br />
: Turn in your responses to 28.4.1 #7, 28.4.7 #7, 28.4.9 #8, 28.4.10 #5, 28.4.12 #5. Also turn in all of your PIC code and MATLAB code.<br />
: Upload a demonstration video of the results of good current tuning, and following a trajectory with good gains and bad gains.<br />
<br />
<br />
<!--<br />
<br />
<br />
: Sign up for a 5 minute time slot to demo your final project: TBD<br />
<br />
[https://docs.google.com/spreadsheets/d/1reEmJ7B2UCTsKIef9iCSJKDipg_J4DuTVHDbNA6Ls-0/edit?usp=sharing googledoc]<br />
<br />
<br />
--><br />
<br />
== FAQ ==<br />
<br />
Q: Do I need to know the C language to take this course?<br />
<br />
A: No. But if you already know C, there is still plenty else in this course for you. If you already know C, know how to use microcontrollers for real-time control, and have a good understanding how common sensors and actuators work and how to interface to them, this course may not be for you. Consider taking ME 433 Advanced Mechatronics in the spring quarter.<br />
<br />
<br />
Q: Is there an independent project?<br />
<br />
A: There is no large independent project. There will be a two-week project at the end of the course, but there will be no machining. For a more significant project, take ME 433 Advanced Mechatronics, offered in the spring quarter. ME 333 is good preparation for ME 433.<br />
<br />
<br />
Q: What kind of laptop do I need?<br />
<br />
A: You need a laptop with at least 2 USB ports. Any operating system is fine.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-05-04T13:28:33Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''Note 3: In Modern Robotics, we use a number of CoppeliaSim's features for features, but you will not become an expert user of CoppeliaSim. For those who would like to learn more, you can check out [https://www.youtube.com/watch?v=PwGY8PxQOXY&list=PLjzuoBhdtaXOoqkJUqhYQletLLnJP8vjZ this YouTube playlist of videos].'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forums].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
According to one Coursera student who initially had trouble with CoppeliaSim's video recorder:<br />
<br />
''I had an issue with integrated video recording. The error was "The video compressor failed initializing." It was resolved by switching output format from default "AVI/H.263+ / H-263-1998 / H.263 version 2" to "AVI/MPEG-4 part 2".''<br />
<br />
Try recording and saving a 10-second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_Errata,_First_Edition_Version_1Modern Robotics Errata, First Edition Version 12020-04-14T13:55:52Z<p>Lynch: /* Chapter 4 */</p>
<hr />
<div>Errata below are for the original first edition hardcover book published by Cambridge University Press and the corresponding preprint version of the book posted on May 3, 2017. '''[[Modern Robotics Errata|Errata for the updated first edition of the book, late 2019, can be found here.]]'''<br />
<br />
== Book: Significant corrections ==<br />
<br />
=== Chapter 2 ===<br />
<br />
* Proposition 2.2 says that Grubler's formula "provides a lower bound on the number of degrees of freedom" of a mechanism to account for the case where the joint constraints are not independent. This statement is misleading, as it assumes a linear analysis of mobility. In fact, some mechanisms may have '''fewer''' dof than implied by Grubler's formula by a higher-order analysis. A more correct statement is that Grubler's formula yields the correct number of dof in the "generic" case (where the joint constraints are independent and a linear analysis of mobility suffices), but a mechanism may have more dof (e.g., if the joint constraints are not independent everywhere) or fewer dof (e.g., the zero-dof four-bar linkage where the sum of the lengths of three links equals the length of the fourth link). This comment also applies to the sentence immediately after Example 2.6, the fifth bullet of the Summary in Chapter 2.6, and the second-to-last sentence of the third paragraph of Chapter 1's summary of Chapter 2.<br />
<br />
=== Chapter 3 ===<br />
<br />
* In the caption of Figure 3.3, it should read <math>\hat{\text{x}}_{\text{b}} = (1/2, \sqrt{3}/2)</math> and <math>\hat{\text{y}}_{\text{b}} = (-\sqrt{3}/2, 1/2)</math>.<br />
* Under "Representing a configuration" in Chapter 3.3.1.2, the text says "<math>T_{bc} = (R_{bc},p_{bc})</math> represents {b} relative to {c}" but it should say "represents {c} relative to {b}".<br />
* There is a typo in the final matrix, <math>T_{ce}</math>, of Example 3.19. The term <math>130/\sqrt{2}</math> should be <math>160/\sqrt{2}</math>. (Also, there is no need to use <math>T_{ad}</math> in this example.)<br />
* In the displayed equation just after Equation (3.76), the left-hand side should be <math>[\mathcal{V}_s]</math> (the brackets are missing).<br />
* '''At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".'''<br />
* Exercise 3.16(i) asks for "the <math>\{q,\hat{s},h\}</math> representation" but it should say "a <math>\{q,\hat{s},h\}</math> representation" since <math>q</math> is not unique.<br />
* '''Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.'''<br />
* '''Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 4 ===<br />
<br />
* Example 4.1, last row of the table (screw axis for joint 3): The linear component <math>v_i</math> should be <math>(0, -L_2, 0)</math> (the <math>-</math> sign is missing).<br />
* Exercise 4.21: The question should begin "For each <math>T</math> below..." (instead of "For each <math>T \in SE(3)</math> below...") since the first part of the problem is determining whether <math>T</math> is indeed an element of <math>SE(3)</math>.<br />
<br />
=== Chapter 5 ===<br />
<br />
* Equation (5.7): The first two terms on the right-hand side of the equation should be <math>J_{s1} \dot{\theta}_1 + J_{s2}(\theta) \dot{\theta}_2</math>.<br />
<br />
* Exercise 5.2(b): The wrench applied by the last link, expressed in the {s} frame, is 5 N in the <math>\hat{\text{y}}_{\text{s}}</math> direction, with zeros in all other components. (The wording seems to imply that the force is through the tip of the last link, which is incorrect.)<br />
<br />
* Exercise 5.16 and Figure 5.26: The robot is referred to as PRRRRR, but it is PRPRRR.<br />
<br />
=== Chapter 6 ===<br />
<br />
* Chapter 6.3, first line after Eq (6.7): the matrices <math>T_{sd}^{-1} \dot{T}_{sd}</math> and <math>\dot{T}_{sd} T_{sd}^{-1}</math> are referred to as twists, but these are the se(3) matrix representations of the twists.<br />
<br />
=== Chapter 8 ===<br />
<br />
* In Equation (8.14), <math>\mathcal{K}(\theta)</math> should be replaced by <math>\mathcal{K}(\theta,\dot{\theta})</math>.<br />
<br />
* Figure 8.5 says the volume of the rectangular parallelepiped is <math>abc</math> but it should be <math>hlw</math>.<br />
<br />
* End of first sentence after Eq (8.26) in Section 8.2.1 should read "columns of <math>R_{bc}</math> correspond to the eigenvectors of <math>\mathcal{I}_b</math>." (The word "eigenvalues" should be replaced by "eigenvectors.")<br />
<br />
* '''Equation (8.74): the first two plus signs should be minus signs.''' <!-- this was discovered after second printing--><br />
<br />
* In the parenthetical text a few lines after Equation (8.94): "...there is an equality constraint..." should instead be "...there is also an inequality constraint..."<br />
<br />
* Caption of Figure 8.10: The operating region is light gray and the continuous operating region is dark gray.<br />
<br />
* Exercise 8.6(a): The expression <math>\text{ad}_{J_i}(J_j)</math> has the indices switched; the correct expression is <math>\text{ad}_{J_j}(J_i)</math>.<br />
<br />
* Exercise 8.7: The expression should be written:<br />
<math><br />
\dot{M} = -\mathcal{A}^{\rm T} \mathcal{L}^{\rm T} \mathcal{W}^{\rm T} [\mbox{ad}_{\mathcal{A} \dot{\theta}}]^{\rm T} \mathcal{L}^{\rm T} \mathcal{GLA} -<br />
\mathcal{A}^{\rm T} \mathcal{L}^{\rm T} \mathcal{GL} [\mbox{ad}_{\mathcal{A} \dot{\theta}}] \mathcal{WLA}<br />
</math><br />
<br />
=== Chapter 10 ===<br />
<br />
* Equation (10.4) should read <math> u = F(q) - B \dot{q}</math> (the plus sign in the book should be a minus sign).<br />
<br />
* First line of chapter 10.6.4: The equation should be <math>u = F(q) - B \dot{q}</math> (plus sign should be a minus sign). Similarly, in the last sentence of chapter 10.6.4, the plus sign should be a minus sign.<br />
<br />
=== Chapter 11 ===<br />
<br />
* In the displayed equation after Equation (11.18), the vector <math>X_e(t)</math> is a six-vector. The bottom three elements are written correctly, but the top three elements, an angular velocity, are written instead in their 3x3 <math>so(3)</math> form. Also, the term written <math>R^{\text{T}}(d)</math> should be written <math>R^{\text{T}}(t)</math>.<br />
<br />
* In Equation (11.33), the right-hand side should be zero (<math>c = 0</math>).<br />
<br />
* Figure 11.24, the Robonaut 2 series elastic actuator, 4th sentence of the caption: The words "outer" and "inner" should be switched, so the new sentence reads "The inner ring of hole mounts connects to the harmonic gearhead output, and the outer ring of hole mounts is the output of the SEA, connecting to the next link."<br />
<br />
=== Chapter 12 ===<br />
<br />
* In Example 12.4, the elements of the wrenches <math>\mathcal{F}_1, \mathcal{F}_2, \mathcal{F}_3</math> are erroneously written in the order <math>(f_x,f_y,m_z)</math>; they should be written in the order <math>(m_z,f_x,f_y)</math>, i.e., <math>(-2,0,1), (1,-1,0), (1,1,0)</math>, respectively.<br />
<br />
=== Appendix C ===<br />
<br />
* Section C.3, Equation (C.5): All instances of <math>\phi_{i-1}</math> should be replaced by <math>\phi_i</math>.<br />
<br />
* In Equation (C.12), two instances of <math>M_{i-1}</math> should be replaced by <math>M_i</math>.<br />
<br />
== Book: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Chapter 1 ===<br />
<br />
* (online version only) Description of Chapter 6: "jont positions" should be "joint positions."<br />
<br />
=== Chapter 2 ===<br />
<br />
* Chapter 2.2.2, Example 2.3: "Substituting" is misspelled.<br />
<br />
=== Chapter 3 ===<br />
<br />
* Near the end of Chapter 3.6 Software, the function "AxisAng" should be written "AxisAng6."<br />
<br />
=== Chapter 5 ===<br />
<br />
* Figure 5.15(b): The circular arrow indicating the rotation of joint 3 is slightly misplaced.<br />
<br />
* Exercise 5.25: This problem instructs you to use the space Jacobian, so you should use it for the manipulability ellipsoids in this problem (even though it is generally preferred to use the body Jacobian for manipulability ellipsoids).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (online version only) Figure 6.7: <math>\theta_0</math> should be <math>\theta^0</math> (five times) and <math>\theta_1</math> should be <math>\theta^1</math> (one time).<br />
* '''Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* '''Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.'''<br />
<br />
=== Chapter 7 ===<br />
<br />
* (online version only) Last line of first paragraph of Chapter 7.1: "valuees" should be "values."<br />
* Just below caption for Figure 7.8: There is an extraneous dot.<br />
<br />
=== Chapter 8 ===<br />
<br />
* (online version only) Chapter 8.1.1, last paragraph: <math>\dot{\theta}_1</math> is improperly typeset.<br />
<br />
=== Chapter 12 ===<br />
<br />
* Caption of Figure 12.14, second-to-last sentence: "rotation if possible" should be "rotation is possible."<br />
* (online version only) Example 12.11: The sentence "... can remain standing if there is a consistent solution if there exist <math>k_i \geq 0</math> ..." should read simply "... if there exist <math>k_i \geq 0</math> ..."<br />
<br />
=== Chapter 13 ===<br />
<br />
* Equation (13.29): <math>y_p</math> should be <math>y_P</math>.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jose Capco</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-14T13:55:17Z<p>Lynch: /* Chapter 4 */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 4 ===<br />
<br />
* Exercise 4.21: The question should begin "For each <math>T</math> below..." (instead of "For each <math>T \in SE(3)</math> below...") since the first part of the problem is determining whether <math>T</math> is indeed an element of <math>SE(3)</math>.<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force <math>F_{ij}(q)</math>, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li, Jose Capco</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-14T13:54:52Z<p>Lynch: </p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 4 ===<br />
<br />
* Exercise 4.21: The question should begin "For each <math>T</math> below..." (instead of "For each <math>T \in SE(3) below...") since the first part of the problem is determining whether <math>T</math> is indeed an element of <math>SE(3)</math>.<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force <math>F_{ij}(q)</math>, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li, Jose Capco</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-14T13:52:05Z<p>Lynch: /* A partial list of errata contributors */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force <math>F_{ij}(q)</math>, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li, Jose Capco</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_Errata,_First_Edition_Version_1Modern Robotics Errata, First Edition Version 12020-04-14T13:51:44Z<p>Lynch: /* A partial list of errata contributors */</p>
<hr />
<div>Errata below are for the original first edition hardcover book published by Cambridge University Press and the corresponding preprint version of the book posted on May 3, 2017. '''[[Modern Robotics Errata|Errata for the updated first edition of the book, late 2019, can be found here.]]'''<br />
<br />
== Book: Significant corrections ==<br />
<br />
=== Chapter 2 ===<br />
<br />
* Proposition 2.2 says that Grubler's formula "provides a lower bound on the number of degrees of freedom" of a mechanism to account for the case where the joint constraints are not independent. This statement is misleading, as it assumes a linear analysis of mobility. In fact, some mechanisms may have '''fewer''' dof than implied by Grubler's formula by a higher-order analysis. A more correct statement is that Grubler's formula yields the correct number of dof in the "generic" case (where the joint constraints are independent and a linear analysis of mobility suffices), but a mechanism may have more dof (e.g., if the joint constraints are not independent everywhere) or fewer dof (e.g., the zero-dof four-bar linkage where the sum of the lengths of three links equals the length of the fourth link). This comment also applies to the sentence immediately after Example 2.6, the fifth bullet of the Summary in Chapter 2.6, and the second-to-last sentence of the third paragraph of Chapter 1's summary of Chapter 2.<br />
<br />
=== Chapter 3 ===<br />
<br />
* In the caption of Figure 3.3, it should read <math>\hat{\text{x}}_{\text{b}} = (1/2, \sqrt{3}/2)</math> and <math>\hat{\text{y}}_{\text{b}} = (-\sqrt{3}/2, 1/2)</math>.<br />
* Under "Representing a configuration" in Chapter 3.3.1.2, the text says "<math>T_{bc} = (R_{bc},p_{bc})</math> represents {b} relative to {c}" but it should say "represents {c} relative to {b}".<br />
* There is a typo in the final matrix, <math>T_{ce}</math>, of Example 3.19. The term <math>130/\sqrt{2}</math> should be <math>160/\sqrt{2}</math>. (Also, there is no need to use <math>T_{ad}</math> in this example.)<br />
* In the displayed equation just after Equation (3.76), the left-hand side should be <math>[\mathcal{V}_s]</math> (the brackets are missing).<br />
* '''At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".'''<br />
* Exercise 3.16(i) asks for "the <math>\{q,\hat{s},h\}</math> representation" but it should say "a <math>\{q,\hat{s},h\}</math> representation" since <math>q</math> is not unique.<br />
* '''Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.'''<br />
* '''Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 4 ===<br />
<br />
* Example 4.1, last row of the table (screw axis for joint 3): The linear component <math>v_i</math> should be <math>(0, -L_2, 0)</math> (the <math>-</math> sign is missing).<br />
<br />
=== Chapter 5 ===<br />
<br />
* Equation (5.7): The first two terms on the right-hand side of the equation should be <math>J_{s1} \dot{\theta}_1 + J_{s2}(\theta) \dot{\theta}_2</math>.<br />
<br />
* Exercise 5.2(b): The wrench applied by the last link, expressed in the {s} frame, is 5 N in the <math>\hat{\text{y}}_{\text{s}}</math> direction, with zeros in all other components. (The wording seems to imply that the force is through the tip of the last link, which is incorrect.)<br />
<br />
* Exercise 5.16 and Figure 5.26: The robot is referred to as PRRRRR, but it is PRPRRR.<br />
<br />
=== Chapter 6 ===<br />
<br />
* Chapter 6.3, first line after Eq (6.7): the matrices <math>T_{sd}^{-1} \dot{T}_{sd}</math> and <math>\dot{T}_{sd} T_{sd}^{-1}</math> are referred to as twists, but these are the se(3) matrix representations of the twists.<br />
<br />
=== Chapter 8 ===<br />
<br />
* In Equation (8.14), <math>\mathcal{K}(\theta)</math> should be replaced by <math>\mathcal{K}(\theta,\dot{\theta})</math>.<br />
<br />
* Figure 8.5 says the volume of the rectangular parallelepiped is <math>abc</math> but it should be <math>hlw</math>.<br />
<br />
* End of first sentence after Eq (8.26) in Section 8.2.1 should read "columns of <math>R_{bc}</math> correspond to the eigenvectors of <math>\mathcal{I}_b</math>." (The word "eigenvalues" should be replaced by "eigenvectors.")<br />
<br />
* '''Equation (8.74): the first two plus signs should be minus signs.''' <!-- this was discovered after second printing--><br />
<br />
* In the parenthetical text a few lines after Equation (8.94): "...there is an equality constraint..." should instead be "...there is also an inequality constraint..."<br />
<br />
* Caption of Figure 8.10: The operating region is light gray and the continuous operating region is dark gray.<br />
<br />
* Exercise 8.6(a): The expression <math>\text{ad}_{J_i}(J_j)</math> has the indices switched; the correct expression is <math>\text{ad}_{J_j}(J_i)</math>.<br />
<br />
* Exercise 8.7: The expression should be written:<br />
<math><br />
\dot{M} = -\mathcal{A}^{\rm T} \mathcal{L}^{\rm T} \mathcal{W}^{\rm T} [\mbox{ad}_{\mathcal{A} \dot{\theta}}]^{\rm T} \mathcal{L}^{\rm T} \mathcal{GLA} -<br />
\mathcal{A}^{\rm T} \mathcal{L}^{\rm T} \mathcal{GL} [\mbox{ad}_{\mathcal{A} \dot{\theta}}] \mathcal{WLA}<br />
</math><br />
<br />
=== Chapter 10 ===<br />
<br />
* Equation (10.4) should read <math> u = F(q) - B \dot{q}</math> (the plus sign in the book should be a minus sign).<br />
<br />
* First line of chapter 10.6.4: The equation should be <math>u = F(q) - B \dot{q}</math> (plus sign should be a minus sign). Similarly, in the last sentence of chapter 10.6.4, the plus sign should be a minus sign.<br />
<br />
=== Chapter 11 ===<br />
<br />
* In the displayed equation after Equation (11.18), the vector <math>X_e(t)</math> is a six-vector. The bottom three elements are written correctly, but the top three elements, an angular velocity, are written instead in their 3x3 <math>so(3)</math> form. Also, the term written <math>R^{\text{T}}(d)</math> should be written <math>R^{\text{T}}(t)</math>.<br />
<br />
* In Equation (11.33), the right-hand side should be zero (<math>c = 0</math>).<br />
<br />
* Figure 11.24, the Robonaut 2 series elastic actuator, 4th sentence of the caption: The words "outer" and "inner" should be switched, so the new sentence reads "The inner ring of hole mounts connects to the harmonic gearhead output, and the outer ring of hole mounts is the output of the SEA, connecting to the next link."<br />
<br />
=== Chapter 12 ===<br />
<br />
* In Example 12.4, the elements of the wrenches <math>\mathcal{F}_1, \mathcal{F}_2, \mathcal{F}_3</math> are erroneously written in the order <math>(f_x,f_y,m_z)</math>; they should be written in the order <math>(m_z,f_x,f_y)</math>, i.e., <math>(-2,0,1), (1,-1,0), (1,1,0)</math>, respectively.<br />
<br />
=== Appendix C ===<br />
<br />
* Section C.3, Equation (C.5): All instances of <math>\phi_{i-1}</math> should be replaced by <math>\phi_i</math>.<br />
<br />
* In Equation (C.12), two instances of <math>M_{i-1}</math> should be replaced by <math>M_i</math>.<br />
<br />
== Book: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Chapter 1 ===<br />
<br />
* (online version only) Description of Chapter 6: "jont positions" should be "joint positions."<br />
<br />
=== Chapter 2 ===<br />
<br />
* Chapter 2.2.2, Example 2.3: "Substituting" is misspelled.<br />
<br />
=== Chapter 3 ===<br />
<br />
* Near the end of Chapter 3.6 Software, the function "AxisAng" should be written "AxisAng6."<br />
<br />
=== Chapter 5 ===<br />
<br />
* Figure 5.15(b): The circular arrow indicating the rotation of joint 3 is slightly misplaced.<br />
<br />
* Exercise 5.25: This problem instructs you to use the space Jacobian, so you should use it for the manipulability ellipsoids in this problem (even though it is generally preferred to use the body Jacobian for manipulability ellipsoids).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (online version only) Figure 6.7: <math>\theta_0</math> should be <math>\theta^0</math> (five times) and <math>\theta_1</math> should be <math>\theta^1</math> (one time).<br />
* '''Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* '''Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.'''<br />
<br />
=== Chapter 7 ===<br />
<br />
* (online version only) Last line of first paragraph of Chapter 7.1: "valuees" should be "values."<br />
* Just below caption for Figure 7.8: There is an extraneous dot.<br />
<br />
=== Chapter 8 ===<br />
<br />
* (online version only) Chapter 8.1.1, last paragraph: <math>\dot{\theta}_1</math> is improperly typeset.<br />
<br />
=== Chapter 12 ===<br />
<br />
* Caption of Figure 12.14, second-to-last sentence: "rotation if possible" should be "rotation is possible."<br />
* (online version only) Example 12.11: The sentence "... can remain standing if there is a consistent solution if there exist <math>k_i \geq 0</math> ..." should read simply "... if there exist <math>k_i \geq 0</math> ..."<br />
<br />
=== Chapter 13 ===<br />
<br />
* Equation (13.29): <math>y_p</math> should be <math>y_P</math>.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jose Capco</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_RoboticsModern Robotics2020-04-14T13:51:03Z<p>Lynch: /* Errata */</p>
<hr />
<div>[[File:ModernRoboticsCover.jpg|right|thumb|x300px|The Cambridge University Press cover.]] <br />
This is the home page of the textbook "Modern Robotics: Mechanics, Planning, and Control," Kevin M. Lynch and Frank C. Park, Cambridge University Press, 2017, ISBN 9781107156302. Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below.<br />
<br />
[[File:ModernRoboticsCMPCover.jpg|right|thumb|x300px|[https://item.jd.com/12788036.html The Chinese version from China Machine Press.]]] <br />
<br />
'''New!''' You can purchase [https://item.jd.com/12788036.html '''the Chinese translation of the book'''].<br />
<br />
'''[[Modern_Robotics#Online_Courses | Modern Robotics is available as online courses on Coursera.]]'''<br />
<br />
'''From the foreword:'''<br />
<br />
"Frank and Kevin have provided a wonderfully clear and patient explanation of their subject." '''Roger Brockett''', ''Harvard University''<br />
<br />
"''Modern Robotics'' imparts the most important insights of robotics ... with a clarity that makes it accessible to undergraduate students." '''Matthew T. Mason''', ''Carnegie Mellon University''<br />
<br />
'''From the [https://ieeexplore.ieee.org/document/8897162 IEEE Control Systems Magazine book review]:'''<br />
<br />
"It is the pedagogical strength of this book that concepts from Lie group theory (which form the building blocks of modern kinematics) are presented in a way that will appeal to undergraduate students as well as to researchers and roboticists in general. ... For some time, this approach was deemed too complicated to be taught in undergraduate robotics classes. However, this book by Lynch and Park should change the conventional wisdom on this issue. ... With its consolidated modern approach, ''Modern Robotics'' is destined to become a classic in the field." '''Andreas Mueller''', ''Johannes Kepler University, Austria''<br />
<br />
== Book, Practice Exercises, and Linear Algebra Review ==<br />
<br />
Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below. You can also purchase [https://item.jd.com/12788036.html '''the Chinese version of the book'''].<br />
<br />
The current version of the book is the updated first edition (online preprint dated December 2019, printed published version from Cambridge marked "3rd printing 2019" or later). The updated first edition (also referred to as "version 2") includes several corrections and minor additions to the original first edition (first published in May 2017).<br />
<br />
This book is the result of course notes developed over many years for the course M2794.0027 Introduction to Robotics at Seoul National University and ME 449 Robotic Manipulation at Northwestern University. The evolving course notes have been posted on the internet for years to support these classes. <br />
<br />
The for-purchase version of the book from Cambridge University Press has improved layout and typesetting, updated figures, different pagination (and fewer pages), and more careful copyediting, and it is considered the "official" version of the book. But the online preprint version of the book has the same chapters, sections, and exercises, and it is quite close in content to the Cambridge-published version. <br />
<br />
We are posting four versions of the book. All versions have exactly the same contents and pagination. They differ only in the sizes of the margins and the size of the print, as manipulated in Adobe Acrobat after latex'ing. Two of the versions have working hyperlinks for navigating the book on your computer or tablet.<br />
<br />
'''With working hyperlinks.''' (To navigate the book using the hyperlinks, click on the hyperlink. To go back where you came from, choose the button or keystroke appropriate to your pdf reader. For example, on the Mac with Acrobat or Acrobat Reader, use cmd-left arrow. With Preview on the Mac, use cmd-[. Some readers on other operating systems use alt-left arrow. You can google to see which solution works for your pdf reader.)<br />
* [[Media:MR-v2.pdf|Default 8.5x11 or A4 version]]. Printable version with 10 pt font and large margins.<br />
* [[Media:MR-tablet-v2.pdf|Tablet version]]. Margins have been eliminated so that no space is wasted when viewing the document on a computer or tablet.<br />
<br />
'''Printable versions without working hyperlinks.'''<br />
* [[Media:MR-largefont-v2.pdf|Large font 8.5x11 or A4 version]]. Printable version with 12 pt font equivalent and smaller margins than the 10 pt default version.<br />
* [[Media:MR-2up-v2.pdf|2up version]]. Printable version with 2 book pages per page, for saving paper if you have good eyes. Approximately 8.5 pt font equivalent.<br />
<br />
These files have been compressed to about 7 MB. Let us know if you have any problems reading them. Please note that some versions of the default Mac OS X pdf reader, Preview, are known to have bugs displaying certain images in pdf files. If a figure is not appearing properly, please try a better pdf viewer, like Acrobat Reader.<br />
<br />
'''Table of Contents:'''<br />
# Preview<br />
# Configuration Space<br />
# Rigid-Body Motions<br />
# Forward Kinematics<br />
# Velocity Kinematics and Statics<br />
# Inverse Kinematics<br />
# Kinematics of Closed Chains<br />
# Dynamics of Open Chains<br />
# Trajectory Generation<br />
# Motion Planning<br />
# Robot Control<br />
# Grasping and Manipulation<br />
# Wheeled Mobile Robots<br />
<br />
:Appendix A. Summary of Useful Formulas<br />
<br />
:Appendix B. Other Representations of Rotations<br />
<br />
:Appendix C. Denavit-Hartenberg Parameters<br />
<br />
:Appendix D. Optimization and Lagrange Multipliers<br />
<br />
== Useful Supplemental Documents ==<br />
<br />
* [[Media:MR_practice_exercises.pdf|Practice exercises to give you more experience with the material]]. These practice exercises come with solutions, since Cambridge makes the end-of-chapter solutions available to instructors only.<br />
* [[Modern Robotics Linear Algebra Review|A linear algebra refresher appendix to accompany the book.]]<br />
<br clear=all><br />
<br />
== Videos ==<br />
<br />
* [http://modernrobotics.northwestern.edu '''Click here'''] to watch the video lectures embedded in a convenient viewing environment. <br />
* [[Modern Robotics Videos|'''Click here''']] if you prefer to watch the videos within the YouTube environment.<br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension]. Also check out the [https://robotacademy.net.au/ Robot Academy at Queensland University of Technology].<br />
<br />
== Solution Manual ==<br />
<br />
If you are an instructor, you can obtain a copy of the exercise solutions from Cambridge University Press. Go to the "Resources" section of [http://www.cambridge.org/us/academic/subjects/computer-science/computer-graphics-image-processing-and-robotics/modern-robotics-mechanics-planning-and-control '''the Cambridge University Press webpage for the book'''].<br />
<br />
== Prerequisites ==<br />
<br />
This book was written to be accessible to engineering students after taking typical first-year engineering courses. The student should have an understanding of:<br />
* freshman-level physics, including f = ma; free-body diagrams with masses, springs, and dampers; vector forces; and vector torques (or moments) as the cross product of a distance vector and a force;<br />
* linear algebra, including matrix operations, positive definiteness of a matrix, determinants, complex numbers, eigenvalues, and eigenvectors; <br />
* some calculus, derivatives, and partial derivatives; and<br />
* basic linear ordinary differential equations.<br />
<br />
The student should also be prepared to program, but only basic programming skills are needed. Code is provided in python (freely available), MATLAB (for purchase, or you could use the freely available GNU Octave clone), and Mathematica (for purchase), so those languages are preferred.<br />
<br />
== [[Modern Robotics Errata|Errata]] == <br />
<br />
'''[[Modern Robotics Errata|Errata for the book can be found here. Please click here to report any corrections, typos, or comments.]]'''<br />
<br />
== Software ==<br />
<br />
[https://github.com/NxRLab/ModernRobotics '''Download the book software from GitHub.''']<br />
<br />
The software accompanying the book is written in Mathematica, MATLAB, and Python. It is written to be educational and to reinforce the concepts in the book, not to be as computationally efficient or robust as possible. <br />
<br />
The origin of the software is student solutions to homework exercises. A major update was committed in January 2017, correcting some bugs in the earlier version.<br />
<br />
[https://github.com/NxRLab/ModernRobotics/issues '''To report any issues with the software, please click the "Issues" tab in GitHub.''']<br />
<br />
== Simulation ==<br />
<br />
[[image:youbot.jpg|right]]<br />
<br />
We have found [http://www.coppeliarobotics.com/ '''the CoppeliaSim robot simulation environment'''] (formerly known as V-REP) to be a valuable learning tool accompanying the book. It is free for educational use and cross platform. In ME 449 at Northwestern, we use it to experiment with the kinematics of different robots and to animate solutions to inverse kinematics, dynamic simulations, and controllers. <br />
<br />
[[Getting_Started_with_the_CoppeliaSim_Simulator|'''This page''']] gets you started with CoppeliaSim quickly.<br />
<br />
[[CoppeliaSim_Introduction|'''This page''']] provides "scenes" that allow you to interactively explore the kinematics of different robots (e.g., the Universal Robots UR5 6R robot arm and the KUKA youBot mobile manipulator) and to animate trajectories that are the results of exercises in chapters on kinematics, dynamics, and control.<br />
<br />
* [[Media:UR5-IK-720p.mov|A video of a UR5 trajectory created by solving numerical inverse kinematics (Chapter 6, Inverse Kinematics)]]<br />
* [[Media:UR5-falling-720p.mov|A video of the UR5 falling under gravity for 10 s, assuming no friction or gearing at the joints (Chapter 8, Dynamics of Open Chains)]]<br />
* [[Media:youbot-controlled.mov|A video of the KUKA youBot mobile manipulator using Jacobian-pseudoinverse-based control of the end-effector's motion (Chapter 13, Wheeled Mobile Robots)]]<br />
<br />
<br clear=all><br />
<!-- == Videos ==<br />
[https://youtu.be/ftOle31x9NM '''Welcome to Modern Robotics!''' (2:00)]<br />
<br />
Videos supporting the book will be posted to YouTube and linked to from this wiki. [https://youtu.be/PCeP30q795g '''Here is a sample video.'''] Others will be posted in August 2017. <br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension].<br />
--><br />
<br />
== Online Courses ==<br />
<br />
Modern Robotics is now available as a MOOC (massive open online course) Specialization on Coursera!<br />
<br />
'''[https://www.coursera.org/specializations/modernrobotics This is a link to the Specialization home page.]''' The Specialization consists of six short courses, each expected to take approximately four weeks of approximately five hours of effort per week:<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together some of the supplemental material used in the Coursera MOOCs]]'''.<br />
<br />
The material in Modern Robotics also forms the basis for two edX online courses. These courses were created before the book was finished, so some of the notation used is a bit different from that used in the book.<br />
<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-i Robot Mechanics and Control, Part I]<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-ii Robot Mechanics and Control, Part II]<br />
<br />
== Using the Online Course Materials in a Traditional Classroom Course ==<br />
<br />
If you are using the book in a traditional university setting, you can ask your students to sign up for the relevant courses on Coursera (see above). They can audit the courses, so they don't have to pay. They will have access to the video lectures and to the video comprehension questions that follow each video lecture. They will also have access to discussion forums. (They won't have access to graded tests and peer-graded assignments, which require paying the Coursera fee.) If students watch the videos and do the reading before class, you can spend class time working on example problems, homework problems, or discussing points where confusion arises, rather than delivering a traditional lecture.<br />
<br />
== Supplemental Information ==<br />
<br />
* UR5 parameters you can use for dynamic simulations (note: the values are not exact, and do not account for the effect of gearing at the joints)<br />
** [[Media:UR5-parameters.nb|UR5 parameters in a Mathematica notebook]]<br />
** [[Media:UR5-parameters.m|UR5 parameters in MATLAB]]<br />
** [[Media:UR5-parameters-py.txt|UR5 parameters in Python]]<br />
* The UR5 URDF file from Chapter 4 of the book ([[Media:UR5-URDF.pdf|.pdf format]] or [[Media:UR5-URDF.txt|.txt format]]). For learning purposes only, not actual use; it contains only kinematic and inertial properties, and does not fully account for the effects of gearing. This file is based on the [https://github.com/ros-industrial/universal_robot/blob/indigo-devel/ur_description/urdf/ur5.urdf.xacro UR5 URDF from the ROS-Industrial team].<br />
* [http://petercorke.com/Robotics_Toolbox.html Peter Corke's excellent Robotics Toolbox for MATLAB] and other robotics software linked to from his site.<br />
* [https://github.com/quangounet/TOPP Open-source software for time-optimal time scaling (Chapter 9.4), courtesy of Quang-Cuong Pham].<br />
<br />
== About the Authors ==<br />
<br />
[[image:kevin-m-lynch-headshot.jpg|right]]<br />
<br />
'''Kevin M. Lynch''' is Professor and Chair of the Mechanical Engineering Department at Northwestern University. He is director of the [https://robotics.northwestern.edu Center for Robotics and Biosystems] and a member of the [http://nico.northwestern.edu Northwestern Institute on Complex Systems]. His research focuses on dynamics, motion planning, and control for robot manipulation and locomotion; self-organizing multi-agent systems; and physically interacting human-robot systems.<br />
<br />
He is Editor-in-Chief of the ''IEEE Transactions on Robotics'', former Editor-in-Chief of the IEEE International Conference on Robotics and Automation Conference Editorial Board, and a former Editor of the IEEE Transactions on Robotics, the IEEE Robotics and Automation Letters, and the IEEE Transactions on Automation Science and Engineering. He is a co-author of [https://www.amazon.com/Principles-Robot-Motion-Implementations-Intelligent/dp/0262033275 ''The Principles of Robot Motion''] (MIT Press, 2005) and [http://nu32.org ''Embedded Computing and Mechatronics with the PIC32 Microcontroller''] (Elsevier, 2015), an IEEE fellow, and the recipient of the IEEE Early Career Award in Robotics and Automation, Northwestern's Professorship of Teaching Excellence, and the Northwestern Teacher of the Year award in engineering. He earned a BSE in Electrical Engineering from Princeton University and a PhD in Robotics from Carnegie Mellon University.<br />
<br />
<br clear=all><br />
<br />
[[image:frank-park-headshot.jpg|right]]<br />
<br />
'''Frank C. Park''' received his BS in electrical engineering from MIT and his PhD in applied mathematics from Harvard University. From 1991 to 1995 he was assistant professor of mechanical and aerospace engineering at the University of California, Irvine. Since 1995 he has been professor of mechanical and aerospace engineering at Seoul National University, where he is currently chair of the department. His research interests are in robot mechanics, planning and control, vision and image processing, and related areas of applied mathematics. He has been an IEEE Robotics and Automation Society Distinguished Lecturer, and received best paper awards for his work on visual tracking and parallel robot design. He has served on the editorial boards of the Springer Handbook of Robotics, Springer Advanced Tracts in Robotics (STAR), Robotica, and the ASME Journal of Mechanisms and Robotics. He has held adjunct faculty positions at the HKUST Robotics Institute, NYU Courant Institute, and the Interactive Computing Department at Georgia Tech. In 2014 he received the Seoul National University Teaching Excellence Award. He is a fellow of the IEEE, former Editor-in-Chief of the ''IEEE Transactions on Robotics'', and developer of the edX courses Robot Mechanics and Control I, II.<br />
<br clear=all><br />
<br />
<!--<br />
=== Why LynchAndPark.org? ===<br />
<br />
[[File:ModernRoboticsFlyer.jpg|right|thumb|x300px|Advertising flyer for the book.]]<br />
You may have gotten here from the URL http://lynchandpark.org. If you're like us, you forget the name of the textbook, but remember the names of the authors. We thought it would be easiest to remember this URL. If you ever have any problems with http://lynchandpark.org, you can try http://www.lynchandpark.org , http://modernrobotics.org, or http://www.modernrobotics.org.<br />
--><br />
<br clear=all><br />
<br />
== Mechatronics ==<br />
<br />
[[Image:NU32_Book_Cover.jpg|x200px |right | link=NU32]]<br />
<br />
<!--<br />
[[File:NU32_Book_Cover.jpg|x200px|thumb|right|''Embedded Computing and Mechatronics,'' Lynch Marchuk, and Elwin, Elsevier 2015.]]<br />
--><br />
''Modern Robotics'' is written at the system level: you learn about the kinematics, dynamics, motion planning, and control of an entire robot system. If you would like to learn more about the details of implementation, e.g., joint-level feedback control, driving motors (including brushed, brushless, steppers, and servos), gearing, sensors, signal processing, etc., check out [[NU32|''Embedded Computing and Mechatronics'']] by Lynch, Marchuk, and Elwin, Elsevier 2015.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-10T13:17:21Z<p>Lynch: /* Chapter 10 */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force <math>F_{ij}(q)</math>, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-10T13:14:35Z<p>Lynch: /* Chapter 10 */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): As it is written, this equation (which involves a partial derivative with respect to the robot's configuration <math>q</math>) already gives the repulsive generalized force, i.e., the Jacobian is already embedded, obviating the subsequent development. To fit the rest of the development, the partial derivative in this equation should be with respect to <math>f_i(q)</math>. So the equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial f_i(q)} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-10T12:59:30Z<p>Lynch: /* A partial list of errata contributors */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): The term <math>(\partial f_i/\partial q)^{\text{T}}</math> should not be included in the equation. The equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial q} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki, Jay Li</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-10T12:58:17Z<p>Lynch: /* Updated first edition: Significant corrections (Errata for original first edition here) */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* Second displayed equation of Chapter 10.6.3 (Workspace Potential): The term <math>(\partial f_i/\partial q)^{\text{T}}</math> should not be included in the equation. The equation should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial q} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-10T12:56:02Z<p>Lynch: /* Updated first edition: Significant corrections (Errata for original first edition here) */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs.<br />
<br />
=== Chapter 10 ===<br />
<br />
* The second displayed equation of Chapter 10.6.3 (Workspace Potential) should read<br />
<math><br />
F^\prime_{ij}(q) = -\frac{\partial P^\prime_{ij}}{\partial q} = \frac{k}{\|f_i(q) - c_j\|^4} (f_i(q) - c_j) \in \mathbb{R}^3.<br />
</math><br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-06T13:29:48Z<p>Lynch: </p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs. <br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-06T13:29:09Z<p>Lynch: </p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ([[Modern Robotics Errata, First Edition Version 1|Errata for original first edition here]]) ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs. <br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-06T11:51:22Z<p>Lynch: </p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Updated first edition: Significant corrections ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs. <br />
<br />
== Updated first edition: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-04-02T11:24:26Z<p>Lynch: /* Book: Minor typos, etc., no danger of misunderstanding */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Book: Significant corrections ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs. <br />
<br />
== Book: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
=== Chapter 11 ===<br />
<br />
* (online version only) Chapter 11.3.3: The sentence containing Equation (11.18) is missing a period at the end.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-03-17T12:10:29Z<p>Lynch: /* Throughout the book */</p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Book: Significant corrections ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs. <br />
<br />
== Book: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [https://www.coppeliarobotics.com/ CoppeliaSim] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_Robotics_ErrataModern Robotics Errata2020-03-17T12:10:10Z<p>Lynch: </p>
<hr />
<div>The errata below are for the [[Modern_Robotics|'''updated first edition of ''Modern Robotics'' ''']] (as well as the practice exercises and linear algebra refresher appendix). The updated first edition (also called "version 2") was originally published by Cambridge University Press in late 2019 (marked "3rd printing 2019" or later) and the corresponding online preprint is dated December 2019. The updated first edition includes several corrections and minor additions to the original first edition, which was originally published by Cambridge in May 2017, with a corresponding online preprint dated May 2017. <br />
<br />
'''[[Modern Robotics Errata, First Edition Version 1|The errata for the original first edition can be found here]].'''<br />
<br />
[https://docs.google.com/forms/d/1iZ_3LsWR1iuPJmRsUQsa2ehZj6p-qKQfx8NRKaTlIuE/edit '''Please click here to report any corrections for the updated first edition of the book, the practice exercises, or the linear algebra refresher appendix.''']<br />
<br />
== Book: Significant corrections ==<br />
<br />
=== Chapter 3 ===<br />
<br />
* (printed version only) At the end of the introduction Exercise 3.16, it says "origin of {b} is at (0,2,0) is {s}" but "is {s}" should be "in {s}".<br />
* Exercise 3.20, Figure 3.26: In the figure, the y and z axes for the {a}, {b}, and {c} frames are switched (y should point forward and z should point up). Also, the space frame is located at the bottom of the small wheel, directly below the {a} frame.<br />
* (printed version only) Exercise 3.25(a): the element in the third row and third column of the matrix <math>A</math> should be 0 (it is incorrectly written as 1).'''<br />
<br />
=== Chapter 8 ===<br />
<br />
* (printed version only) Equation (8.74): the first two plus signs should be minus signs. <br />
<br />
== Book: Minor typos, etc., no danger of misunderstanding ==<br />
<br />
=== Throughout the book ===<br />
<br />
* The V-REP simulator has been discontinued and replaced by the [CoppeliaSim https://www.coppeliarobotics.com/] simulator. This does not change anything in the book (or the simulation scenes provided to accompany the book).<br />
<br />
=== Chapter 6 ===<br />
<br />
* (printed version only) Chapter 6.2.2, Example 6.1: just before the matrix <math>T_{sd}</math>, "corresponds to to" should be "corresponds to." '''<br />
* (printed version only) Chapter 6.3, first sentence after Equation (6.7): "however small" should be written "however, small" to avoid ambiguity.<br />
<br />
== A partial list of errata contributors ==<br />
<br />
Thanks to the following people who provided corrections, starting from the preliminary version of the book posted in October, 2016:<br />
<br />
H. Andy Nam, Eric Lee, Yuchen Rao, Chainatee Tanakulrongson, Mengjiao Hong, Kevin Cheng, Jens Lundell, Elton Cheng, Michael Young, Jarvis Schultz, Logan Springgate, Sofya Akhmametyeva, Aykut Onol, Josh Holcomb, Yue Chen, Mark Shi, AJ Ibraheem, Yalun Wen, Seongjae Jeong, Josh Mehling, Felix Wang, Drew Warren, Chris Miller, Clemens Eppner, Zack Woodruff, Jian Shi, Jixiang Zhang, Shachar Liberman, Will Wu, Dirk Boysen, Awe Wang, Ville Kyrki, John Troll, Andrew Taylor, Nikhil Bakshi, Yunzhe Pan, Barrett Ames, Marcel Bonnici, Mahdiar Edraki</div>Lynchhttp://hades.mech.northwestern.edu/index.php/ME_449_Robotic_ManipulationME 449 Robotic Manipulation2020-02-13T17:09:51Z<p>Lynch: </p>
<hr />
<div>'''Fall Quarter 2019'''<br />
<br />
* Instructor: Prof. Kevin Lynch<br />
* Meeting: 2:00-2:50, MWF, Tech LR2 (changed from L251)<br />
* Graders: Taosha Fan, Tito Fernandez, Roman Grigorii, Mahdieh Nejati Javaremi<br />
* Office hours: Lynch: Mon, 4-5, Tech B222; TAs: Tues, 3-4:30, Tech B252 (Willens Wing)<br />
* Course website: [http://hades.mech.northwestern.edu/index.php/ME_449_Robotic_Manipulation http://hades.mech.northwestern.edu/index.php/ME_449_Robotic_Manipulation]<br />
* Book website: [http://modernrobotics.org http://modernrobotics.org]<br />
* '''[https://docs.google.com/forms/d/e/1FAIpQLSej7E9AaYomOEi5ToiNVum-_H7XdaJZ95Va__AIBPnB0xXZyg/viewform?usp=sf_link Click here to enter any questions you have on the lectures or reading that you would like to discuss in class.]'''<br />
<br />
==Course Summary==<br />
<br />
Representations of the configuration and spatial motion of rigid bodies and robots based on modern screw theory. Forward, inverse, and differential kinematics. Robot dynamics, trajectory planning, and motion control. Wheeled mobile robots and mobile manipulation.<br />
<br />
==Prerequisites==<br />
<br />
Linear algebra, first-order linear ODEs, freshman-level physics/mechanics, a bit of programming background.<br />
<br />
==Grading==<br />
* 50% quizzes (quizzes will be open book, open notes, any cheat sheets you would like, but no electronics)<br />
* 20% assignments (lowest grade will be dropped)<br />
* 15% final project (due Wed Dec 11, during finals week)<br />
* 10% practice exercise for other students<br />
* 5% engagement: introducing yourself during office hours, answering questions in class, participation in in-class exercises, helping other students in class, participation in Coursera forums<br />
<br />
Your lowest assignment grade will be dropped. This policy is meant to handle '''ALL''' eventualities and emergencies: travel, job interview, overloaded that week, computer crashed, could not submit on time (even by 30 seconds!), problem with submitting to Canvas, dog ate it, slept in, forgot, busy watching the big game, big party the night before, etc. Please don't ask for an extension or an exception; you've already been granted one! (But only one.)<br />
<br />
==Course Text and Software==<br />
<br />
This course uses the textbook ''Modern Robotics: Mechanics, Planning, and Control'', Kevin M. Lynch and Frank C. Park, Cambridge University Press 2017.<br />
<br />
[[Coursera_Resources#Things_you_should_complete_before_taking_any_course|Get the book, install and test the Modern Robotics code library, and install and test the CoppeliaSim robot simulator.]] You will program in Python, Mathematica, or MATLAB in this course.<br />
<br />
'''[[Modern Robotics Linear Algebra Review|Here is a linear algebra refresher appendix to accompany the book.]]'''<br />
<br />
==Approximate Syllabus and Reading==<br />
<br />
* Chapter 2, Configuration Space (weeks 1-2)<br />
* Chapter 3, Rigid-Body Motions (weeks 2-3)<br />
* Chapter 4, Forward Kinematics (week 4); section 4.2 is optional<br />
* Chapter 5, Velocity Kinematics and Statics (week 5)<br />
* Chapter 6, Inverse Kinematics (week 6); focus on section 6.2<br />
* Chapter 8, Dynamics of Open Chains (weeks 6-7); skip sections 8.4, 8.8, and 8.9<br />
* Chapter 9, Trajectory Generation (week 8); focus on sections 9.1 and 9.4<br />
* Chapter 11, Robot Control (week 9); focus on sections 11.1 through 11.4<br />
* Chapter 13, Wheeled Mobile Robots (week 10); skip section 13.3<br />
<br />
==Video Lectures and the Flipped Classroom==<br />
<br />
This course will take advantage of video lectures and lecture comprehension quizzes on Coursera. (You can also see the video lectures, but not the lecture comprehension quizzes, outside Coursera at the video browser [http://modernrobotics.northwestern.edu '''http://modernrobotics.northwestern.edu'''] or using [[Modern_Robotics_Videos|'''direct links to the videos on YouTube''']].)<br />
<br />
You should sign up to audit the following courses on Coursera in advance of our study of them in class. Don't pay; you should start by choosing the 7-day free trial, but then click "audit the course." Auditing the course gives you access to everything except graded assignments and peer-reviewed projects.<br />
<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together useful supplemental material to the Coursera courses]]'''.<br />
<br />
The general flow of the class will be the following: <br />
<br />
* Before class, watch the videos, do the lecture comprehension quizzes associated with each video, do the associated reading, and participate in any "discussion prompts" on Coursera. You should plan to bring any questions or confusion to class. In general, I recommend that you first watch the videos to get a quick understanding of the material of the chapter, then follow up by reading the appropriate sections of the book. The videos are short and dense, so don't expect to get by only watching the videos. You will need to read the book, then do the exercises, to gain mastery of the material. <br />
<br />
'''[https://docs.google.com/forms/d/e/1FAIpQLSej7E9AaYomOEi5ToiNVum-_H7XdaJZ95Va__AIBPnB0xXZyg/viewform?usp=sf_link Click here to enter any questions you have on the lectures or reading that you would like to discuss in class.]'''<br />
* In class, I will briefly review the lecture comprehension quizzes and the material that was covered, get a little discussion going and take any questions, perhaps work a problem myself, and then ask you to work on a practice exercise either individually or in small groups. If time remains, you may work on homework together. I will be available to help.<br />
* On days when a homework is turned in, I will leave time for any questions about it. On days before a quiz, I will spend as much time reviewing the material covered by the quiz as you would like.<br />
<br />
==Practice Exercises==<br />
[[Modern_Robotics#Useful_Supplemental_Documents|Sample exercises and their solutions, useful for studying for tests or practicing your understanding of the material.]]<br />
<br />
== Practice Quizzes ==<br />
<br />
* [[Media:ME449-quiz1-2018.pdf|Quiz 1, 2018]]<br />
* Quiz 2, 2018: Exercises 4.2, 5.3, 6.1, 8.6, and 8.7 from [[Modern_Robotics#Useful_Supplemental_Documents|the practice exercises document]].<br />
<br />
==Student-Created Exercises==<br />
<br />
<!-- [https://docs.google.com/spreadsheets/d/1cIX4_U8lkWAL6LqQBgDrE5WX1TAmJaD6-ykG7GNACkI/edit?usp=sharing '''Click here for student exercise assignments.'''] --><br />
<br />
'''Bring two printed copies to class Monday Nov 18, for feedback. Turn in the final version online on Wednesday Nov 20 at 1:30 PM, as two files: FamilyName_GivenName.pdf, with the pdf of the exercise and its solution, and FamilyName_GivenName.zip, with all the source files for your exercise taken from Overleaf. Also bring a printout to class on Wed Nov 20. If it is more than one page, staple it.'''<br />
<br />
All students will be responsible for creating a practice exercise, consisting of the exercise and the solution. A good exercise should test an important concept in the context of a real robotics application (e.g., motion planning for a quadrotor, robot localization, computer vision, grasping, etc.), require the learner to understand and apply equations in the book or use the book's software, and require a bit of thought (i.e., not just "plug and chug" questions). For many exercises, a good figure or two is helpful. You could use a figure of a real robot and add your own annotations to it (e.g., frames or objects in its environment), or you could hand-draw something, or you could use CoppeliaSim or other software to help create the figure. You should not confine your question to an application discussed in the textbook. Make your exercise interesting and motivating! Exercises that require synthesizing two or more concepts or equations are more interesting and useful. Think about what kind of exercise would have helped you to really understand the material. Your questions should be very clearly worded, so anyone can understand it without you having to be there to interpret it for them.<br />
<br />
You should look at the practice exercise document and end-of-chapter exercises for inspiration, but obviously your exercises should not be copies.<br />
<br />
You will create your exercise using [https://en.wikipedia.org/wiki/LaTeX LaTeX] (pronounced "lay teck" or "lah teck"), the standard for scientific document preparation. [https://www.overleaf.com/ Overleaf] is a free online implementation of LaTeX. To get started on your exercise,<br />
<br />
# Download [[Media:ME449-exercise.zip|'''this .zip file''']] and uncompress it. There are five files: main.tex, prelims.tex, twist-wrench.pdf, table-lamp.PNG, and LampSolution.PNG.<br />
# Create an account on [https://www.overleaf.com/ Overleaf].<br />
# Create a new (blank) project on Overleaf called "exercise."<br />
# Upload the five files to this project. (You may get a warning that your default main.tex file is being overwritten; don't worry about it.)<br />
# Click on main.tex to see your main LaTeX document.<br />
# Press the "Recompile" button to see the pdf document that is compiled from the five files. You can download the pdf file, or all the "source" files, by clicking on "Menu" and choosing which to download. '''[[Media:ME449-exercise-output.pdf|This is the .pdf file you should have created.]]'''<br />
<br />
main.tex is the main file of the project, and the only one that you will edit, so you should understand what is going on in that file. prelims.tex tells LaTeX what packages to use and defines some macros, e.g., \twist creates <math>\mathcal{V}</math> and \wrench creates <math>\mathcal{F}</math>. The other three files are image files that get included in the document. You will create different image files depending on your exercise. For example, you can make a nice hand drawing and then scan it.<br />
<br />
To learn more about typesetting in LaTeX, google is your friend! Try googling "latex math" or "latex math symbols," for example.<br />
<br />
You will turn in the source for your exercise as a zip file, as well as the final pdf file.<br />
<br />
The final student assignments to topics is given below:<br />
<br />
[[File:StudentExercises2019.jpg|x400px]]<br />
<br />
==Assignments==<br />
<br />
Assignments are graded based on correctness, how well you organize your homework (it should be easy to understand your thinking and easy to find your responses), and how well you follow the submission instructions below. You will lose points if you don't follow these instructions.<br />
<br />
'''You will not receive credit if you just give an answer. Your solution must demonstrate how you got the answer. It must be easy to follow.'''<br />
<br />
If you ever think a problem is stated incorrectly, not enough information is given, or it is impossible to solve, don't panic! Simply make a reasonable assumption that will allow you to solve the problem (but clearly state what this assumption is), or indicate why it is not possible to solve the problem.<br />
<br />
'''Instructions for uploading assignments to Canvas:'''<br />
<br />
# '''Upload on time! Late submissions are not accepted under any circumstances. See the policy on dropping the lowest assignment grade under "Grading" above.''' The cutoff time is 30 minutes before class the day the assignment is due.<br />
# For every assignment, you should upload exactly one pdf file, named FamilyName_GivenName.pdf. This pdf file should have answers to all the questions, including screen shots, text logs of code running, etc. Always include output of your code running on the exercises, so the grader can see what you got when you ran your code. You may scan handwritten solutions (provided they are neat!), but in any case, all answers should be in a single pdf file. DO NOT UPLOAD SCANS AS JPGS! THEY MUST ALL BE COMPILED INTO A SINGLE PDF FILE.<br />
# If required by the assignment (e.g., if you wrote code), in addition to the pdf file above, you should provide a zip file including all source code in their original forms, such as .m, .py, or .nb. This zip file should be named FamilyName_GivenName.zip. Always create a script (for example, titled exercise6-9) that the grader can easily invoke to run your code for a particular exercise. Don't expect the grader to search through your code to find sample code to cut-and-paste. Make it as easy as possible for the grader (you can include a "README.txt" file in your zip file, for example, to tell the grader how everything works).<br />
<br />
* '''Assignment 1, due 30 minutes before class on Canvas, Wed Oct 9.''' Exercises 2.1, 2.4, 2.5, 2.9(c) (mechanism (c) from Fig 2.18), 2.20, 2.31, 3.1, and 3.5.<br />
* '''Assignment 2, due 30 minutes before class on Canvas, Wed Oct 16.''' Exercises 3.16, 3.26, 3.31, 4.2, 4.5, and 4.6.<br />
* '''Assignment 3, due 30 minutes before class on Canvas, Wed Oct 23.''' Exercises 5.3(a,c,d,e) and 5.26.<br />
* '''Assignment 4, due 30 minutes before class on Canvas, Wed Oct 30.''' [[Media:ME449-asst4-2019.pdf|The programming assignment described here]].<br />
* '''Assignment 5, due 30 minutes before class on Canvas, Wed Nov 6.''' [[Media:ME449-asst5-2019.pdf|This assignment]] makes use of (approximate) [[Modern_Robotics#Supplemental_Information|dynamic parameters for the UR5 robot, given in MATLAB, Mathematica, and Python form]].<br />
<!--<br />
* '''Assignment 3, due 30 minutes before class on Canvas, Wed Oct 24.''' Exercises 4.2, 4.5, 4.14, 5.7, and 5.11(a).<br />
* '''Assignment 4, due 30 minutes before class on Canvas, Wed Oct 31.''' Exercises 5.2, 5.25, 6.7, 6.8, and [[Media:IKexercise.pdf|this programming project]]. You should submit a zip file containing your answers to the four exercises plus the directory structure described in the programming project.<br />
* '''Assignment 5, due 30 minutes before class on Canvas, Wed Nov 7.''' Book exercises 8.2 and 8.3, and [[Media:ME449-practice-81.pdf|practice exercise 8.1]].<br />
* '''Assignment 6, due 30 minutes before class on Canvas, Wed Nov 14.''' Book exercise 8.14 (turn in your code), book exercise 8.15 (make a video of the motion using V-REP), and practice exercise 9.1(a), trajectory planning for the WAM robot. For each trajectory in 9.1(a), plot the (x,y,z) components of the trajectory and the three exponential coordinates of rotation of the trajectory (each taken from the transformation matrices) as a function of time. Make sure your plots are labeled so we can tell which curve is which.<br />
* [http://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_Capstone '''CAPSTONE PROJECT''']. We will do milestone 2 first, then 1, 3, 4 to complete it.<br />
--><br />
<br />
==Final Project: Mobile Manipulation==<br />
<br />
The final project, described [http://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_Capstone '''on this page'''], is due on Canvas at 1:30 PM Wednesday December 11 (finals week). Reminders:<br />
# Read and follow closely the instructions on what to submit! If you are missing requested files, or if you use a different directory structure, you will lose points. Make sure your top-level README file is clear on what you've done and what you've submitted.<br />
# If your code does not work well, please describe the remaining issues in your README file. Don't gloss over them or only provide examples where the code works well if the code does not work well for other example problems. Otherwise, if the graders find problems with your software, you will not receive credit for having identified them yourself.<br />
# You can get up to 10 pts of extra credit for correctly implementing joint-limit avoidance (so the robot links and chassis do not self-intersect) and singularity avoidance (e.g., using joint limits that keep the arm in a portion of its workspace where it does not encounter any singularities). If you implement these, it is best to submit examples of your code solving the same problem two ways---not using joint-limit avoidance and using it---so the usefulness of the joint-limit avoidance is apparent.<br />
# Make sure to keep your problem inputs separate from the code. The exact same code should solve all your problem instances; you shouldn't have different copies of your code for different problem inputs. You could have an input file for each of your examples (e.g., bestScript, overshootScript, newTaskScript) which defines the inputs (e.g., block configurations, controller gains, initial robot configuration) and invokes your code. Then a grader just needs to invoke those scripts to verify your results. (If you implemented joint-limit avoidance, this could just be one of your inputs, e.g., a variable called "avoidJointLimits" which is 0 if you don't care about avoiding joint limits and 1 if you do.)<br />
# Make sure your videos are good quality. They shouldn't be too fast (at least 5 seconds long) or low resolution. The motion should be smooth.<br />
# If your code is written in python, indicate which version of python should be used.<br />
# If you submit your code as part of the MR library, make it easy for the grader to find your code (e.g., collect it all in one place and indicate in the code or your README where to find it).<br />
<br />
==Quizzes==<br />
* [[Media:ME449-quiz1-solutions-2019.pdf|Quiz 1 Solutions]] (average score 22.4/27)<br />
* [[Media:ME449-quiz2-solutions-2019.pdf|Quiz 2 Solutions]] (average score 31.2/35)<br />
<br />
==Detailed Syllabus==<br />
[https://docs.google.com/spreadsheets/d/1UrBFai-1Z98Ry48bW50OMqxvvqZ3Jo8pHgZmljOgPpo/edit?usp=sharing '''The course calendar'''], including video lecture and reading assignments due before each class.<br />
<!--<br />
[https://docs.google.com/spreadsheets/d/1jWd_POLlQYxQLv1Igv-eVmORdtEcLi0mU_rVLkNguYI/edit?usp=sharing '''Click here for a graphical view of the class schedule, including student lectures.''']<br />
<br />
Homeworks are due at the beginning of class every Wednesday, unless otherwise noted. You will watch the videos and do the reading in advance of class using the material, as noted in the syllabus below. A typical weekly schedule will consist of: <br />
: M: Video/reading comprehension quick quiz and help with homework. <br />
: W: Video/reading comprehension quick quiz, homework solutions, plus '''EITHER''' student lecture '''OR''' quiz preparation. <br />
: F: Video/reading comprehension quick quiz plus '''EITHER''' student lecture '''OR''' quiz.<br />
<br />
'''Class 1''' (W 9/20)<br />
: Welcome to the course and course website. Structure of the course (HW due Wed, student-generated lectures and learning materials, in-class assignments, feedback on student lectures, occasional Friday quizzes). Book, software, (lack of) D-H parameters, syllabus, V-REP simulator, office hours.<br />
<br />
At home:<br />
: Videos: first 3 videos of Chapter 2, through Chapter 2.2<br />
: Reading: Chapters 2.1 and 2.2<br />
: Software: download github software with book, install V-REP and verify that you can use Scenes 1 and 2 (the UR5)<br />
: '''HW1, due 1:30 PM 9/27''': Exercises 2.3, 2.9, 2.20, 2.29. Also, create your own example system with closed loops, something not in the book, and solve for the degrees of freedom using Grubler's formula. Make it something that exists or occurs in common experience, not necessarily a robot. Imagine using it to teach someone about Grubler's formula.<br />
<br />
'''Class 2''' (F 9/22)<br />
: Quick quiz<br />
: Sample student lecture<br />
<br />
At home:<br />
: Videos: 2 videos on Chapter 2.3<br />
: Reading: Chapter 2.3<br />
<br />
'''Class 3''' (M 9/25)<br />
: Quick quiz<br />
: Bring your laptop, demo V-REP UR5 scenes<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: 2 videos, Chapter 2.4 and 2.5<br />
: Reading: Chapters 2.4 and 2.5<br />
: Turn in HW1<br />
<br />
'''Class 4''' (W 9/27)<br />
: Quick quiz<br />
: Solutions to HW1; student examples of Grubler's formula<br />
<br />
At home:<br />
: Videos: first 3 videos of Chapter 3, through Chapter 3.2.1<br />
: Reading: through Chapter 3.2.1<br />
: '''HW2, due 1:30 PM 10/4''':<br />
:: 1) Exercise 3.1, except the y_a axis points in the direction (1,0,0).<br />
:: 2) Exercise 3.2, except p = (1,2,3).<br />
:: 3) Exercise 3.5.<br />
:: 4) Exercise 3.9. <br />
:: 5) In Figure 1.1(a) of the book is an image of a UR5 robot, with a frame at its base and a frame at its end-effector. Eyeballing the end-effector frame, approximately write the rotation matrix that represents the end-effector frame orientation relative to the base frame. Your rotation matrix should satisfy the properties of a rotation matrix (R^T R = I, det(R) = 1). The x-axes are in red, the y-axes are in green, and the z-axes are in blue.<br />
:: 6) Write a program that takes a set of exponential coordinates for rotation from the user as input. It then prints out the following: (a) the corresponding unit rotation axis and the angle of rotation about that axis; (b) the so(3) 3x3 matrix representation of the exponential coordinates; (c) the 3x3 SO(3) rotation matrix corresponding to the exponential coordinates; (d) the inverse of the rotation matrix from (c); (e) the 3x3 so(3) matrix log of the matrix from (d); and (f) the corresponding exponential coordinates for the so(3) matrix (e). Use the code from the book and write your program in Mathematica, MATLAB, or Python. Turn in your code and the output of an example run using (0.5, 1, 0) as the input to part (a).<br />
:: 7) Write a function that returns "true" if a given 3x3 matrix is with a distance epsilon of being a rotation matrix and "false" otherwise. It is up to you to define the "distance" between a random 3x3 real matrix and members of SO(3). Test the function on two matrices, neither of which is exactly in SO(3), but one of which is close (so the result is "true") and one of which is not. Turn in your code and provide the test run output, which also outputs the distance to SO(3) that you defined.<br />
:: 8) Following up on the previous exercise: describe (don't implement, unless you want to) a function that takes a "close by" 3x3 matrix and returns the closest rotation matrix. How would you use the fact that R^T R - I must be equal to zero to modify the initial 3x3 matrix to make it a "close by" rotation matrix? Would the function be iterative? You are free to do some research online, but as always, '''cite your sources'''!<br />
<br />
'''Class 5''' (F 9/29)<br />
: Quick quiz<br />
: Lecture<br />
<br />
At home:<br />
: Videos: videos 4-6 of Chapter 3, through Chapter 3.2.3<br />
: Reading: through Chapter 3.2.3<br />
<br />
'''Class 6''' (M 10/2)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 7-9 of Chapter 3, Chapters 3.3.1 and 3.3.2<br />
: Reading: same sections<br />
<br />
'''Class 7''' (W 10/4)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: videos 10-11, Chapter 3.3.3 and 3.4<br />
: Reading: same sections<br />
: '''HW3, due 1:30 PM 10/11''': Exercises 3.16, 3.17, 3.27, 3.31, and 3.48 (as always, for programming assignments, turn in your code and sample output demonstrating it).<br />
<br />
'''Class 8''' (F 10/6)<br />
: EXAM 1<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 4, through Chapter 4.1.2<br />
: Reading: same sections<br />
<br />
'''Class 9''' (M 10/9)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 2-3 of Chapter 4, Chapter 4.1.3<br />
: Reading: same sections<br />
<br />
'''Class 10''' (W 10/11)<br />
: Quick quiz<br />
: Student lecture 1 (Pawar, Subramanian, Goyal, Cai)<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 5, up to (not including) Chapter 5.1<br />
: Reading: same sections<br />
: '''HW4, due 1:30 PM 10/18''': Exercises 4.2, 4.8, 4.14, and 5.7(a). Question 5: In Chapter 3.5 (Summary), there is a list of analogies between rotations and rigid-body motions. Read it carefully and report anything that is either unclear or incorrect.<br />
<br />
'''Class 11''' (F 10/13)<br />
: Quick quiz<br />
: Student lecture 2 (Wang, Wu, Xia, Zheng)<br />
<br />
At home:<br />
: Videos: video 2 of Chapter 5, Chapter 5.1.1<br />
: Reading: same sections<br />
<br />
'''Class 12''' (M 10/16)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 3 and 4 of Chapter 5, Chapter 5.1.2 through 5.2<br />
: Reading: same sections<br />
<br />
'''Class 13''' (W 10/18)<br />
: Quick quiz<br />
: Student lecture 3 (Wiznitzers, Hutson, Spies)<br />
<br />
At home:<br />
: Videos: videos 5 and 6 of Chapter 5, Chapter 5.3 and 5.4<br />
: Reading: same sections<br />
: '''HW5, due 1:30 PM 10/25''': Exercises 5.2, 5.3, 5.23, 5.25, 6.7, and 6.8.<br />
<br />
'''Class 14''' (F 10/20)<br />
: Quick quiz<br />
: Student lecture 4 (Don, Chien, Husain, Sulaiman)<br />
<br />
At home:<br />
: Videos: videos 1 and 2 of Chapter 6,<br />
: Reading: intro of Chapter 6 and Chapter 6.2<br />
<br />
'''Class 15''' (M 10/23)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 3 of Chapter 6<br />
: Reading: Chapter 6.2<br />
<br />
'''Class 16''' (W 10/25)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 8, through 8.1.1<br />
: Reading: same sections<br />
: [[Media:ME449-HW6-2017.pdf|HW6, due 1:30 PM 11/1]]<br />
<br />
'''Class 17 ''' (F 10/27)<br />
: EXAM 2<br />
<br />
At home:<br />
: Videos: video 2 of Chapter 8, through 8.1.2<br />
: Reading: same sections<br />
<br />
'''Class 18''' (M 10/30)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 3 of Chapter 8, through 8.1.3<br />
: Reading: same sections<br />
<br />
'''Class 19''' (W 11/1)<br />
: Quick quiz<br />
: Student lecture 5 (Zhang, Zhu, Meng, Luo)<br />
<br />
At home:<br />
: Videos: videos 4-5 of Chapter 8, through 8.2<br />
: Reading: same sections<br />
: '''HW7, due 1:30 PM 11/8''': Exercises 8.2, 8.3, 8.11 (you should build on the MR code), and 8.15(a).<br />
<br />
'''Class 20''' (F 11/3)<br />
: Quick quiz<br />
: Student lecture 6 (Lyu, Yi, Wang, Swissler)<br />
<br />
At home:<br />
: Videos: video 6 of Chapter 8, up to (not including) 8.4<br />
: Reading: same sections<br />
<br />
'''Class 21''' (M 11/6)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 7 of Chapter 8, Chapter 8.5 (skip 8.4)<br />
: Reading: same sections<br />
<br />
'''Class 22''' (W 11/8)<br />
: Quick quiz<br />
: Student lecture 7 (Warren, Kilaru, Wang, Mandana)<br />
<br />
At home:<br />
: Videos: videos 1-2 of Chapter 9, through Chapter 9.2<br />
: Reading: same sections<br />
: '''HW8, due 1:30 PM 11/15''': Exercises 8.15(b) (use your previous results from 8.15(a), and turn in any code you write as well as a V-REP movie of your simulation), 8.14 (turn in your testable code and evidence your code returns similar results), 9.14, and 9.26.<br />
<br />
'''Class 23''' (F 11/10)<br />
: Quick quiz<br />
: Student lecture 8 (Wang, Dai, Ma, Peng)<br />
<br />
At home:<br />
: Videos: video 4 of Chapter 9, Chapter 9.4 - 9.4.1 (skip 9.3)<br />
: Reading: same sections<br />
<br />
'''Class 24''' (M 11/13)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 5-6 of Chapter 9, up to (not including) Chapter 9.5<br />
: Reading: same sections<br />
<br />
'''Class 25''' (W 11/15)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: videos 1-3 of Chapter 11, up to (not including) Chapter 11.2.2.1<br />
: Reading: same sections<br />
: '''Final project. This project is part of the assignment grade, cannot be dropped, and has the weight of 2 normal assignments.''' The assignment is split into two parts: a relatively simple Part I, due after 1 week, followed by the programming-heavy Part II, due during finals week. You will receive a single grade for the entire assignment, after Part II has been submitted.<br />
:: '''Part I, due 1:30 PM 11/22''': Exercise 13.33 (a) and (b). Turn in your solutions (handwritten or typed) and any code you wrote.<br />
:: '''Part II, due 11:59 PM 12/6''': Exercise 13.33 (c), (d), and (e). Turn in 1) any solutions (handwritten or typed), 2) your code, 3) any plots you created with your code, 4) your short V-REP videos (made using the youbot csv animation scene), and 5) the .csv files corresponding to the videos.<br />
<br />
'''Class 26''' (F 11/17)<br />
: EXAM 3<br />
<br />
At home:<br />
: Videos: videos 4-5 of Chapter 11, Chapter 11.2.2.1 and 11.2.2.2<br />
: Reading: same sections<br />
<br />
'''Class 27''' (M 11/20)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 6-8 of Chapter 11, Chapter 11.3<br />
: Reading: same sections<br />
: '''Turn in Part I of your final project on Canvas.'''<br />
<br />
'''Class 28''' (W 11/22)<br />
: Quick quiz<br />
: Student lecture 9 (Abiney, Aubrun, Anthony, Alston)<br />
<br />
At home:<br />
: Videos: videos 1-3 of Chapter 13, through Chapter 13.2<br />
: Reading: same sections<br />
<br />
'''Class 29''' (M 11/27)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Reading: odometry and mobile manipulation, Chapter 13.4 and 13.5<br />
<br />
'''Class 30''' (W 11/29)<br />
: Quick quiz<br />
: Student lecture 10 (Miller, Berrueta, Davis, Tobia)<br />
<br />
At home:<br />
: Final assignment work<br />
<br />
'''Class 31''' (F 12/1)<br />
: Student lecture 11 (Fernandez, Lutzen, SaLoutos, Iwankiw)<br />
<br />
At home:<br />
: '''Your final project is due on Canvas by 11:59 PM on Wednesday Dec 6.'''<br />
<br />
--><br />
<br />
<!--<br />
==Archive==<br />
<br />
* [[ME 449 Robotic Manipulation (Archive 2012)|ME 449 Spring 2012]]<br />
* [[ME 449 Robotic Manipulation (Archive Spring 2014)|ME 449 Spring 2014]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2014)|ME 449 Fall 2014]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2015)|ME 449 Fall 2015]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2016)|ME 449 Fall 2016]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2017)|ME 449 Fall 2017]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2018)|ME 449 Fall 2018]]<br />
--></div>Lynchhttp://hades.mech.northwestern.edu/index.php/ME_449_Robotic_ManipulationME 449 Robotic Manipulation2020-02-13T17:05:53Z<p>Lynch: /* Course Summary */</p>
<hr />
<div>'''Fall Quarter 2019'''<br />
<br />
* Instructor: Prof. Kevin Lynch<br />
* Meeting: 2:00-2:50, MWF, Tech LR2 (changed from L251)<br />
* Graders: Taosha Fan, Tito Fernandez, Roman Grigorii, Mahdieh Nejati Javaremi<br />
* Office hours: Lynch: Mon, 4-5, Tech B222; TAs: Tues, 3-4:30, Tech B252 (Willens Wing)<br />
* Course website: [http://hades.mech.northwestern.edu/index.php/ME_449_Robotic_Manipulation http://hades.mech.northwestern.edu/index.php/ME_449_Robotic_Manipulation]<br />
* Book website: [http://modernrobotics.org http://modernrobotics.org]<br />
* '''[https://docs.google.com/forms/d/e/1FAIpQLSej7E9AaYomOEi5ToiNVum-_H7XdaJZ95Va__AIBPnB0xXZyg/viewform?usp=sf_link Click here to enter any questions you have on the lectures or reading that you would like to discuss in class.]'''<br />
<br />
==Course Summary==<br />
<br />
Representations of the configuration and spatial motion of rigid bodies and robots based on modern screw theory. Forward, inverse, and differential kinematics. Robot dynamics, trajectory planning, and motion control. Wheeled mobile robots and mobile manipulation.<br />
<br />
==Prerequisites==<br />
<br />
Linear algebra, first-order linear ODEs, freshman-level physics/mechanics, a bit of programming background.<br />
<br />
==Grading==<br />
* 50% quizzes (quizzes will be open book, open notes, any cheat sheets you would like, but no electronics)<br />
* 20% assignments (lowest grade will be dropped)<br />
* 15% final project (due Wed Dec 11, during finals week)<br />
* 10% practice exercise for other students<br />
* 5% engagement: introducing yourself during office hours, answering questions in class, participation in in-class exercises, helping other students in class, participation in Coursera forums<br />
<br />
Your lowest assignment grade will be dropped. This policy is meant to handle '''ALL''' eventualities and emergencies: travel, job interview, overloaded that week, computer crashed, could not submit on time (even by 30 seconds!), problem with submitting to Canvas, dog ate it, slept in, forgot, busy watching the big game, big party the night before, etc. Please don't ask for an extension or an exception; you've already been granted one! (But only one.)<br />
<br />
==Course Text and Software==<br />
<br />
This course uses the textbook ''Modern Robotics: Mechanics, Planning, and Control'', Kevin M. Lynch and Frank C. Park, Cambridge University Press 2017.<br />
<br />
[[Coursera_Resources#Things_you_should_complete_before_taking_any_course|Get the book, install and test the Modern Robotics code library, and install and test the V-REP simulator.]] You will program in Python, Mathematica, or MATLAB in this course.<br />
<br />
'''[[Modern Robotics Linear Algebra Review|Here is a linear algebra refresher appendix to accompany the book.]]'''<br />
<br />
==Approximate Syllabus and Reading==<br />
<br />
* Chapter 2, Configuration Space (weeks 1-2)<br />
* Chapter 3, Rigid-Body Motions (weeks 2-3)<br />
* Chapter 4, Forward Kinematics (week 4); section 4.2 is optional<br />
* Chapter 5, Velocity Kinematics and Statics (week 5)<br />
* Chapter 6, Inverse Kinematics (week 6); focus on section 6.2<br />
* Chapter 8, Dynamics of Open Chains (weeks 6-7); skip sections 8.4, 8.8, and 8.9<br />
* Chapter 9, Trajectory Generation (week 8); focus on sections 9.1 and 9.4<br />
* Chapter 11, Robot Control (week 9); focus on sections 11.1 through 11.4<br />
* Chapter 13, Wheeled Mobile Robots (week 10); skip section 13.3<br />
<br />
==Video Lectures and the Flipped Classroom==<br />
<br />
This course will take advantage of video lectures and lecture comprehension quizzes on Coursera. (You can also see the video lectures, but not the lecture comprehension quizzes, outside Coursera at the video browser [http://modernrobotics.northwestern.edu '''http://modernrobotics.northwestern.edu'''] or using [[Modern_Robotics_Videos|'''direct links to the videos on YouTube''']].)<br />
<br />
You should sign up to audit the following courses on Coursera in advance of our study of them in class. Don't pay; you should start by choosing the 7-day free trial, but then click "audit the course." Auditing the course gives you access to everything except graded assignments and peer-reviewed projects.<br />
<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together useful supplemental material to the Coursera courses]]'''.<br />
<br />
The general flow of the class will be the following: <br />
<br />
* Before class, watch the videos, do the lecture comprehension quizzes associated with each video, do the associated reading, and participate in any "discussion prompts" on Coursera. You should plan to bring any questions or confusion to class. In general, I recommend that you first watch the videos to get a quick understanding of the material of the chapter, then follow up by reading the appropriate sections of the book. The videos are short and dense, so don't expect to get by only watching the videos. You will need to read the book, then do the exercises, to gain mastery of the material. <br />
<br />
'''[https://docs.google.com/forms/d/e/1FAIpQLSej7E9AaYomOEi5ToiNVum-_H7XdaJZ95Va__AIBPnB0xXZyg/viewform?usp=sf_link Click here to enter any questions you have on the lectures or reading that you would like to discuss in class.]'''<br />
* In class, I will briefly review the lecture comprehension quizzes and the material that was covered, get a little discussion going and take any questions, perhaps work a problem myself, and then ask you to work on a practice exercise either individually or in small groups. If time remains, you may work on homework together. I will be available to help.<br />
* On days when a homework is turned in, I will leave time for any questions about it. On days before a quiz, I will spend as much time reviewing the material covered by the quiz as you would like.<br />
<br />
==Practice Exercises==<br />
[[Modern_Robotics#Useful_Supplemental_Documents|Sample exercises and their solutions, useful for studying for tests or practicing your understanding of the material.]]<br />
<br />
== Practice Quizzes ==<br />
<br />
* [[Media:ME449-quiz1-2018.pdf|Quiz 1, 2018]]<br />
* Quiz 2, 2018: Exercises 4.2, 5.3, 6.1, 8.6, and 8.7 from [[Modern_Robotics#Useful_Supplemental_Documents|the practice exercises document]].<br />
<br />
==Student-Created Exercises==<br />
<br />
<!-- [https://docs.google.com/spreadsheets/d/1cIX4_U8lkWAL6LqQBgDrE5WX1TAmJaD6-ykG7GNACkI/edit?usp=sharing '''Click here for student exercise assignments.'''] --><br />
<br />
'''Bring two printed copies to class Monday Nov 18, for feedback. Turn in the final version online on Wednesday Nov 20 at 1:30 PM, as two files: FamilyName_GivenName.pdf, with the pdf of the exercise and its solution, and FamilyName_GivenName.zip, with all the source files for your exercise taken from Overleaf. Also bring a printout to class on Wed Nov 20. If it is more than one page, staple it.'''<br />
<br />
All students will be responsible for creating a practice exercise, consisting of the exercise and the solution. A good exercise should test an important concept in the context of a real robotics application (e.g., motion planning for a quadrotor, robot localization, computer vision, grasping, etc.), require the learner to understand and apply equations in the book or use the book's software, and require a bit of thought (i.e., not just "plug and chug" questions). For many exercises, a good figure or two is helpful. You could use a figure of a real robot and add your own annotations to it (e.g., frames or objects in its environment), or you could hand-draw something, or you could use V-REP or other software to help create the figure. You should not confine your question to an application discussed in the textbook. Make your exercise interesting and motivating! Exercises that require synthesizing two or more concepts or equations are more interesting and useful. Think about what kind of exercise would have helped you to really understand the material. Your questions should be very clearly worded, so anyone can understand it without you having to be there to interpret it for them.<br />
<br />
You should look at the practice exercise document and end-of-chapter exercises for inspiration, but obviously your exercises should not be copies.<br />
<br />
You will create your exercise using [https://en.wikipedia.org/wiki/LaTeX LaTeX] (pronounced "lay teck" or "lah teck"), the standard for scientific document preparation. [https://www.overleaf.com/ Overleaf] is a free online implementation of LaTeX. To get started on your exercise,<br />
<br />
# Download [[Media:ME449-exercise.zip|'''this .zip file''']] and uncompress it. There are five files: main.tex, prelims.tex, twist-wrench.pdf, table-lamp.PNG, and LampSolution.PNG.<br />
# Create an account on [https://www.overleaf.com/ Overleaf].<br />
# Create a new (blank) project on Overleaf called "exercise."<br />
# Upload the five files to this project. (You may get a warning that your default main.tex file is being overwritten; don't worry about it.)<br />
# Click on main.tex to see your main LaTeX document.<br />
# Press the "Recompile" button to see the pdf document that is compiled from the five files. You can download the pdf file, or all the "source" files, by clicking on "Menu" and choosing which to download. '''[[Media:ME449-exercise-output.pdf|This is the .pdf file you should have created.]]'''<br />
<br />
main.tex is the main file of the project, and the only one that you will edit, so you should understand what is going on in that file. prelims.tex tells LaTeX what packages to use and defines some macros, e.g., \twist creates <math>\mathcal{V}</math> and \wrench creates <math>\mathcal{F}</math>. The other three files are image files that get included in the document. You will create different image files depending on your exercise. For example, you can make a nice hand drawing and then scan it.<br />
<br />
To learn more about typesetting in LaTeX, google is your friend! Try googling "latex math" or "latex math symbols," for example.<br />
<br />
You will turn in the source for your exercise as a zip file, as well as the final pdf file.<br />
<br />
The final student assignments to topics is given below:<br />
<br />
[[File:StudentExercises2019.jpg|x400px]]<br />
<br />
==Assignments==<br />
<br />
Assignments are graded based on correctness, how well you organize your homework (it should be easy to understand your thinking and easy to find your responses), and how well you follow the submission instructions below. You will lose points if you don't follow these instructions.<br />
<br />
'''You will not receive credit if you just give an answer. Your solution must demonstrate how you got the answer. It must be easy to follow.'''<br />
<br />
If you ever think a problem is stated incorrectly, not enough information is given, or it is impossible to solve, don't panic! Simply make a reasonable assumption that will allow you to solve the problem (but clearly state what this assumption is), or indicate why it is not possible to solve the problem.<br />
<br />
'''Instructions for uploading assignments to Canvas:'''<br />
<br />
# '''Upload on time! Late submissions are not accepted under any circumstances. See the policy on dropping the lowest assignment grade under "Grading" above.''' The cutoff time is 30 minutes before class the day the assignment is due.<br />
# For every assignment, you should upload exactly one pdf file, named FamilyName_GivenName.pdf. This pdf file should have answers to all the questions, including screen shots, text logs of code running, etc. Always include output of your code running on the exercises, so the grader can see what you got when you ran your code. You may scan handwritten solutions (provided they are neat!), but in any case, all answers should be in a single pdf file. DO NOT UPLOAD SCANS AS JPGS! THEY MUST ALL BE COMPILED INTO A SINGLE PDF FILE.<br />
# If required by the assignment (e.g., if you wrote code), in addition to the pdf file above, you should provide a zip file including all source code in their original forms, such as .m, .py, or .nb. This zip file should be named FamilyName_GivenName.zip. Always create a script (for example, titled exercise6-9) that the grader can easily invoke to run your code for a particular exercise. Don't expect the grader to search through your code to find sample code to cut-and-paste. Make it as easy as possible for the grader (you can include a "README.txt" file in your zip file, for example, to tell the grader how everything works).<br />
<br />
* '''Assignment 1, due 30 minutes before class on Canvas, Wed Oct 9.''' Exercises 2.1, 2.4, 2.5, 2.9(c) (mechanism (c) from Fig 2.18), 2.20, 2.31, 3.1, and 3.5.<br />
* '''Assignment 2, due 30 minutes before class on Canvas, Wed Oct 16.''' Exercises 3.16, 3.26, 3.31, 4.2, 4.5, and 4.6.<br />
* '''Assignment 3, due 30 minutes before class on Canvas, Wed Oct 23.''' Exercises 5.3(a,c,d,e) and 5.26.<br />
* '''Assignment 4, due 30 minutes before class on Canvas, Wed Oct 30.''' [[Media:ME449-asst4-2019.pdf|The programming assignment described here]].<br />
* '''Assignment 5, due 30 minutes before class on Canvas, Wed Nov 6.''' [[Media:ME449-asst5-2019.pdf|This assignment]] makes use of (approximate) [[Modern_Robotics#Supplemental_Information|dynamic parameters for the UR5 robot, given in MATLAB, Mathematica, and Python form]].<br />
<!--<br />
* '''Assignment 3, due 30 minutes before class on Canvas, Wed Oct 24.''' Exercises 4.2, 4.5, 4.14, 5.7, and 5.11(a).<br />
* '''Assignment 4, due 30 minutes before class on Canvas, Wed Oct 31.''' Exercises 5.2, 5.25, 6.7, 6.8, and [[Media:IKexercise.pdf|this programming project]]. You should submit a zip file containing your answers to the four exercises plus the directory structure described in the programming project.<br />
* '''Assignment 5, due 30 minutes before class on Canvas, Wed Nov 7.''' Book exercises 8.2 and 8.3, and [[Media:ME449-practice-81.pdf|practice exercise 8.1]].<br />
* '''Assignment 6, due 30 minutes before class on Canvas, Wed Nov 14.''' Book exercise 8.14 (turn in your code), book exercise 8.15 (make a video of the motion using V-REP), and practice exercise 9.1(a), trajectory planning for the WAM robot. For each trajectory in 9.1(a), plot the (x,y,z) components of the trajectory and the three exponential coordinates of rotation of the trajectory (each taken from the transformation matrices) as a function of time. Make sure your plots are labeled so we can tell which curve is which.<br />
* [http://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_Capstone '''CAPSTONE PROJECT''']. We will do milestone 2 first, then 1, 3, 4 to complete it.<br />
--><br />
<br />
==Final Project: Mobile Manipulation==<br />
<br />
The final project, described [http://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_Capstone '''on this page'''], is due on Canvas at 1:30 PM Wednesday December 11 (finals week). Reminders:<br />
# Read and follow closely the instructions on what to submit! If you are missing requested files, or if you use a different directory structure, you will lose points. Make sure your top-level README file is clear on what you've done and what you've submitted.<br />
# If your code does not work well, please describe the remaining issues in your README file. Don't gloss over them or only provide examples where the code works well if the code does not work well for other example problems. Otherwise, if the graders find problems with your software, you will not receive credit for having identified them yourself.<br />
# You can get up to 10 pts of extra credit for correctly implementing joint-limit avoidance (so the robot links and chassis do not self-intersect) and singularity avoidance (e.g., using joint limits that keep the arm in a portion of its workspace where it does not encounter any singularities). If you implement these, it is best to submit examples of your code solving the same problem two ways---not using joint-limit avoidance and using it---so the usefulness of the joint-limit avoidance is apparent.<br />
# Make sure to keep your problem inputs separate from the code. The exact same code should solve all your problem instances; you shouldn't have different copies of your code for different problem inputs. You could have an input file for each of your examples (e.g., bestScript, overshootScript, newTaskScript) which defines the inputs (e.g., block configurations, controller gains, initial robot configuration) and invokes your code. Then a grader just needs to invoke those scripts to verify your results. (If you implemented joint-limit avoidance, this could just be one of your inputs, e.g., a variable called "avoidJointLimits" which is 0 if you don't care about avoiding joint limits and 1 if you do.)<br />
# Make sure your videos are good quality. They shouldn't be too fast (at least 5 seconds long) or low resolution. The motion should be smooth.<br />
# If your code is written in python, indicate which version of python should be used.<br />
# If you submit your code as part of the MR library, make it easy for the grader to find your code (e.g., collect it all in one place and indicate in the code or your README where to find it).<br />
<br />
==Quizzes==<br />
* [[Media:ME449-quiz1-solutions-2019.pdf|Quiz 1 Solutions]] (average score 22.4/27)<br />
* [[Media:ME449-quiz2-solutions-2019.pdf|Quiz 2 Solutions]] (average score 31.2/35)<br />
<br />
==Detailed Syllabus==<br />
[https://docs.google.com/spreadsheets/d/1UrBFai-1Z98Ry48bW50OMqxvvqZ3Jo8pHgZmljOgPpo/edit?usp=sharing '''The course calendar'''], including video lecture and reading assignments due before each class.<br />
<!--<br />
[https://docs.google.com/spreadsheets/d/1jWd_POLlQYxQLv1Igv-eVmORdtEcLi0mU_rVLkNguYI/edit?usp=sharing '''Click here for a graphical view of the class schedule, including student lectures.''']<br />
<br />
Homeworks are due at the beginning of class every Wednesday, unless otherwise noted. You will watch the videos and do the reading in advance of class using the material, as noted in the syllabus below. A typical weekly schedule will consist of: <br />
: M: Video/reading comprehension quick quiz and help with homework. <br />
: W: Video/reading comprehension quick quiz, homework solutions, plus '''EITHER''' student lecture '''OR''' quiz preparation. <br />
: F: Video/reading comprehension quick quiz plus '''EITHER''' student lecture '''OR''' quiz.<br />
<br />
'''Class 1''' (W 9/20)<br />
: Welcome to the course and course website. Structure of the course (HW due Wed, student-generated lectures and learning materials, in-class assignments, feedback on student lectures, occasional Friday quizzes). Book, software, (lack of) D-H parameters, syllabus, V-REP simulator, office hours.<br />
<br />
At home:<br />
: Videos: first 3 videos of Chapter 2, through Chapter 2.2<br />
: Reading: Chapters 2.1 and 2.2<br />
: Software: download github software with book, install V-REP and verify that you can use Scenes 1 and 2 (the UR5)<br />
: '''HW1, due 1:30 PM 9/27''': Exercises 2.3, 2.9, 2.20, 2.29. Also, create your own example system with closed loops, something not in the book, and solve for the degrees of freedom using Grubler's formula. Make it something that exists or occurs in common experience, not necessarily a robot. Imagine using it to teach someone about Grubler's formula.<br />
<br />
'''Class 2''' (F 9/22)<br />
: Quick quiz<br />
: Sample student lecture<br />
<br />
At home:<br />
: Videos: 2 videos on Chapter 2.3<br />
: Reading: Chapter 2.3<br />
<br />
'''Class 3''' (M 9/25)<br />
: Quick quiz<br />
: Bring your laptop, demo V-REP UR5 scenes<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: 2 videos, Chapter 2.4 and 2.5<br />
: Reading: Chapters 2.4 and 2.5<br />
: Turn in HW1<br />
<br />
'''Class 4''' (W 9/27)<br />
: Quick quiz<br />
: Solutions to HW1; student examples of Grubler's formula<br />
<br />
At home:<br />
: Videos: first 3 videos of Chapter 3, through Chapter 3.2.1<br />
: Reading: through Chapter 3.2.1<br />
: '''HW2, due 1:30 PM 10/4''':<br />
:: 1) Exercise 3.1, except the y_a axis points in the direction (1,0,0).<br />
:: 2) Exercise 3.2, except p = (1,2,3).<br />
:: 3) Exercise 3.5.<br />
:: 4) Exercise 3.9. <br />
:: 5) In Figure 1.1(a) of the book is an image of a UR5 robot, with a frame at its base and a frame at its end-effector. Eyeballing the end-effector frame, approximately write the rotation matrix that represents the end-effector frame orientation relative to the base frame. Your rotation matrix should satisfy the properties of a rotation matrix (R^T R = I, det(R) = 1). The x-axes are in red, the y-axes are in green, and the z-axes are in blue.<br />
:: 6) Write a program that takes a set of exponential coordinates for rotation from the user as input. It then prints out the following: (a) the corresponding unit rotation axis and the angle of rotation about that axis; (b) the so(3) 3x3 matrix representation of the exponential coordinates; (c) the 3x3 SO(3) rotation matrix corresponding to the exponential coordinates; (d) the inverse of the rotation matrix from (c); (e) the 3x3 so(3) matrix log of the matrix from (d); and (f) the corresponding exponential coordinates for the so(3) matrix (e). Use the code from the book and write your program in Mathematica, MATLAB, or Python. Turn in your code and the output of an example run using (0.5, 1, 0) as the input to part (a).<br />
:: 7) Write a function that returns "true" if a given 3x3 matrix is with a distance epsilon of being a rotation matrix and "false" otherwise. It is up to you to define the "distance" between a random 3x3 real matrix and members of SO(3). Test the function on two matrices, neither of which is exactly in SO(3), but one of which is close (so the result is "true") and one of which is not. Turn in your code and provide the test run output, which also outputs the distance to SO(3) that you defined.<br />
:: 8) Following up on the previous exercise: describe (don't implement, unless you want to) a function that takes a "close by" 3x3 matrix and returns the closest rotation matrix. How would you use the fact that R^T R - I must be equal to zero to modify the initial 3x3 matrix to make it a "close by" rotation matrix? Would the function be iterative? You are free to do some research online, but as always, '''cite your sources'''!<br />
<br />
'''Class 5''' (F 9/29)<br />
: Quick quiz<br />
: Lecture<br />
<br />
At home:<br />
: Videos: videos 4-6 of Chapter 3, through Chapter 3.2.3<br />
: Reading: through Chapter 3.2.3<br />
<br />
'''Class 6''' (M 10/2)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 7-9 of Chapter 3, Chapters 3.3.1 and 3.3.2<br />
: Reading: same sections<br />
<br />
'''Class 7''' (W 10/4)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: videos 10-11, Chapter 3.3.3 and 3.4<br />
: Reading: same sections<br />
: '''HW3, due 1:30 PM 10/11''': Exercises 3.16, 3.17, 3.27, 3.31, and 3.48 (as always, for programming assignments, turn in your code and sample output demonstrating it).<br />
<br />
'''Class 8''' (F 10/6)<br />
: EXAM 1<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 4, through Chapter 4.1.2<br />
: Reading: same sections<br />
<br />
'''Class 9''' (M 10/9)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 2-3 of Chapter 4, Chapter 4.1.3<br />
: Reading: same sections<br />
<br />
'''Class 10''' (W 10/11)<br />
: Quick quiz<br />
: Student lecture 1 (Pawar, Subramanian, Goyal, Cai)<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 5, up to (not including) Chapter 5.1<br />
: Reading: same sections<br />
: '''HW4, due 1:30 PM 10/18''': Exercises 4.2, 4.8, 4.14, and 5.7(a). Question 5: In Chapter 3.5 (Summary), there is a list of analogies between rotations and rigid-body motions. Read it carefully and report anything that is either unclear or incorrect.<br />
<br />
'''Class 11''' (F 10/13)<br />
: Quick quiz<br />
: Student lecture 2 (Wang, Wu, Xia, Zheng)<br />
<br />
At home:<br />
: Videos: video 2 of Chapter 5, Chapter 5.1.1<br />
: Reading: same sections<br />
<br />
'''Class 12''' (M 10/16)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 3 and 4 of Chapter 5, Chapter 5.1.2 through 5.2<br />
: Reading: same sections<br />
<br />
'''Class 13''' (W 10/18)<br />
: Quick quiz<br />
: Student lecture 3 (Wiznitzers, Hutson, Spies)<br />
<br />
At home:<br />
: Videos: videos 5 and 6 of Chapter 5, Chapter 5.3 and 5.4<br />
: Reading: same sections<br />
: '''HW5, due 1:30 PM 10/25''': Exercises 5.2, 5.3, 5.23, 5.25, 6.7, and 6.8.<br />
<br />
'''Class 14''' (F 10/20)<br />
: Quick quiz<br />
: Student lecture 4 (Don, Chien, Husain, Sulaiman)<br />
<br />
At home:<br />
: Videos: videos 1 and 2 of Chapter 6,<br />
: Reading: intro of Chapter 6 and Chapter 6.2<br />
<br />
'''Class 15''' (M 10/23)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 3 of Chapter 6<br />
: Reading: Chapter 6.2<br />
<br />
'''Class 16''' (W 10/25)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 8, through 8.1.1<br />
: Reading: same sections<br />
: [[Media:ME449-HW6-2017.pdf|HW6, due 1:30 PM 11/1]]<br />
<br />
'''Class 17 ''' (F 10/27)<br />
: EXAM 2<br />
<br />
At home:<br />
: Videos: video 2 of Chapter 8, through 8.1.2<br />
: Reading: same sections<br />
<br />
'''Class 18''' (M 10/30)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 3 of Chapter 8, through 8.1.3<br />
: Reading: same sections<br />
<br />
'''Class 19''' (W 11/1)<br />
: Quick quiz<br />
: Student lecture 5 (Zhang, Zhu, Meng, Luo)<br />
<br />
At home:<br />
: Videos: videos 4-5 of Chapter 8, through 8.2<br />
: Reading: same sections<br />
: '''HW7, due 1:30 PM 11/8''': Exercises 8.2, 8.3, 8.11 (you should build on the MR code), and 8.15(a).<br />
<br />
'''Class 20''' (F 11/3)<br />
: Quick quiz<br />
: Student lecture 6 (Lyu, Yi, Wang, Swissler)<br />
<br />
At home:<br />
: Videos: video 6 of Chapter 8, up to (not including) 8.4<br />
: Reading: same sections<br />
<br />
'''Class 21''' (M 11/6)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 7 of Chapter 8, Chapter 8.5 (skip 8.4)<br />
: Reading: same sections<br />
<br />
'''Class 22''' (W 11/8)<br />
: Quick quiz<br />
: Student lecture 7 (Warren, Kilaru, Wang, Mandana)<br />
<br />
At home:<br />
: Videos: videos 1-2 of Chapter 9, through Chapter 9.2<br />
: Reading: same sections<br />
: '''HW8, due 1:30 PM 11/15''': Exercises 8.15(b) (use your previous results from 8.15(a), and turn in any code you write as well as a V-REP movie of your simulation), 8.14 (turn in your testable code and evidence your code returns similar results), 9.14, and 9.26.<br />
<br />
'''Class 23''' (F 11/10)<br />
: Quick quiz<br />
: Student lecture 8 (Wang, Dai, Ma, Peng)<br />
<br />
At home:<br />
: Videos: video 4 of Chapter 9, Chapter 9.4 - 9.4.1 (skip 9.3)<br />
: Reading: same sections<br />
<br />
'''Class 24''' (M 11/13)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 5-6 of Chapter 9, up to (not including) Chapter 9.5<br />
: Reading: same sections<br />
<br />
'''Class 25''' (W 11/15)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: videos 1-3 of Chapter 11, up to (not including) Chapter 11.2.2.1<br />
: Reading: same sections<br />
: '''Final project. This project is part of the assignment grade, cannot be dropped, and has the weight of 2 normal assignments.''' The assignment is split into two parts: a relatively simple Part I, due after 1 week, followed by the programming-heavy Part II, due during finals week. You will receive a single grade for the entire assignment, after Part II has been submitted.<br />
:: '''Part I, due 1:30 PM 11/22''': Exercise 13.33 (a) and (b). Turn in your solutions (handwritten or typed) and any code you wrote.<br />
:: '''Part II, due 11:59 PM 12/6''': Exercise 13.33 (c), (d), and (e). Turn in 1) any solutions (handwritten or typed), 2) your code, 3) any plots you created with your code, 4) your short V-REP videos (made using the youbot csv animation scene), and 5) the .csv files corresponding to the videos.<br />
<br />
'''Class 26''' (F 11/17)<br />
: EXAM 3<br />
<br />
At home:<br />
: Videos: videos 4-5 of Chapter 11, Chapter 11.2.2.1 and 11.2.2.2<br />
: Reading: same sections<br />
<br />
'''Class 27''' (M 11/20)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 6-8 of Chapter 11, Chapter 11.3<br />
: Reading: same sections<br />
: '''Turn in Part I of your final project on Canvas.'''<br />
<br />
'''Class 28''' (W 11/22)<br />
: Quick quiz<br />
: Student lecture 9 (Abiney, Aubrun, Anthony, Alston)<br />
<br />
At home:<br />
: Videos: videos 1-3 of Chapter 13, through Chapter 13.2<br />
: Reading: same sections<br />
<br />
'''Class 29''' (M 11/27)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Reading: odometry and mobile manipulation, Chapter 13.4 and 13.5<br />
<br />
'''Class 30''' (W 11/29)<br />
: Quick quiz<br />
: Student lecture 10 (Miller, Berrueta, Davis, Tobia)<br />
<br />
At home:<br />
: Final assignment work<br />
<br />
'''Class 31''' (F 12/1)<br />
: Student lecture 11 (Fernandez, Lutzen, SaLoutos, Iwankiw)<br />
<br />
At home:<br />
: '''Your final project is due on Canvas by 11:59 PM on Wednesday Dec 6.'''<br />
<br />
--><br />
<br />
<!--<br />
==Archive==<br />
<br />
* [[ME 449 Robotic Manipulation (Archive 2012)|ME 449 Spring 2012]]<br />
* [[ME 449 Robotic Manipulation (Archive Spring 2014)|ME 449 Spring 2014]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2014)|ME 449 Fall 2014]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2015)|ME 449 Fall 2015]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2016)|ME 449 Fall 2016]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2017)|ME 449 Fall 2017]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2018)|ME 449 Fall 2018]]<br />
--></div>Lynchhttp://hades.mech.northwestern.edu/index.php/ME_449_Robotic_ManipulationME 449 Robotic Manipulation2020-02-13T17:04:41Z<p>Lynch: </p>
<hr />
<div>'''Fall Quarter 2019'''<br />
<br />
* Instructor: Prof. Kevin Lynch<br />
* Meeting: 2:00-2:50, MWF, Tech LR2 (changed from L251)<br />
* Graders: Taosha Fan, Tito Fernandez, Roman Grigorii, Mahdieh Nejati Javaremi<br />
* Office hours: Lynch: Mon, 4-5, Tech B222; TAs: Tues, 3-4:30, Tech B252 (Willens Wing)<br />
* Course website: [http://hades.mech.northwestern.edu/index.php/ME_449_Robotic_Manipulation http://hades.mech.northwestern.edu/index.php/ME_449_Robotic_Manipulation]<br />
* Book website: [http://modernrobotics.org http://modernrobotics.org]<br />
* '''[https://docs.google.com/forms/d/e/1FAIpQLSej7E9AaYomOEi5ToiNVum-_H7XdaJZ95Va__AIBPnB0xXZyg/viewform?usp=sf_link Click here to enter any questions you have on the lectures or reading that you would like to discuss in class.]'''<br />
<br />
==Course Summary==<br />
<br />
Mechanics of robotic manipulation, computer representations and algorithms for manipulation planning, and applications to industrial automation, parts feeding, grasping, fixturing, and assembly.<br />
<br />
==Prerequisites==<br />
<br />
Linear algebra, first-order linear ODEs, freshman-level physics/mechanics, a bit of programming background.<br />
<br />
==Grading==<br />
* 50% quizzes (quizzes will be open book, open notes, any cheat sheets you would like, but no electronics)<br />
* 20% assignments (lowest grade will be dropped)<br />
* 15% final project (due Wed Dec 11, during finals week)<br />
* 10% practice exercise for other students<br />
* 5% engagement: introducing yourself during office hours, answering questions in class, participation in in-class exercises, helping other students in class, participation in Coursera forums<br />
<br />
Your lowest assignment grade will be dropped. This policy is meant to handle '''ALL''' eventualities and emergencies: travel, job interview, overloaded that week, computer crashed, could not submit on time (even by 30 seconds!), problem with submitting to Canvas, dog ate it, slept in, forgot, busy watching the big game, big party the night before, etc. Please don't ask for an extension or an exception; you've already been granted one! (But only one.)<br />
<br />
==Course Text and Software==<br />
<br />
This course uses the textbook ''Modern Robotics: Mechanics, Planning, and Control'', Kevin M. Lynch and Frank C. Park, Cambridge University Press 2017.<br />
<br />
[[Coursera_Resources#Things_you_should_complete_before_taking_any_course|Get the book, install and test the Modern Robotics code library, and install and test the V-REP simulator.]] You will program in Python, Mathematica, or MATLAB in this course.<br />
<br />
'''[[Modern Robotics Linear Algebra Review|Here is a linear algebra refresher appendix to accompany the book.]]'''<br />
<br />
==Approximate Syllabus and Reading==<br />
<br />
* Chapter 2, Configuration Space (weeks 1-2)<br />
* Chapter 3, Rigid-Body Motions (weeks 2-3)<br />
* Chapter 4, Forward Kinematics (week 4); section 4.2 is optional<br />
* Chapter 5, Velocity Kinematics and Statics (week 5)<br />
* Chapter 6, Inverse Kinematics (week 6); focus on section 6.2<br />
* Chapter 8, Dynamics of Open Chains (weeks 6-7); skip sections 8.4, 8.8, and 8.9<br />
* Chapter 9, Trajectory Generation (week 8); focus on sections 9.1 and 9.4<br />
* Chapter 11, Robot Control (week 9); focus on sections 11.1 through 11.4<br />
* Chapter 13, Wheeled Mobile Robots (week 10); skip section 13.3<br />
<br />
==Video Lectures and the Flipped Classroom==<br />
<br />
This course will take advantage of video lectures and lecture comprehension quizzes on Coursera. (You can also see the video lectures, but not the lecture comprehension quizzes, outside Coursera at the video browser [http://modernrobotics.northwestern.edu '''http://modernrobotics.northwestern.edu'''] or using [[Modern_Robotics_Videos|'''direct links to the videos on YouTube''']].)<br />
<br />
You should sign up to audit the following courses on Coursera in advance of our study of them in class. Don't pay; you should start by choosing the 7-day free trial, but then click "audit the course." Auditing the course gives you access to everything except graded assignments and peer-reviewed projects.<br />
<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together useful supplemental material to the Coursera courses]]'''.<br />
<br />
The general flow of the class will be the following: <br />
<br />
* Before class, watch the videos, do the lecture comprehension quizzes associated with each video, do the associated reading, and participate in any "discussion prompts" on Coursera. You should plan to bring any questions or confusion to class. In general, I recommend that you first watch the videos to get a quick understanding of the material of the chapter, then follow up by reading the appropriate sections of the book. The videos are short and dense, so don't expect to get by only watching the videos. You will need to read the book, then do the exercises, to gain mastery of the material. <br />
<br />
'''[https://docs.google.com/forms/d/e/1FAIpQLSej7E9AaYomOEi5ToiNVum-_H7XdaJZ95Va__AIBPnB0xXZyg/viewform?usp=sf_link Click here to enter any questions you have on the lectures or reading that you would like to discuss in class.]'''<br />
* In class, I will briefly review the lecture comprehension quizzes and the material that was covered, get a little discussion going and take any questions, perhaps work a problem myself, and then ask you to work on a practice exercise either individually or in small groups. If time remains, you may work on homework together. I will be available to help.<br />
* On days when a homework is turned in, I will leave time for any questions about it. On days before a quiz, I will spend as much time reviewing the material covered by the quiz as you would like.<br />
<br />
==Practice Exercises==<br />
[[Modern_Robotics#Useful_Supplemental_Documents|Sample exercises and their solutions, useful for studying for tests or practicing your understanding of the material.]]<br />
<br />
== Practice Quizzes ==<br />
<br />
* [[Media:ME449-quiz1-2018.pdf|Quiz 1, 2018]]<br />
* Quiz 2, 2018: Exercises 4.2, 5.3, 6.1, 8.6, and 8.7 from [[Modern_Robotics#Useful_Supplemental_Documents|the practice exercises document]].<br />
<br />
==Student-Created Exercises==<br />
<br />
<!-- [https://docs.google.com/spreadsheets/d/1cIX4_U8lkWAL6LqQBgDrE5WX1TAmJaD6-ykG7GNACkI/edit?usp=sharing '''Click here for student exercise assignments.'''] --><br />
<br />
'''Bring two printed copies to class Monday Nov 18, for feedback. Turn in the final version online on Wednesday Nov 20 at 1:30 PM, as two files: FamilyName_GivenName.pdf, with the pdf of the exercise and its solution, and FamilyName_GivenName.zip, with all the source files for your exercise taken from Overleaf. Also bring a printout to class on Wed Nov 20. If it is more than one page, staple it.'''<br />
<br />
All students will be responsible for creating a practice exercise, consisting of the exercise and the solution. A good exercise should test an important concept in the context of a real robotics application (e.g., motion planning for a quadrotor, robot localization, computer vision, grasping, etc.), require the learner to understand and apply equations in the book or use the book's software, and require a bit of thought (i.e., not just "plug and chug" questions). For many exercises, a good figure or two is helpful. You could use a figure of a real robot and add your own annotations to it (e.g., frames or objects in its environment), or you could hand-draw something, or you could use V-REP or other software to help create the figure. You should not confine your question to an application discussed in the textbook. Make your exercise interesting and motivating! Exercises that require synthesizing two or more concepts or equations are more interesting and useful. Think about what kind of exercise would have helped you to really understand the material. Your questions should be very clearly worded, so anyone can understand it without you having to be there to interpret it for them.<br />
<br />
You should look at the practice exercise document and end-of-chapter exercises for inspiration, but obviously your exercises should not be copies.<br />
<br />
You will create your exercise using [https://en.wikipedia.org/wiki/LaTeX LaTeX] (pronounced "lay teck" or "lah teck"), the standard for scientific document preparation. [https://www.overleaf.com/ Overleaf] is a free online implementation of LaTeX. To get started on your exercise,<br />
<br />
# Download [[Media:ME449-exercise.zip|'''this .zip file''']] and uncompress it. There are five files: main.tex, prelims.tex, twist-wrench.pdf, table-lamp.PNG, and LampSolution.PNG.<br />
# Create an account on [https://www.overleaf.com/ Overleaf].<br />
# Create a new (blank) project on Overleaf called "exercise."<br />
# Upload the five files to this project. (You may get a warning that your default main.tex file is being overwritten; don't worry about it.)<br />
# Click on main.tex to see your main LaTeX document.<br />
# Press the "Recompile" button to see the pdf document that is compiled from the five files. You can download the pdf file, or all the "source" files, by clicking on "Menu" and choosing which to download. '''[[Media:ME449-exercise-output.pdf|This is the .pdf file you should have created.]]'''<br />
<br />
main.tex is the main file of the project, and the only one that you will edit, so you should understand what is going on in that file. prelims.tex tells LaTeX what packages to use and defines some macros, e.g., \twist creates <math>\mathcal{V}</math> and \wrench creates <math>\mathcal{F}</math>. The other three files are image files that get included in the document. You will create different image files depending on your exercise. For example, you can make a nice hand drawing and then scan it.<br />
<br />
To learn more about typesetting in LaTeX, google is your friend! Try googling "latex math" or "latex math symbols," for example.<br />
<br />
You will turn in the source for your exercise as a zip file, as well as the final pdf file.<br />
<br />
The final student assignments to topics is given below:<br />
<br />
[[File:StudentExercises2019.jpg|x400px]]<br />
<br />
==Assignments==<br />
<br />
Assignments are graded based on correctness, how well you organize your homework (it should be easy to understand your thinking and easy to find your responses), and how well you follow the submission instructions below. You will lose points if you don't follow these instructions.<br />
<br />
'''You will not receive credit if you just give an answer. Your solution must demonstrate how you got the answer. It must be easy to follow.'''<br />
<br />
If you ever think a problem is stated incorrectly, not enough information is given, or it is impossible to solve, don't panic! Simply make a reasonable assumption that will allow you to solve the problem (but clearly state what this assumption is), or indicate why it is not possible to solve the problem.<br />
<br />
'''Instructions for uploading assignments to Canvas:'''<br />
<br />
# '''Upload on time! Late submissions are not accepted under any circumstances. See the policy on dropping the lowest assignment grade under "Grading" above.''' The cutoff time is 30 minutes before class the day the assignment is due.<br />
# For every assignment, you should upload exactly one pdf file, named FamilyName_GivenName.pdf. This pdf file should have answers to all the questions, including screen shots, text logs of code running, etc. Always include output of your code running on the exercises, so the grader can see what you got when you ran your code. You may scan handwritten solutions (provided they are neat!), but in any case, all answers should be in a single pdf file. DO NOT UPLOAD SCANS AS JPGS! THEY MUST ALL BE COMPILED INTO A SINGLE PDF FILE.<br />
# If required by the assignment (e.g., if you wrote code), in addition to the pdf file above, you should provide a zip file including all source code in their original forms, such as .m, .py, or .nb. This zip file should be named FamilyName_GivenName.zip. Always create a script (for example, titled exercise6-9) that the grader can easily invoke to run your code for a particular exercise. Don't expect the grader to search through your code to find sample code to cut-and-paste. Make it as easy as possible for the grader (you can include a "README.txt" file in your zip file, for example, to tell the grader how everything works).<br />
<br />
* '''Assignment 1, due 30 minutes before class on Canvas, Wed Oct 9.''' Exercises 2.1, 2.4, 2.5, 2.9(c) (mechanism (c) from Fig 2.18), 2.20, 2.31, 3.1, and 3.5.<br />
* '''Assignment 2, due 30 minutes before class on Canvas, Wed Oct 16.''' Exercises 3.16, 3.26, 3.31, 4.2, 4.5, and 4.6.<br />
* '''Assignment 3, due 30 minutes before class on Canvas, Wed Oct 23.''' Exercises 5.3(a,c,d,e) and 5.26.<br />
* '''Assignment 4, due 30 minutes before class on Canvas, Wed Oct 30.''' [[Media:ME449-asst4-2019.pdf|The programming assignment described here]].<br />
* '''Assignment 5, due 30 minutes before class on Canvas, Wed Nov 6.''' [[Media:ME449-asst5-2019.pdf|This assignment]] makes use of (approximate) [[Modern_Robotics#Supplemental_Information|dynamic parameters for the UR5 robot, given in MATLAB, Mathematica, and Python form]].<br />
<!--<br />
* '''Assignment 3, due 30 minutes before class on Canvas, Wed Oct 24.''' Exercises 4.2, 4.5, 4.14, 5.7, and 5.11(a).<br />
* '''Assignment 4, due 30 minutes before class on Canvas, Wed Oct 31.''' Exercises 5.2, 5.25, 6.7, 6.8, and [[Media:IKexercise.pdf|this programming project]]. You should submit a zip file containing your answers to the four exercises plus the directory structure described in the programming project.<br />
* '''Assignment 5, due 30 minutes before class on Canvas, Wed Nov 7.''' Book exercises 8.2 and 8.3, and [[Media:ME449-practice-81.pdf|practice exercise 8.1]].<br />
* '''Assignment 6, due 30 minutes before class on Canvas, Wed Nov 14.''' Book exercise 8.14 (turn in your code), book exercise 8.15 (make a video of the motion using V-REP), and practice exercise 9.1(a), trajectory planning for the WAM robot. For each trajectory in 9.1(a), plot the (x,y,z) components of the trajectory and the three exponential coordinates of rotation of the trajectory (each taken from the transformation matrices) as a function of time. Make sure your plots are labeled so we can tell which curve is which.<br />
* [http://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_Capstone '''CAPSTONE PROJECT''']. We will do milestone 2 first, then 1, 3, 4 to complete it.<br />
--><br />
<br />
==Final Project: Mobile Manipulation==<br />
<br />
The final project, described [http://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_Capstone '''on this page'''], is due on Canvas at 1:30 PM Wednesday December 11 (finals week). Reminders:<br />
# Read and follow closely the instructions on what to submit! If you are missing requested files, or if you use a different directory structure, you will lose points. Make sure your top-level README file is clear on what you've done and what you've submitted.<br />
# If your code does not work well, please describe the remaining issues in your README file. Don't gloss over them or only provide examples where the code works well if the code does not work well for other example problems. Otherwise, if the graders find problems with your software, you will not receive credit for having identified them yourself.<br />
# You can get up to 10 pts of extra credit for correctly implementing joint-limit avoidance (so the robot links and chassis do not self-intersect) and singularity avoidance (e.g., using joint limits that keep the arm in a portion of its workspace where it does not encounter any singularities). If you implement these, it is best to submit examples of your code solving the same problem two ways---not using joint-limit avoidance and using it---so the usefulness of the joint-limit avoidance is apparent.<br />
# Make sure to keep your problem inputs separate from the code. The exact same code should solve all your problem instances; you shouldn't have different copies of your code for different problem inputs. You could have an input file for each of your examples (e.g., bestScript, overshootScript, newTaskScript) which defines the inputs (e.g., block configurations, controller gains, initial robot configuration) and invokes your code. Then a grader just needs to invoke those scripts to verify your results. (If you implemented joint-limit avoidance, this could just be one of your inputs, e.g., a variable called "avoidJointLimits" which is 0 if you don't care about avoiding joint limits and 1 if you do.)<br />
# Make sure your videos are good quality. They shouldn't be too fast (at least 5 seconds long) or low resolution. The motion should be smooth.<br />
# If your code is written in python, indicate which version of python should be used.<br />
# If you submit your code as part of the MR library, make it easy for the grader to find your code (e.g., collect it all in one place and indicate in the code or your README where to find it).<br />
<br />
==Quizzes==<br />
* [[Media:ME449-quiz1-solutions-2019.pdf|Quiz 1 Solutions]] (average score 22.4/27)<br />
* [[Media:ME449-quiz2-solutions-2019.pdf|Quiz 2 Solutions]] (average score 31.2/35)<br />
<br />
==Detailed Syllabus==<br />
[https://docs.google.com/spreadsheets/d/1UrBFai-1Z98Ry48bW50OMqxvvqZ3Jo8pHgZmljOgPpo/edit?usp=sharing '''The course calendar'''], including video lecture and reading assignments due before each class.<br />
<!--<br />
[https://docs.google.com/spreadsheets/d/1jWd_POLlQYxQLv1Igv-eVmORdtEcLi0mU_rVLkNguYI/edit?usp=sharing '''Click here for a graphical view of the class schedule, including student lectures.''']<br />
<br />
Homeworks are due at the beginning of class every Wednesday, unless otherwise noted. You will watch the videos and do the reading in advance of class using the material, as noted in the syllabus below. A typical weekly schedule will consist of: <br />
: M: Video/reading comprehension quick quiz and help with homework. <br />
: W: Video/reading comprehension quick quiz, homework solutions, plus '''EITHER''' student lecture '''OR''' quiz preparation. <br />
: F: Video/reading comprehension quick quiz plus '''EITHER''' student lecture '''OR''' quiz.<br />
<br />
'''Class 1''' (W 9/20)<br />
: Welcome to the course and course website. Structure of the course (HW due Wed, student-generated lectures and learning materials, in-class assignments, feedback on student lectures, occasional Friday quizzes). Book, software, (lack of) D-H parameters, syllabus, V-REP simulator, office hours.<br />
<br />
At home:<br />
: Videos: first 3 videos of Chapter 2, through Chapter 2.2<br />
: Reading: Chapters 2.1 and 2.2<br />
: Software: download github software with book, install V-REP and verify that you can use Scenes 1 and 2 (the UR5)<br />
: '''HW1, due 1:30 PM 9/27''': Exercises 2.3, 2.9, 2.20, 2.29. Also, create your own example system with closed loops, something not in the book, and solve for the degrees of freedom using Grubler's formula. Make it something that exists or occurs in common experience, not necessarily a robot. Imagine using it to teach someone about Grubler's formula.<br />
<br />
'''Class 2''' (F 9/22)<br />
: Quick quiz<br />
: Sample student lecture<br />
<br />
At home:<br />
: Videos: 2 videos on Chapter 2.3<br />
: Reading: Chapter 2.3<br />
<br />
'''Class 3''' (M 9/25)<br />
: Quick quiz<br />
: Bring your laptop, demo V-REP UR5 scenes<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: 2 videos, Chapter 2.4 and 2.5<br />
: Reading: Chapters 2.4 and 2.5<br />
: Turn in HW1<br />
<br />
'''Class 4''' (W 9/27)<br />
: Quick quiz<br />
: Solutions to HW1; student examples of Grubler's formula<br />
<br />
At home:<br />
: Videos: first 3 videos of Chapter 3, through Chapter 3.2.1<br />
: Reading: through Chapter 3.2.1<br />
: '''HW2, due 1:30 PM 10/4''':<br />
:: 1) Exercise 3.1, except the y_a axis points in the direction (1,0,0).<br />
:: 2) Exercise 3.2, except p = (1,2,3).<br />
:: 3) Exercise 3.5.<br />
:: 4) Exercise 3.9. <br />
:: 5) In Figure 1.1(a) of the book is an image of a UR5 robot, with a frame at its base and a frame at its end-effector. Eyeballing the end-effector frame, approximately write the rotation matrix that represents the end-effector frame orientation relative to the base frame. Your rotation matrix should satisfy the properties of a rotation matrix (R^T R = I, det(R) = 1). The x-axes are in red, the y-axes are in green, and the z-axes are in blue.<br />
:: 6) Write a program that takes a set of exponential coordinates for rotation from the user as input. It then prints out the following: (a) the corresponding unit rotation axis and the angle of rotation about that axis; (b) the so(3) 3x3 matrix representation of the exponential coordinates; (c) the 3x3 SO(3) rotation matrix corresponding to the exponential coordinates; (d) the inverse of the rotation matrix from (c); (e) the 3x3 so(3) matrix log of the matrix from (d); and (f) the corresponding exponential coordinates for the so(3) matrix (e). Use the code from the book and write your program in Mathematica, MATLAB, or Python. Turn in your code and the output of an example run using (0.5, 1, 0) as the input to part (a).<br />
:: 7) Write a function that returns "true" if a given 3x3 matrix is with a distance epsilon of being a rotation matrix and "false" otherwise. It is up to you to define the "distance" between a random 3x3 real matrix and members of SO(3). Test the function on two matrices, neither of which is exactly in SO(3), but one of which is close (so the result is "true") and one of which is not. Turn in your code and provide the test run output, which also outputs the distance to SO(3) that you defined.<br />
:: 8) Following up on the previous exercise: describe (don't implement, unless you want to) a function that takes a "close by" 3x3 matrix and returns the closest rotation matrix. How would you use the fact that R^T R - I must be equal to zero to modify the initial 3x3 matrix to make it a "close by" rotation matrix? Would the function be iterative? You are free to do some research online, but as always, '''cite your sources'''!<br />
<br />
'''Class 5''' (F 9/29)<br />
: Quick quiz<br />
: Lecture<br />
<br />
At home:<br />
: Videos: videos 4-6 of Chapter 3, through Chapter 3.2.3<br />
: Reading: through Chapter 3.2.3<br />
<br />
'''Class 6''' (M 10/2)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 7-9 of Chapter 3, Chapters 3.3.1 and 3.3.2<br />
: Reading: same sections<br />
<br />
'''Class 7''' (W 10/4)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: videos 10-11, Chapter 3.3.3 and 3.4<br />
: Reading: same sections<br />
: '''HW3, due 1:30 PM 10/11''': Exercises 3.16, 3.17, 3.27, 3.31, and 3.48 (as always, for programming assignments, turn in your code and sample output demonstrating it).<br />
<br />
'''Class 8''' (F 10/6)<br />
: EXAM 1<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 4, through Chapter 4.1.2<br />
: Reading: same sections<br />
<br />
'''Class 9''' (M 10/9)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 2-3 of Chapter 4, Chapter 4.1.3<br />
: Reading: same sections<br />
<br />
'''Class 10''' (W 10/11)<br />
: Quick quiz<br />
: Student lecture 1 (Pawar, Subramanian, Goyal, Cai)<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 5, up to (not including) Chapter 5.1<br />
: Reading: same sections<br />
: '''HW4, due 1:30 PM 10/18''': Exercises 4.2, 4.8, 4.14, and 5.7(a). Question 5: In Chapter 3.5 (Summary), there is a list of analogies between rotations and rigid-body motions. Read it carefully and report anything that is either unclear or incorrect.<br />
<br />
'''Class 11''' (F 10/13)<br />
: Quick quiz<br />
: Student lecture 2 (Wang, Wu, Xia, Zheng)<br />
<br />
At home:<br />
: Videos: video 2 of Chapter 5, Chapter 5.1.1<br />
: Reading: same sections<br />
<br />
'''Class 12''' (M 10/16)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 3 and 4 of Chapter 5, Chapter 5.1.2 through 5.2<br />
: Reading: same sections<br />
<br />
'''Class 13''' (W 10/18)<br />
: Quick quiz<br />
: Student lecture 3 (Wiznitzers, Hutson, Spies)<br />
<br />
At home:<br />
: Videos: videos 5 and 6 of Chapter 5, Chapter 5.3 and 5.4<br />
: Reading: same sections<br />
: '''HW5, due 1:30 PM 10/25''': Exercises 5.2, 5.3, 5.23, 5.25, 6.7, and 6.8.<br />
<br />
'''Class 14''' (F 10/20)<br />
: Quick quiz<br />
: Student lecture 4 (Don, Chien, Husain, Sulaiman)<br />
<br />
At home:<br />
: Videos: videos 1 and 2 of Chapter 6,<br />
: Reading: intro of Chapter 6 and Chapter 6.2<br />
<br />
'''Class 15''' (M 10/23)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 3 of Chapter 6<br />
: Reading: Chapter 6.2<br />
<br />
'''Class 16''' (W 10/25)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: video 1 of Chapter 8, through 8.1.1<br />
: Reading: same sections<br />
: [[Media:ME449-HW6-2017.pdf|HW6, due 1:30 PM 11/1]]<br />
<br />
'''Class 17 ''' (F 10/27)<br />
: EXAM 2<br />
<br />
At home:<br />
: Videos: video 2 of Chapter 8, through 8.1.2<br />
: Reading: same sections<br />
<br />
'''Class 18''' (M 10/30)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 3 of Chapter 8, through 8.1.3<br />
: Reading: same sections<br />
<br />
'''Class 19''' (W 11/1)<br />
: Quick quiz<br />
: Student lecture 5 (Zhang, Zhu, Meng, Luo)<br />
<br />
At home:<br />
: Videos: videos 4-5 of Chapter 8, through 8.2<br />
: Reading: same sections<br />
: '''HW7, due 1:30 PM 11/8''': Exercises 8.2, 8.3, 8.11 (you should build on the MR code), and 8.15(a).<br />
<br />
'''Class 20''' (F 11/3)<br />
: Quick quiz<br />
: Student lecture 6 (Lyu, Yi, Wang, Swissler)<br />
<br />
At home:<br />
: Videos: video 6 of Chapter 8, up to (not including) 8.4<br />
: Reading: same sections<br />
<br />
'''Class 21''' (M 11/6)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: video 7 of Chapter 8, Chapter 8.5 (skip 8.4)<br />
: Reading: same sections<br />
<br />
'''Class 22''' (W 11/8)<br />
: Quick quiz<br />
: Student lecture 7 (Warren, Kilaru, Wang, Mandana)<br />
<br />
At home:<br />
: Videos: videos 1-2 of Chapter 9, through Chapter 9.2<br />
: Reading: same sections<br />
: '''HW8, due 1:30 PM 11/15''': Exercises 8.15(b) (use your previous results from 8.15(a), and turn in any code you write as well as a V-REP movie of your simulation), 8.14 (turn in your testable code and evidence your code returns similar results), 9.14, and 9.26.<br />
<br />
'''Class 23''' (F 11/10)<br />
: Quick quiz<br />
: Student lecture 8 (Wang, Dai, Ma, Peng)<br />
<br />
At home:<br />
: Videos: video 4 of Chapter 9, Chapter 9.4 - 9.4.1 (skip 9.3)<br />
: Reading: same sections<br />
<br />
'''Class 24''' (M 11/13)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 5-6 of Chapter 9, up to (not including) Chapter 9.5<br />
: Reading: same sections<br />
<br />
'''Class 25''' (W 11/15)<br />
: Quick quiz<br />
: Exam prep<br />
<br />
At home:<br />
: Videos: videos 1-3 of Chapter 11, up to (not including) Chapter 11.2.2.1<br />
: Reading: same sections<br />
: '''Final project. This project is part of the assignment grade, cannot be dropped, and has the weight of 2 normal assignments.''' The assignment is split into two parts: a relatively simple Part I, due after 1 week, followed by the programming-heavy Part II, due during finals week. You will receive a single grade for the entire assignment, after Part II has been submitted.<br />
:: '''Part I, due 1:30 PM 11/22''': Exercise 13.33 (a) and (b). Turn in your solutions (handwritten or typed) and any code you wrote.<br />
:: '''Part II, due 11:59 PM 12/6''': Exercise 13.33 (c), (d), and (e). Turn in 1) any solutions (handwritten or typed), 2) your code, 3) any plots you created with your code, 4) your short V-REP videos (made using the youbot csv animation scene), and 5) the .csv files corresponding to the videos.<br />
<br />
'''Class 26''' (F 11/17)<br />
: EXAM 3<br />
<br />
At home:<br />
: Videos: videos 4-5 of Chapter 11, Chapter 11.2.2.1 and 11.2.2.2<br />
: Reading: same sections<br />
<br />
'''Class 27''' (M 11/20)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Videos: videos 6-8 of Chapter 11, Chapter 11.3<br />
: Reading: same sections<br />
: '''Turn in Part I of your final project on Canvas.'''<br />
<br />
'''Class 28''' (W 11/22)<br />
: Quick quiz<br />
: Student lecture 9 (Abiney, Aubrun, Anthony, Alston)<br />
<br />
At home:<br />
: Videos: videos 1-3 of Chapter 13, through Chapter 13.2<br />
: Reading: same sections<br />
<br />
'''Class 29''' (M 11/27)<br />
: Quick quiz<br />
: Help with HW<br />
<br />
At home:<br />
: Reading: odometry and mobile manipulation, Chapter 13.4 and 13.5<br />
<br />
'''Class 30''' (W 11/29)<br />
: Quick quiz<br />
: Student lecture 10 (Miller, Berrueta, Davis, Tobia)<br />
<br />
At home:<br />
: Final assignment work<br />
<br />
'''Class 31''' (F 12/1)<br />
: Student lecture 11 (Fernandez, Lutzen, SaLoutos, Iwankiw)<br />
<br />
At home:<br />
: '''Your final project is due on Canvas by 11:59 PM on Wednesday Dec 6.'''<br />
<br />
--><br />
<br />
<!--<br />
==Archive==<br />
<br />
* [[ME 449 Robotic Manipulation (Archive 2012)|ME 449 Spring 2012]]<br />
* [[ME 449 Robotic Manipulation (Archive Spring 2014)|ME 449 Spring 2014]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2014)|ME 449 Fall 2014]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2015)|ME 449 Fall 2015]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2016)|ME 449 Fall 2016]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2017)|ME 449 Fall 2017]]<br />
* [[ME 449 Robotic Manipulation (Archive Fall 2018)|ME 449 Fall 2018]]<br />
--></div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_RoboticsModern Robotics2020-02-12T21:51:29Z<p>Lynch: </p>
<hr />
<div>[[File:ModernRoboticsCover.jpg|right|thumb|x300px|The Cambridge University Press cover.]] <br />
This is the home page of the textbook "Modern Robotics: Mechanics, Planning, and Control," Kevin M. Lynch and Frank C. Park, Cambridge University Press, 2017, ISBN 9781107156302. Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below.<br />
<br />
[[File:ModernRoboticsCMPCover.jpg|right|thumb|x300px|[https://item.jd.com/12788036.html The Chinese version from China Machine Press.]]] <br />
<br />
'''New!''' You can purchase [https://item.jd.com/12788036.html '''the Chinese translation of the book'''].<br />
<br />
'''[[Modern_Robotics#Online_Courses | Modern Robotics is available as online courses on Coursera.]]'''<br />
<br />
'''From the foreword:'''<br />
<br />
"Frank and Kevin have provided a wonderfully clear and patient explanation of their subject." '''Roger Brockett''', ''Harvard University''<br />
<br />
"''Modern Robotics'' imparts the most important insights of robotics ... with a clarity that makes it accessible to undergraduate students." '''Matthew T. Mason''', ''Carnegie Mellon University''<br />
<br />
'''From the [https://ieeexplore.ieee.org/document/8897162 IEEE Control Systems Magazine book review]:'''<br />
<br />
"It is the pedagogical strength of this book that concepts from Lie group theory (which form the building blocks of modern kinematics) are presented in a way that will appeal to undergraduate students as well as to researchers and roboticists in general. ... For some time, this approach was deemed too complicated to be taught in undergraduate robotics classes. However, this book by Lynch and Park should change the conventional wisdom on this issue. ... With its consolidated modern approach, ''Modern Robotics'' is destined to become a classic in the field." '''Andreas Mueller''', ''Johannes Kepler University, Austria''<br />
<br />
== Book, Practice Exercises, and Linear Algebra Review ==<br />
<br />
Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below. You can also purchase [https://item.jd.com/12788036.html '''the Chinese version of the book'''].<br />
<br />
The current version of the book is the updated first edition (online preprint dated December 2019, printed published version from Cambridge marked "3rd printing 2019" or later). The updated first edition (also referred to as "version 2") includes several corrections and minor additions to the original first edition (first published in May 2017).<br />
<br />
This book is the result of course notes developed over many years for the course M2794.0027 Introduction to Robotics at Seoul National University and ME 449 Robotic Manipulation at Northwestern University. The evolving course notes have been posted on the internet for years to support these classes. <br />
<br />
The for-purchase version of the book from Cambridge University Press has improved layout and typesetting, updated figures, different pagination (and fewer pages), and more careful copyediting, and it is considered the "official" version of the book. But the online preprint version of the book has the same chapters, sections, and exercises, and it is quite close in content to the Cambridge-published version. <br />
<br />
We are posting four versions of the book. All versions have exactly the same contents and pagination. They differ only in the sizes of the margins and the size of the print, as manipulated in Adobe Acrobat after latex'ing. Two of the versions have working hyperlinks for navigating the book on your computer or tablet.<br />
<br />
'''With working hyperlinks.''' (To navigate the book using the hyperlinks, click on the hyperlink. To go back where you came from, choose the button or keystroke appropriate to your pdf reader. For example, on the Mac with Acrobat or Acrobat Reader, use cmd-left arrow. With Preview on the Mac, use cmd-[. Some readers on other operating systems use alt-left arrow. You can google to see which solution works for your pdf reader.)<br />
* [[Media:MR-v2.pdf|Default 8.5x11 or A4 version]]. Printable version with 10 pt font and large margins.<br />
* [[Media:MR-tablet-v2.pdf|Tablet version]]. Margins have been eliminated so that no space is wasted when viewing the document on a computer or tablet.<br />
<br />
'''Printable versions without working hyperlinks.'''<br />
* [[Media:MR-largefont-v2.pdf|Large font 8.5x11 or A4 version]]. Printable version with 12 pt font equivalent and smaller margins than the 10 pt default version.<br />
* [[Media:MR-2up-v2.pdf|2up version]]. Printable version with 2 book pages per page, for saving paper if you have good eyes. Approximately 8.5 pt font equivalent.<br />
<br />
These files have been compressed to about 7 MB. Let us know if you have any problems reading them. Please note that some versions of the default Mac OS X pdf reader, Preview, are known to have bugs displaying certain images in pdf files. If a figure is not appearing properly, please try a better pdf viewer, like Acrobat Reader.<br />
<br />
'''Table of Contents:'''<br />
# Preview<br />
# Configuration Space<br />
# Rigid-Body Motions<br />
# Forward Kinematics<br />
# Velocity Kinematics and Statics<br />
# Inverse Kinematics<br />
# Kinematics of Closed Chains<br />
# Dynamics of Open Chains<br />
# Trajectory Generation<br />
# Motion Planning<br />
# Robot Control<br />
# Grasping and Manipulation<br />
# Wheeled Mobile Robots<br />
<br />
:Appendix A. Summary of Useful Formulas<br />
<br />
:Appendix B. Other Representations of Rotations<br />
<br />
:Appendix C. Denavit-Hartenberg Parameters<br />
<br />
:Appendix D. Optimization and Lagrange Multipliers<br />
<br />
== Useful Supplemental Documents ==<br />
<br />
* [[Media:MR_practice_exercises.pdf|Practice exercises to give you more experience with the material]]. These practice exercises come with solutions, since Cambridge makes the end-of-chapter solutions available to instructors only.<br />
* [[Modern Robotics Linear Algebra Review|A linear algebra refresher appendix to accompany the book.]]<br />
<br clear=all><br />
<br />
== Videos ==<br />
<br />
* [http://modernrobotics.northwestern.edu '''Click here'''] to watch the video lectures embedded in a convenient viewing environment. <br />
* [[Modern Robotics Videos|'''Click here''']] if you prefer to watch the videos within the YouTube environment.<br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension]. Also check out the [https://robotacademy.net.au/ Robot Academy at Queensland University of Technology].<br />
<br />
== Solution Manual ==<br />
<br />
If you are an instructor, you can obtain a copy of the exercise solutions from Cambridge University Press. Go to the "Resources" section of [http://www.cambridge.org/us/academic/subjects/computer-science/computer-graphics-image-processing-and-robotics/modern-robotics-mechanics-planning-and-control '''the Cambridge University Press webpage for the book'''].<br />
<br />
== Prerequisites ==<br />
<br />
This book was written to be accessible to engineering students after taking typical first-year engineering courses. The student should have an understanding of:<br />
* freshman-level physics, including f = ma; free-body diagrams with masses, springs, and dampers; vector forces; and vector torques (or moments) as the cross product of a distance vector and a force;<br />
* linear algebra, including matrix operations, positive definiteness of a matrix, determinants, complex numbers, eigenvalues, and eigenvectors; <br />
* some calculus, derivatives, and partial derivatives; and<br />
* basic linear ordinary differential equations.<br />
<br />
The student should also be prepared to program, but only basic programming skills are needed. Code is provided in python (freely available), MATLAB (for purchase, or you could use the freely available GNU Octave clone), and Mathematica (for purchase), so those languages are preferred.<br />
<br />
== Errata == <br />
<br />
'''[[Modern Robotics Errata|Errata for the book can be found here. Please click here to report any corrections, typos, or comments.]]'''<br />
<br />
== Software ==<br />
<br />
[https://github.com/NxRLab/ModernRobotics '''Download the book software from GitHub.''']<br />
<br />
The software accompanying the book is written in Mathematica, MATLAB, and Python. It is written to be educational and to reinforce the concepts in the book, not to be as computationally efficient or robust as possible. <br />
<br />
The origin of the software is student solutions to homework exercises. A major update was committed in January 2017, correcting some bugs in the earlier version.<br />
<br />
[https://github.com/NxRLab/ModernRobotics/issues '''To report any issues with the software, please click the "Issues" tab in GitHub.''']<br />
<br />
== Simulation ==<br />
<br />
[[image:youbot.jpg|right]]<br />
<br />
We have found [http://www.coppeliarobotics.com/ '''the CoppeliaSim robot simulation environment'''] (formerly known as V-REP) to be a valuable learning tool accompanying the book. It is free for educational use and cross platform. In ME 449 at Northwestern, we use it to experiment with the kinematics of different robots and to animate solutions to inverse kinematics, dynamic simulations, and controllers. <br />
<br />
[[Getting_Started_with_the_CoppeliaSim_Simulator|'''This page''']] gets you started with CoppeliaSim quickly.<br />
<br />
[[CoppeliaSim_Introduction|'''This page''']] provides "scenes" that allow you to interactively explore the kinematics of different robots (e.g., the Universal Robots UR5 6R robot arm and the KUKA youBot mobile manipulator) and to animate trajectories that are the results of exercises in chapters on kinematics, dynamics, and control.<br />
<br />
* [[Media:UR5-IK-720p.mov|A video of a UR5 trajectory created by solving numerical inverse kinematics (Chapter 6, Inverse Kinematics)]]<br />
* [[Media:UR5-falling-720p.mov|A video of the UR5 falling under gravity for 10 s, assuming no friction or gearing at the joints (Chapter 8, Dynamics of Open Chains)]]<br />
* [[Media:youbot-controlled.mov|A video of the KUKA youBot mobile manipulator using Jacobian-pseudoinverse-based control of the end-effector's motion (Chapter 13, Wheeled Mobile Robots)]]<br />
<br />
<br clear=all><br />
<!-- == Videos ==<br />
[https://youtu.be/ftOle31x9NM '''Welcome to Modern Robotics!''' (2:00)]<br />
<br />
Videos supporting the book will be posted to YouTube and linked to from this wiki. [https://youtu.be/PCeP30q795g '''Here is a sample video.'''] Others will be posted in August 2017. <br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension].<br />
--><br />
<br />
== Online Courses ==<br />
<br />
Modern Robotics is now available as a MOOC (massive open online course) Specialization on Coursera!<br />
<br />
'''[https://www.coursera.org/specializations/modernrobotics This is a link to the Specialization home page.]''' The Specialization consists of six short courses, each expected to take approximately four weeks of approximately five hours of effort per week:<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together some of the supplemental material used in the Coursera MOOCs]]'''.<br />
<br />
The material in Modern Robotics also forms the basis for two edX online courses. These courses were created before the book was finished, so some of the notation used is a bit different from that used in the book.<br />
<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-i Robot Mechanics and Control, Part I]<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-ii Robot Mechanics and Control, Part II]<br />
<br />
== Using the Online Course Materials in a Traditional Classroom Course ==<br />
<br />
If you are using the book in a traditional university setting, you can ask your students to sign up for the relevant courses on Coursera (see above). They can audit the courses, so they don't have to pay. They will have access to the video lectures and to the video comprehension questions that follow each video lecture. They will also have access to discussion forums. (They won't have access to graded tests and peer-graded assignments, which require paying the Coursera fee.) If students watch the videos and do the reading before class, you can spend class time working on example problems, homework problems, or discussing points where confusion arises, rather than delivering a traditional lecture.<br />
<br />
== Supplemental Information ==<br />
<br />
* UR5 parameters you can use for dynamic simulations (note: the values are not exact, and do not account for the effect of gearing at the joints)<br />
** [[Media:UR5-parameters.nb|UR5 parameters in a Mathematica notebook]]<br />
** [[Media:UR5-parameters.m|UR5 parameters in MATLAB]]<br />
** [[Media:UR5-parameters-py.txt|UR5 parameters in Python]]<br />
* The UR5 URDF file from Chapter 4 of the book ([[Media:UR5-URDF.pdf|.pdf format]] or [[Media:UR5-URDF.txt|.txt format]]). For learning purposes only, not actual use; it contains only kinematic and inertial properties, and does not fully account for the effects of gearing. This file is based on the [https://github.com/ros-industrial/universal_robot/blob/indigo-devel/ur_description/urdf/ur5.urdf.xacro UR5 URDF from the ROS-Industrial team].<br />
* [http://petercorke.com/Robotics_Toolbox.html Peter Corke's excellent Robotics Toolbox for MATLAB] and other robotics software linked to from his site.<br />
* [https://github.com/quangounet/TOPP Open-source software for time-optimal time scaling (Chapter 9.4), courtesy of Quang-Cuong Pham].<br />
<br />
== About the Authors ==<br />
<br />
[[image:kevin-m-lynch-headshot.jpg|right]]<br />
<br />
'''Kevin M. Lynch''' is Professor and Chair of the Mechanical Engineering Department at Northwestern University. He is director of the [https://robotics.northwestern.edu Center for Robotics and Biosystems] and a member of the [http://nico.northwestern.edu Northwestern Institute on Complex Systems]. His research focuses on dynamics, motion planning, and control for robot manipulation and locomotion; self-organizing multi-agent systems; and physically interacting human-robot systems.<br />
<br />
He is Editor-in-Chief of the ''IEEE Transactions on Robotics'', former Editor-in-Chief of the IEEE International Conference on Robotics and Automation Conference Editorial Board, and a former Editor of the IEEE Transactions on Robotics, the IEEE Robotics and Automation Letters, and the IEEE Transactions on Automation Science and Engineering. He is a co-author of [https://www.amazon.com/Principles-Robot-Motion-Implementations-Intelligent/dp/0262033275 ''The Principles of Robot Motion''] (MIT Press, 2005) and [http://nu32.org ''Embedded Computing and Mechatronics with the PIC32 Microcontroller''] (Elsevier, 2015), an IEEE fellow, and the recipient of the IEEE Early Career Award in Robotics and Automation, Northwestern's Professorship of Teaching Excellence, and the Northwestern Teacher of the Year award in engineering. He earned a BSE in Electrical Engineering from Princeton University and a PhD in Robotics from Carnegie Mellon University.<br />
<br />
<br clear=all><br />
<br />
[[image:frank-park-headshot.jpg|right]]<br />
<br />
'''Frank C. Park''' received his BS in electrical engineering from MIT and his PhD in applied mathematics from Harvard University. From 1991 to 1995 he was assistant professor of mechanical and aerospace engineering at the University of California, Irvine. Since 1995 he has been professor of mechanical and aerospace engineering at Seoul National University, where he is currently chair of the department. His research interests are in robot mechanics, planning and control, vision and image processing, and related areas of applied mathematics. He has been an IEEE Robotics and Automation Society Distinguished Lecturer, and received best paper awards for his work on visual tracking and parallel robot design. He has served on the editorial boards of the Springer Handbook of Robotics, Springer Advanced Tracts in Robotics (STAR), Robotica, and the ASME Journal of Mechanisms and Robotics. He has held adjunct faculty positions at the HKUST Robotics Institute, NYU Courant Institute, and the Interactive Computing Department at Georgia Tech. In 2014 he received the Seoul National University Teaching Excellence Award. He is a fellow of the IEEE, former Editor-in-Chief of the ''IEEE Transactions on Robotics'', and developer of the edX courses Robot Mechanics and Control I, II.<br />
<br clear=all><br />
<br />
<!--<br />
=== Why LynchAndPark.org? ===<br />
<br />
[[File:ModernRoboticsFlyer.jpg|right|thumb|x300px|Advertising flyer for the book.]]<br />
You may have gotten here from the URL http://lynchandpark.org. If you're like us, you forget the name of the textbook, but remember the names of the authors. We thought it would be easiest to remember this URL. If you ever have any problems with http://lynchandpark.org, you can try http://www.lynchandpark.org , http://modernrobotics.org, or http://www.modernrobotics.org.<br />
--><br />
<br clear=all><br />
<br />
== Mechatronics ==<br />
<br />
[[Image:NU32_Book_Cover.jpg|x200px |right | link=NU32]]<br />
<br />
<!--<br />
[[File:NU32_Book_Cover.jpg|x200px|thumb|right|''Embedded Computing and Mechatronics,'' Lynch Marchuk, and Elwin, Elsevier 2015.]]<br />
--><br />
''Modern Robotics'' is written at the system level: you learn about the kinematics, dynamics, motion planning, and control of an entire robot system. If you would like to learn more about the details of implementation, e.g., joint-level feedback control, driving motors (including brushed, brushless, steppers, and servos), gearing, sensors, signal processing, etc., check out [[NU32|''Embedded Computing and Mechatronics'']] by Lynch, Marchuk, and Elwin, Elsevier 2015.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_RoboticsModern Robotics2020-02-12T21:48:03Z<p>Lynch: </p>
<hr />
<div>[[File:ModernRoboticsCover.jpg|right|thumb|x300px|The Cambridge University Press cover.]] <br />
This is the home page of the textbook "Modern Robotics: Mechanics, Planning, and Control," Kevin M. Lynch and Frank C. Park, Cambridge University Press, 2017, ISBN 9781107156302. Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below.<br />
<br />
[[File:ModernRoboticsCMPCover.jpg|right|thumb|x300px|[https://item.jd.com/12788036.html The Chinese version from China Machine Press.]]] <br />
<br />
'''New!''' You can purchase [https://item.jd.com/12788036.html '''the Chinese translation of the book'''].<br />
<br />
If you find this book useful for a course or self-study, please contact Kevin or Frank and let us know!<br />
<br />
'''[[Modern_Robotics#Online_Courses | Modern Robotics is now available as online courses on Coursera.]]'''<br />
<br />
'''From the foreword:'''<br />
<br />
"Frank and Kevin have provided a wonderfully clear and patient explanation of their subject." '''Roger Brockett''', ''Harvard University''<br />
<br />
"''Modern Robotics'' imparts the most important insights of robotics ... with a clarity that makes it accessible to undergraduate students." '''Matthew T. Mason''', ''Carnegie Mellon University''<br />
<br />
'''From the [https://ieeexplore.ieee.org/document/8897162 IEEE Control Systems Magazine book review]:'''<br />
<br />
"It is the pedagogical strength of this book that concepts from Lie group theory (which form the building blocks of modern kinematics) are presented in a way that will appeal to undergraduate students as well as to researchers and roboticists in general. ... For some time, this approach was deemed too complicated to be taught in undergraduate robotics classes. However, this book by Lynch and Park should change the conventional wisdom on this issue. ... With its consolidated modern approach, ''Modern Robotics'' is destined to become a classic in the field." '''Andreas Mueller''', ''Johannes Kepler University, Austria''<br />
<br />
== Book, Practice Exercises, and Linear Algebra Review ==<br />
<br />
Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below. You can also purchase [https://item.jd.com/12788036.html '''the Chinese version of the book'''].<br />
<br />
The current version of the book is the updated first edition (online preprint dated December 2019, printed published version from Cambridge marked "3rd printing 2019" or later). The updated first edition (also referred to as "version 2") includes several corrections and minor additions to the original first edition (first published in May 2017).<br />
<br />
This book is the result of course notes developed over many years for the course M2794.0027 Introduction to Robotics at Seoul National University and ME 449 Robotic Manipulation at Northwestern University. The evolving course notes have been posted on the internet for years to support these classes. <br />
<br />
The for-purchase version of the book from Cambridge University Press has improved layout and typesetting, updated figures, different pagination (and fewer pages), and more careful copyediting, and it is considered the "official" version of the book. But the online preprint version of the book has the same chapters, sections, and exercises, and it is quite close in content to the Cambridge-published version. <br />
<br />
We are posting four versions of the book. All versions have exactly the same contents and pagination. They differ only in the sizes of the margins and the size of the print, as manipulated in Adobe Acrobat after latex'ing. Two of the versions have working hyperlinks for navigating the book on your computer or tablet.<br />
<br />
'''With working hyperlinks.''' (To navigate the book using the hyperlinks, click on the hyperlink. To go back where you came from, choose the button or keystroke appropriate to your pdf reader. For example, on the Mac with Acrobat or Acrobat Reader, use cmd-left arrow. With Preview on the Mac, use cmd-[. Some readers on other operating systems use alt-left arrow. You can google to see which solution works for your pdf reader.)<br />
* [[Media:MR-v2.pdf|Default 8.5x11 or A4 version]]. Printable version with 10 pt font and large margins.<br />
* [[Media:MR-tablet-v2.pdf|Tablet version]]. Margins have been eliminated so that no space is wasted when viewing the document on a computer or tablet.<br />
<br />
'''Printable versions without working hyperlinks.'''<br />
* [[Media:MR-largefont-v2.pdf|Large font 8.5x11 or A4 version]]. Printable version with 12 pt font equivalent and smaller margins than the 10 pt default version.<br />
* [[Media:MR-2up-v2.pdf|2up version]]. Printable version with 2 book pages per page, for saving paper if you have good eyes. Approximately 8.5 pt font equivalent.<br />
<br />
These files have been compressed to about 7 MB. Let us know if you have any problems reading them. Please note that some versions of the default Mac OS X pdf reader, Preview, are known to have bugs displaying certain images in pdf files. If a figure is not appearing properly, please try a better pdf viewer, like Acrobat Reader.<br />
<br />
'''Table of Contents:'''<br />
# Preview<br />
# Configuration Space<br />
# Rigid-Body Motions<br />
# Forward Kinematics<br />
# Velocity Kinematics and Statics<br />
# Inverse Kinematics<br />
# Kinematics of Closed Chains<br />
# Dynamics of Open Chains<br />
# Trajectory Generation<br />
# Motion Planning<br />
# Robot Control<br />
# Grasping and Manipulation<br />
# Wheeled Mobile Robots<br />
<br />
:Appendix A. Summary of Useful Formulas<br />
<br />
:Appendix B. Other Representations of Rotations<br />
<br />
:Appendix C. Denavit-Hartenberg Parameters<br />
<br />
:Appendix D. Optimization and Lagrange Multipliers<br />
<br />
== Useful Supplemental Documents ==<br />
<br />
* [[Media:MR_practice_exercises.pdf|Practice exercises to give you more experience with the material]]. These practice exercises come with solutions, since Cambridge makes the end-of-chapter solutions available to instructors only.<br />
* [[Modern Robotics Linear Algebra Review|A linear algebra refresher appendix to accompany the book.]]<br />
<br clear=all><br />
<br />
== Videos ==<br />
<br />
* [http://modernrobotics.northwestern.edu '''Click here'''] to watch the video lectures embedded in a convenient viewing environment. <br />
* [[Modern Robotics Videos|'''Click here''']] if you prefer to watch the videos within the YouTube environment.<br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension]. Also check out the [https://robotacademy.net.au/ Robot Academy at Queensland University of Technology].<br />
<br />
== Solution Manual ==<br />
<br />
If you are an instructor, you can obtain a copy of the exercise solutions from Cambridge University Press. Go to the "Resources" section of [http://www.cambridge.org/us/academic/subjects/computer-science/computer-graphics-image-processing-and-robotics/modern-robotics-mechanics-planning-and-control '''the Cambridge University Press webpage for the book'''].<br />
<br />
== Prerequisites ==<br />
<br />
This book was written to be accessible to engineering students after taking typical first-year engineering courses. The student should have an understanding of:<br />
* freshman-level physics, including f = ma; free-body diagrams with masses, springs, and dampers; vector forces; and vector torques (or moments) as the cross product of a distance vector and a force;<br />
* linear algebra, including matrix operations, positive definiteness of a matrix, determinants, complex numbers, eigenvalues, and eigenvectors; <br />
* some calculus, derivatives, and partial derivatives; and<br />
* basic linear ordinary differential equations.<br />
<br />
The student should also be prepared to program, but only basic programming skills are needed. Code is provided in python (freely available), MATLAB (for purchase, or you could use the freely available GNU Octave clone), and Mathematica (for purchase), so those languages are preferred.<br />
<br />
== Errata == <br />
<br />
'''[[Modern Robotics Errata|Errata for the book can be found here. Please click here to report any corrections, typos, or comments.]]'''<br />
<br />
== Software ==<br />
<br />
[https://github.com/NxRLab/ModernRobotics '''Download the book software from GitHub.''']<br />
<br />
The software accompanying the book is written in Mathematica, MATLAB, and Python. It is written to be educational and to reinforce the concepts in the book, not to be as computationally efficient or robust as possible. <br />
<br />
The origin of the software is student solutions to homework exercises. A major update was committed in January 2017, correcting some bugs in the earlier version.<br />
<br />
[https://github.com/NxRLab/ModernRobotics/issues '''To report any issues with the software, please click the "Issues" tab in GitHub.''']<br />
<br />
== Simulation ==<br />
<br />
[[image:youbot.jpg|right]]<br />
<br />
We have found [http://www.coppeliarobotics.com/ '''the CoppeliaSim robot simulation environment'''] (formerly known as V-REP) to be a valuable learning tool accompanying the book. It is free for educational use and cross platform. In ME 449 at Northwestern, we use it to experiment with the kinematics of different robots and to animate solutions to inverse kinematics, dynamic simulations, and controllers. <br />
<br />
[[Getting_Started_with_the_CoppeliaSim_Simulator|'''This page''']] gets you started with CoppeliaSim quickly.<br />
<br />
[[CoppeliaSim_Introduction|'''This page''']] provides "scenes" that allow you to interactively explore the kinematics of different robots (e.g., the Universal Robots UR5 6R robot arm and the KUKA youBot mobile manipulator) and to animate trajectories that are the results of exercises in chapters on kinematics, dynamics, and control.<br />
<br />
* [[Media:UR5-IK-720p.mov|A video of a UR5 trajectory created by solving numerical inverse kinematics (Chapter 6, Inverse Kinematics)]]<br />
* [[Media:UR5-falling-720p.mov|A video of the UR5 falling under gravity for 10 s, assuming no friction or gearing at the joints (Chapter 8, Dynamics of Open Chains)]]<br />
* [[Media:youbot-controlled.mov|A video of the KUKA youBot mobile manipulator using Jacobian-pseudoinverse-based control of the end-effector's motion (Chapter 13, Wheeled Mobile Robots)]]<br />
<br />
<br clear=all><br />
<!-- == Videos ==<br />
[https://youtu.be/ftOle31x9NM '''Welcome to Modern Robotics!''' (2:00)]<br />
<br />
Videos supporting the book will be posted to YouTube and linked to from this wiki. [https://youtu.be/PCeP30q795g '''Here is a sample video.'''] Others will be posted in August 2017. <br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension].<br />
--><br />
<br />
== Online Courses ==<br />
<br />
Modern Robotics is now available as a MOOC (massive open online course) Specialization on Coursera!<br />
<br />
'''[https://www.coursera.org/specializations/modernrobotics This is a link to the Specialization home page.]''' The Specialization consists of six short courses, each expected to take approximately four weeks of approximately five hours of effort per week:<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together some of the supplemental material used in the Coursera MOOCs]]'''.<br />
<br />
The material in Modern Robotics also forms the basis for two edX online courses. These courses were created before the book was finished, so some of the notation used is a bit different from that used in the book.<br />
<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-i Robot Mechanics and Control, Part I]<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-ii Robot Mechanics and Control, Part II]<br />
<br />
== Using the Online Course Materials in a Traditional Classroom Course ==<br />
<br />
If you are using the book in a traditional university setting, you can ask your students to sign up for the relevant courses on Coursera (see above). They can audit the courses, so they don't have to pay. They will have access to the video lectures and to the video comprehension questions that follow each video lecture. They will also have access to discussion forums. (They won't have access to graded tests and peer-graded assignments, which require paying the Coursera fee.) If students watch the videos and do the reading before class, you can spend class time working on example problems, homework problems, or discussing points where confusion arises, rather than delivering a traditional lecture.<br />
<br />
== Supplemental Information ==<br />
<br />
* UR5 parameters you can use for dynamic simulations (note: the values are not exact, and do not account for the effect of gearing at the joints)<br />
** [[Media:UR5-parameters.nb|UR5 parameters in a Mathematica notebook]]<br />
** [[Media:UR5-parameters.m|UR5 parameters in MATLAB]]<br />
** [[Media:UR5-parameters-py.txt|UR5 parameters in Python]]<br />
* The UR5 URDF file from Chapter 4 of the book ([[Media:UR5-URDF.pdf|.pdf format]] or [[Media:UR5-URDF.txt|.txt format]]). For learning purposes only, not actual use; it contains only kinematic and inertial properties, and does not fully account for the effects of gearing. This file is based on the [https://github.com/ros-industrial/universal_robot/blob/indigo-devel/ur_description/urdf/ur5.urdf.xacro UR5 URDF from the ROS-Industrial team].<br />
* [http://petercorke.com/Robotics_Toolbox.html Peter Corke's excellent Robotics Toolbox for MATLAB] and other robotics software linked to from his site.<br />
* [https://github.com/quangounet/TOPP Open-source software for time-optimal time scaling (Chapter 9.4), courtesy of Quang-Cuong Pham].<br />
<br />
== About the Authors ==<br />
<br />
[[image:kevin-m-lynch-headshot.jpg|right]]<br />
<br />
'''Kevin M. Lynch''' is Professor and Chair of the Mechanical Engineering Department at Northwestern University. He is director of the [https://robotics.northwestern.edu Center for Robotics and Biosystems] and a member of the [http://nico.northwestern.edu Northwestern Institute on Complex Systems]. His research focuses on dynamics, motion planning, and control for robot manipulation and locomotion; self-organizing multi-agent systems; and physically interacting human-robot systems.<br />
<br />
He is Editor-in-Chief of the ''IEEE Transactions on Robotics'', former Editor-in-Chief of the IEEE International Conference on Robotics and Automation Conference Editorial Board, and a former Editor of the IEEE Transactions on Robotics, the IEEE Robotics and Automation Letters, and the IEEE Transactions on Automation Science and Engineering. He is a co-author of [https://www.amazon.com/Principles-Robot-Motion-Implementations-Intelligent/dp/0262033275 ''The Principles of Robot Motion''] (MIT Press, 2005) and [http://nu32.org ''Embedded Computing and Mechatronics with the PIC32 Microcontroller''] (Elsevier, 2015), an IEEE fellow, and the recipient of the IEEE Early Career Award in Robotics and Automation, Northwestern's Professorship of Teaching Excellence, and the Northwestern Teacher of the Year award in engineering. He earned a BSE in Electrical Engineering from Princeton University and a PhD in Robotics from Carnegie Mellon University.<br />
<br />
<br clear=all><br />
<br />
[[image:frank-park-headshot.jpg|right]]<br />
<br />
'''Frank C. Park''' received his BS in electrical engineering from MIT and his PhD in applied mathematics from Harvard University. From 1991 to 1995 he was assistant professor of mechanical and aerospace engineering at the University of California, Irvine. Since 1995 he has been professor of mechanical and aerospace engineering at Seoul National University, where he is currently chair of the department. His research interests are in robot mechanics, planning and control, vision and image processing, and related areas of applied mathematics. He has been an IEEE Robotics and Automation Society Distinguished Lecturer, and received best paper awards for his work on visual tracking and parallel robot design. He has served on the editorial boards of the Springer Handbook of Robotics, Springer Advanced Tracts in Robotics (STAR), Robotica, and the ASME Journal of Mechanisms and Robotics. He has held adjunct faculty positions at the HKUST Robotics Institute, NYU Courant Institute, and the Interactive Computing Department at Georgia Tech. In 2014 he received the Seoul National University Teaching Excellence Award. He is a fellow of the IEEE, former Editor-in-Chief of the ''IEEE Transactions on Robotics'', and developer of the edX courses Robot Mechanics and Control I, II.<br />
<br clear=all><br />
<br />
<!--<br />
=== Why LynchAndPark.org? ===<br />
<br />
[[File:ModernRoboticsFlyer.jpg|right|thumb|x300px|Advertising flyer for the book.]]<br />
You may have gotten here from the URL http://lynchandpark.org. If you're like us, you forget the name of the textbook, but remember the names of the authors. We thought it would be easiest to remember this URL. If you ever have any problems with http://lynchandpark.org, you can try http://www.lynchandpark.org , http://modernrobotics.org, or http://www.modernrobotics.org.<br />
--><br />
<br clear=all><br />
<br />
== Mechatronics ==<br />
<br />
[[Image:NU32_Book_Cover.jpg|x200px |right | link=NU32]]<br />
<br />
<!--<br />
[[File:NU32_Book_Cover.jpg|x200px|thumb|right|''Embedded Computing and Mechatronics,'' Lynch Marchuk, and Elwin, Elsevier 2015.]]<br />
--><br />
''Modern Robotics'' is written at the system level: you learn about the kinematics, dynamics, motion planning, and control of an entire robot system. If you would like to learn more about the details of implementation, e.g., joint-level feedback control, driving motors (including brushed, brushless, steppers, and servos), gearing, sensors, signal processing, etc., check out [[NU32|''Embedded Computing and Mechatronics'']] by Lynch, Marchuk, and Elwin, Elsevier 2015.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_RoboticsModern Robotics2020-02-12T21:47:31Z<p>Lynch: </p>
<hr />
<div>[[File:ModernRoboticsCover.jpg|right|thumb|x300px|The Cambridge University Press cover.]] <br />
This is the home page of the textbook "Modern Robotics: Mechanics, Planning, and Control," Kevin M. Lynch and Frank C. Park, Cambridge University Press, 2017, ISBN 9781107156302. Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below.<br />
<br />
[[File:ModernRoboticsCMPCover.jpg|right|thumb|x300px|[https://item.jd.com/12788036.html The Chinese version from China Machine Press.]]] <br />
<br />
'''New!''' You can purchase [https://item.jd.com/12788036.html '''the Chinese translation of the book'''].<br />
<br />
If you find this book useful for a course or self-study, please contact Kevin or Frank and let us know!<br />
<br />
'''[[Modern_Robotics#Online_Courses | Modern Robotics is now available as online courses on Coursera.]]'''<br />
<br />
'''From the foreword:'''<br />
<br />
"Frank and Kevin have provided a wonderfully clear and patient explanation of their subject." '''Roger Brockett''', ''Harvard University''<br />
<br />
"''Modern Robotics'' imparts the most important insights of robotics ... with a clarity that makes it accessible to undergraduate students." '''Matthew T. Mason''', ''Carnegie Mellon University''<br />
<br />
'''From the [https://ieeexplore.ieee.org/document/8897162 '''IEEE Control Systems Magazine book review:''']<br />
<br />
"It is the pedagogical strength of this book that concepts from Lie group theory (which form the building blocks of modern kinematics) are presented in a way that will appeal to undergraduate students as well as to researchers and roboticists in general. ... For some time, this approach was deemed too complicated to be taught in undergraduate robotics classes. However, this book by Lynch and Park should change the conventional wisdom on this issue. ... With its consolidated modern approach, ''Modern Robotics'' is destined to become a classic in the field." '''Andreas Mueller''', ''Johannes Kepler University, Austria''<br />
<br />
== Book, Practice Exercises, and Linear Algebra Review ==<br />
<br />
Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below. You can also purchase [https://item.jd.com/12788036.html '''the Chinese version of the book'''].<br />
<br />
The current version of the book is the updated first edition (online preprint dated December 2019, printed published version from Cambridge marked "3rd printing 2019" or later). The updated first edition (also referred to as "version 2") includes several corrections and minor additions to the original first edition (first published in May 2017).<br />
<br />
This book is the result of course notes developed over many years for the course M2794.0027 Introduction to Robotics at Seoul National University and ME 449 Robotic Manipulation at Northwestern University. The evolving course notes have been posted on the internet for years to support these classes. <br />
<br />
The for-purchase version of the book from Cambridge University Press has improved layout and typesetting, updated figures, different pagination (and fewer pages), and more careful copyediting, and it is considered the "official" version of the book. But the online preprint version of the book has the same chapters, sections, and exercises, and it is quite close in content to the Cambridge-published version. <br />
<br />
We are posting four versions of the book. All versions have exactly the same contents and pagination. They differ only in the sizes of the margins and the size of the print, as manipulated in Adobe Acrobat after latex'ing. Two of the versions have working hyperlinks for navigating the book on your computer or tablet.<br />
<br />
'''With working hyperlinks.''' (To navigate the book using the hyperlinks, click on the hyperlink. To go back where you came from, choose the button or keystroke appropriate to your pdf reader. For example, on the Mac with Acrobat or Acrobat Reader, use cmd-left arrow. With Preview on the Mac, use cmd-[. Some readers on other operating systems use alt-left arrow. You can google to see which solution works for your pdf reader.)<br />
* [[Media:MR-v2.pdf|Default 8.5x11 or A4 version]]. Printable version with 10 pt font and large margins.<br />
* [[Media:MR-tablet-v2.pdf|Tablet version]]. Margins have been eliminated so that no space is wasted when viewing the document on a computer or tablet.<br />
<br />
'''Printable versions without working hyperlinks.'''<br />
* [[Media:MR-largefont-v2.pdf|Large font 8.5x11 or A4 version]]. Printable version with 12 pt font equivalent and smaller margins than the 10 pt default version.<br />
* [[Media:MR-2up-v2.pdf|2up version]]. Printable version with 2 book pages per page, for saving paper if you have good eyes. Approximately 8.5 pt font equivalent.<br />
<br />
These files have been compressed to about 7 MB. Let us know if you have any problems reading them. Please note that some versions of the default Mac OS X pdf reader, Preview, are known to have bugs displaying certain images in pdf files. If a figure is not appearing properly, please try a better pdf viewer, like Acrobat Reader.<br />
<br />
'''Table of Contents:'''<br />
# Preview<br />
# Configuration Space<br />
# Rigid-Body Motions<br />
# Forward Kinematics<br />
# Velocity Kinematics and Statics<br />
# Inverse Kinematics<br />
# Kinematics of Closed Chains<br />
# Dynamics of Open Chains<br />
# Trajectory Generation<br />
# Motion Planning<br />
# Robot Control<br />
# Grasping and Manipulation<br />
# Wheeled Mobile Robots<br />
<br />
:Appendix A. Summary of Useful Formulas<br />
<br />
:Appendix B. Other Representations of Rotations<br />
<br />
:Appendix C. Denavit-Hartenberg Parameters<br />
<br />
:Appendix D. Optimization and Lagrange Multipliers<br />
<br />
== Useful Supplemental Documents ==<br />
<br />
* [[Media:MR_practice_exercises.pdf|Practice exercises to give you more experience with the material]]. These practice exercises come with solutions, since Cambridge makes the end-of-chapter solutions available to instructors only.<br />
* [[Modern Robotics Linear Algebra Review|A linear algebra refresher appendix to accompany the book.]]<br />
<br clear=all><br />
<br />
== Videos ==<br />
<br />
* [http://modernrobotics.northwestern.edu '''Click here'''] to watch the video lectures embedded in a convenient viewing environment. <br />
* [[Modern Robotics Videos|'''Click here''']] if you prefer to watch the videos within the YouTube environment.<br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension]. Also check out the [https://robotacademy.net.au/ Robot Academy at Queensland University of Technology].<br />
<br />
== Solution Manual ==<br />
<br />
If you are an instructor, you can obtain a copy of the exercise solutions from Cambridge University Press. Go to the "Resources" section of [http://www.cambridge.org/us/academic/subjects/computer-science/computer-graphics-image-processing-and-robotics/modern-robotics-mechanics-planning-and-control '''the Cambridge University Press webpage for the book'''].<br />
<br />
== Prerequisites ==<br />
<br />
This book was written to be accessible to engineering students after taking typical first-year engineering courses. The student should have an understanding of:<br />
* freshman-level physics, including f = ma; free-body diagrams with masses, springs, and dampers; vector forces; and vector torques (or moments) as the cross product of a distance vector and a force;<br />
* linear algebra, including matrix operations, positive definiteness of a matrix, determinants, complex numbers, eigenvalues, and eigenvectors; <br />
* some calculus, derivatives, and partial derivatives; and<br />
* basic linear ordinary differential equations.<br />
<br />
The student should also be prepared to program, but only basic programming skills are needed. Code is provided in python (freely available), MATLAB (for purchase, or you could use the freely available GNU Octave clone), and Mathematica (for purchase), so those languages are preferred.<br />
<br />
== Errata == <br />
<br />
'''[[Modern Robotics Errata|Errata for the book can be found here. Please click here to report any corrections, typos, or comments.]]'''<br />
<br />
== Software ==<br />
<br />
[https://github.com/NxRLab/ModernRobotics '''Download the book software from GitHub.''']<br />
<br />
The software accompanying the book is written in Mathematica, MATLAB, and Python. It is written to be educational and to reinforce the concepts in the book, not to be as computationally efficient or robust as possible. <br />
<br />
The origin of the software is student solutions to homework exercises. A major update was committed in January 2017, correcting some bugs in the earlier version.<br />
<br />
[https://github.com/NxRLab/ModernRobotics/issues '''To report any issues with the software, please click the "Issues" tab in GitHub.''']<br />
<br />
== Simulation ==<br />
<br />
[[image:youbot.jpg|right]]<br />
<br />
We have found [http://www.coppeliarobotics.com/ '''the CoppeliaSim robot simulation environment'''] (formerly known as V-REP) to be a valuable learning tool accompanying the book. It is free for educational use and cross platform. In ME 449 at Northwestern, we use it to experiment with the kinematics of different robots and to animate solutions to inverse kinematics, dynamic simulations, and controllers. <br />
<br />
[[Getting_Started_with_the_CoppeliaSim_Simulator|'''This page''']] gets you started with CoppeliaSim quickly.<br />
<br />
[[CoppeliaSim_Introduction|'''This page''']] provides "scenes" that allow you to interactively explore the kinematics of different robots (e.g., the Universal Robots UR5 6R robot arm and the KUKA youBot mobile manipulator) and to animate trajectories that are the results of exercises in chapters on kinematics, dynamics, and control.<br />
<br />
* [[Media:UR5-IK-720p.mov|A video of a UR5 trajectory created by solving numerical inverse kinematics (Chapter 6, Inverse Kinematics)]]<br />
* [[Media:UR5-falling-720p.mov|A video of the UR5 falling under gravity for 10 s, assuming no friction or gearing at the joints (Chapter 8, Dynamics of Open Chains)]]<br />
* [[Media:youbot-controlled.mov|A video of the KUKA youBot mobile manipulator using Jacobian-pseudoinverse-based control of the end-effector's motion (Chapter 13, Wheeled Mobile Robots)]]<br />
<br />
<br clear=all><br />
<!-- == Videos ==<br />
[https://youtu.be/ftOle31x9NM '''Welcome to Modern Robotics!''' (2:00)]<br />
<br />
Videos supporting the book will be posted to YouTube and linked to from this wiki. [https://youtu.be/PCeP30q795g '''Here is a sample video.'''] Others will be posted in August 2017. <br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension].<br />
--><br />
<br />
== Online Courses ==<br />
<br />
Modern Robotics is now available as a MOOC (massive open online course) Specialization on Coursera!<br />
<br />
'''[https://www.coursera.org/specializations/modernrobotics This is a link to the Specialization home page.]''' The Specialization consists of six short courses, each expected to take approximately four weeks of approximately five hours of effort per week:<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together some of the supplemental material used in the Coursera MOOCs]]'''.<br />
<br />
The material in Modern Robotics also forms the basis for two edX online courses. These courses were created before the book was finished, so some of the notation used is a bit different from that used in the book.<br />
<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-i Robot Mechanics and Control, Part I]<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-ii Robot Mechanics and Control, Part II]<br />
<br />
== Using the Online Course Materials in a Traditional Classroom Course ==<br />
<br />
If you are using the book in a traditional university setting, you can ask your students to sign up for the relevant courses on Coursera (see above). They can audit the courses, so they don't have to pay. They will have access to the video lectures and to the video comprehension questions that follow each video lecture. They will also have access to discussion forums. (They won't have access to graded tests and peer-graded assignments, which require paying the Coursera fee.) If students watch the videos and do the reading before class, you can spend class time working on example problems, homework problems, or discussing points where confusion arises, rather than delivering a traditional lecture.<br />
<br />
== Supplemental Information ==<br />
<br />
* UR5 parameters you can use for dynamic simulations (note: the values are not exact, and do not account for the effect of gearing at the joints)<br />
** [[Media:UR5-parameters.nb|UR5 parameters in a Mathematica notebook]]<br />
** [[Media:UR5-parameters.m|UR5 parameters in MATLAB]]<br />
** [[Media:UR5-parameters-py.txt|UR5 parameters in Python]]<br />
* The UR5 URDF file from Chapter 4 of the book ([[Media:UR5-URDF.pdf|.pdf format]] or [[Media:UR5-URDF.txt|.txt format]]). For learning purposes only, not actual use; it contains only kinematic and inertial properties, and does not fully account for the effects of gearing. This file is based on the [https://github.com/ros-industrial/universal_robot/blob/indigo-devel/ur_description/urdf/ur5.urdf.xacro UR5 URDF from the ROS-Industrial team].<br />
* [http://petercorke.com/Robotics_Toolbox.html Peter Corke's excellent Robotics Toolbox for MATLAB] and other robotics software linked to from his site.<br />
* [https://github.com/quangounet/TOPP Open-source software for time-optimal time scaling (Chapter 9.4), courtesy of Quang-Cuong Pham].<br />
<br />
== About the Authors ==<br />
<br />
[[image:kevin-m-lynch-headshot.jpg|right]]<br />
<br />
'''Kevin M. Lynch''' is Professor and Chair of the Mechanical Engineering Department at Northwestern University. He is director of the [https://robotics.northwestern.edu Center for Robotics and Biosystems] and a member of the [http://nico.northwestern.edu Northwestern Institute on Complex Systems]. His research focuses on dynamics, motion planning, and control for robot manipulation and locomotion; self-organizing multi-agent systems; and physically interacting human-robot systems.<br />
<br />
He is Editor-in-Chief of the ''IEEE Transactions on Robotics'', former Editor-in-Chief of the IEEE International Conference on Robotics and Automation Conference Editorial Board, and a former Editor of the IEEE Transactions on Robotics, the IEEE Robotics and Automation Letters, and the IEEE Transactions on Automation Science and Engineering. He is a co-author of [https://www.amazon.com/Principles-Robot-Motion-Implementations-Intelligent/dp/0262033275 ''The Principles of Robot Motion''] (MIT Press, 2005) and [http://nu32.org ''Embedded Computing and Mechatronics with the PIC32 Microcontroller''] (Elsevier, 2015), an IEEE fellow, and the recipient of the IEEE Early Career Award in Robotics and Automation, Northwestern's Professorship of Teaching Excellence, and the Northwestern Teacher of the Year award in engineering. He earned a BSE in Electrical Engineering from Princeton University and a PhD in Robotics from Carnegie Mellon University.<br />
<br />
<br clear=all><br />
<br />
[[image:frank-park-headshot.jpg|right]]<br />
<br />
'''Frank C. Park''' received his BS in electrical engineering from MIT and his PhD in applied mathematics from Harvard University. From 1991 to 1995 he was assistant professor of mechanical and aerospace engineering at the University of California, Irvine. Since 1995 he has been professor of mechanical and aerospace engineering at Seoul National University, where he is currently chair of the department. His research interests are in robot mechanics, planning and control, vision and image processing, and related areas of applied mathematics. He has been an IEEE Robotics and Automation Society Distinguished Lecturer, and received best paper awards for his work on visual tracking and parallel robot design. He has served on the editorial boards of the Springer Handbook of Robotics, Springer Advanced Tracts in Robotics (STAR), Robotica, and the ASME Journal of Mechanisms and Robotics. He has held adjunct faculty positions at the HKUST Robotics Institute, NYU Courant Institute, and the Interactive Computing Department at Georgia Tech. In 2014 he received the Seoul National University Teaching Excellence Award. He is a fellow of the IEEE, former Editor-in-Chief of the ''IEEE Transactions on Robotics'', and developer of the edX courses Robot Mechanics and Control I, II.<br />
<br clear=all><br />
<br />
<!--<br />
=== Why LynchAndPark.org? ===<br />
<br />
[[File:ModernRoboticsFlyer.jpg|right|thumb|x300px|Advertising flyer for the book.]]<br />
You may have gotten here from the URL http://lynchandpark.org. If you're like us, you forget the name of the textbook, but remember the names of the authors. We thought it would be easiest to remember this URL. If you ever have any problems with http://lynchandpark.org, you can try http://www.lynchandpark.org , http://modernrobotics.org, or http://www.modernrobotics.org.<br />
--><br />
<br clear=all><br />
<br />
== Mechatronics ==<br />
<br />
[[Image:NU32_Book_Cover.jpg|x200px |right | link=NU32]]<br />
<br />
<!--<br />
[[File:NU32_Book_Cover.jpg|x200px|thumb|right|''Embedded Computing and Mechatronics,'' Lynch Marchuk, and Elwin, Elsevier 2015.]]<br />
--><br />
''Modern Robotics'' is written at the system level: you learn about the kinematics, dynamics, motion planning, and control of an entire robot system. If you would like to learn more about the details of implementation, e.g., joint-level feedback control, driving motors (including brushed, brushless, steppers, and servos), gearing, sensors, signal processing, etc., check out [[NU32|''Embedded Computing and Mechatronics'']] by Lynch, Marchuk, and Elwin, Elsevier 2015.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T16:07:33Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forums].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
According to one Coursera student who initially had trouble with CoppeliaSim's video recorder:<br />
<br />
''I had an issue with integrated video recording. The error was "The video compressor failed initializing." It was resolved by switching output format from default "AVI/H.263+ / H-263-1998 / H.263 version 2" to "AVI/MPEG-4 part 2".''<br />
<br />
Try recording and saving a 10-second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T16:06:54Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forums].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
According to one Coursera student who initially had trouble with CoppeliaSim's video recorder:<br />
<br />
''I had an issue with integrated video recording. The error was "The video compressor failed initializing." It was resolved by switching output format from default "AVI/H.263+ / H-263-1998 / H.263 version 2" to "AVI/MPEG-4 part 2".''<br />
<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T16:06:32Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forums].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
According to one Coursera student who initially had trouble with CoppeliaSim's video recorder:<br />
<br />
''I had an issue with integrated video recording. The error was "The video compressor failed initializing." It was resolved by switching output format from default "AVI/H.263+ / H-263-1998 / H.263 version 2" to "AVI/MPEG-4 part 2".<br />
''<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T16:05:03Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forums].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
According to one Coursera student who initially had trouble with CoppeliaSim's video recorder:<br />
<br />
I had an issue with integrated video recording. The error was "The video compressor failed initializing." It was resolved by switching output format from default "AVI/H.263+ / H-263-1998 / H.263 version 2" to "AVI/MPEG-4 part 2".<br />
<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T14:13:39Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forums].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T14:10:45Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forum].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T14:08:37Z<p>Lynch: /* CoppeliaSim Introduction */</p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== CoppeliaSim Introduction ==<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
CoppeliaSim is a powerful cross-platform robot simulator which has a free educational version. CoppeliaSim's strength comes from several features:<br />
<br />
# CoppeliaSim provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# CoppeliaSim is highly extensible. CoppeliaSim developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running CoppeliaSim simulation.<br />
# CoppeliaSim is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use CoppeliaSim. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
CoppeliaSim, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration CoppeliaSim Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION CoppeliaSim SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download CoppeliaSim] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install CoppeliaSim. On Windows, you simply have an EXE that installs CoppeliaSim. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>coppeliaSim.app</code> directory that should allow you start coppeliaSim through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf CoppeliaSim_Edu_V4_0_0_Ubuntu18_04.tar.xz</code>). Then you need to change directories into the CoppeliaSim source directory and run the <code>coppeliaSim.sh</code> shell script. See [[Getting_Started_with_the_CoppeliaSim_Simulator|'''this page''']] for more information on getting started with CoppeliaSim.<br />
<br />
Once CoppeliaSim is open you will want to run one of the scenes below. To run any of them, you first run CoppeliaSim, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every CoppeliaSim scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with CoppeliaSim's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the CoppeliaSim scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the CoppeliaSim scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the CoppeliaSim scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the CoppeliaSim scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the CoppeliaSim scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where CoppeliaSim simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this CoppeliaSim scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the CoppeliaSim scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that CoppeliaSim uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the CoppeliaSim scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
CoppeliaSim will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the CoppeliaSim scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
CoppeliaSim comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with CoppeliaSim. You can find these scenes in the <code>scenes</code> directory under the CoppeliaSim directory. Running and studying these can be a great way to learn more about the CoppeliaSim capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html CoppeliaSim User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/videos.html CoppeliaSim Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm CoppeliaSim Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of CoppeliaSim Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm CoppeliaSim API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how CoppeliaSim enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a CoppeliaSim simulation.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T14:04:44Z<p>Lynch: /* CoppeliaSim Introduction */</p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== CoppeliaSim Introduction ==<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP, which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP simulation scenes. If you have difficulty installing or running CoppeliaSim, and you can't find answers to your questions on [http://forum.coppeliarobotics.com/ Coppelia's forums], you may use any version of V-REP from version 3.4 or later. Any of these is fine for Modern Robotics simulations.'''<br />
<br />
On [http://www.coppeliarobotics.com/index.html CoppeliaSim's homepage] the program is described as<br />
<br />
...the Swiss army knife among robot simulators: you won't find a simulator with more functions, features, or more elaborate APIs.<br />
<br />
CoppeliaSim's strength comes from several features:<br />
<br />
# CoppeliaSim provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# CoppeliaSim is highly extensible. CoppeliaSim developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running CoppeliaSim simulation.<br />
# CoppeliaSim is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use CoppeliaSim. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
CoppeliaSim, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration CoppeliaSim Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION CoppeliaSim SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download CoppeliaSim] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install CoppeliaSim. On Windows, you simply have an EXE that installs CoppeliaSim. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>coppeliaSim.app</code> directory that should allow you start coppeliaSim through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf CoppeliaSim_Edu_V4_0_0_Ubuntu18_04.tar.xz</code>). Then you need to change directories into the CoppeliaSim source directory and run the <code>coppeliaSim.sh</code> shell script. See [[Getting_Started_with_the_CoppeliaSim_Simulator|'''this page''']] for more information on getting started with CoppeliaSim.<br />
<br />
Once CoppeliaSim is open you will want to run one of the scenes below. To run any of them, you first run CoppeliaSim, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every CoppeliaSim scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with CoppeliaSim's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the CoppeliaSim scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the CoppeliaSim scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the CoppeliaSim scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the CoppeliaSim scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the CoppeliaSim scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where CoppeliaSim simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this CoppeliaSim scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the CoppeliaSim scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that CoppeliaSim uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the CoppeliaSim scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
CoppeliaSim will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the CoppeliaSim scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
CoppeliaSim comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with CoppeliaSim. You can find these scenes in the <code>scenes</code> directory under the CoppeliaSim directory. Running and studying these can be a great way to learn more about the CoppeliaSim capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html CoppeliaSim User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/videos.html CoppeliaSim Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm CoppeliaSim Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of CoppeliaSim Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm CoppeliaSim API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how CoppeliaSim enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a CoppeliaSim simulation.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Writing_a_CSV_FileWriting a CSV File2020-01-25T07:59:47Z<p>Lynch: </p>
<hr />
<div>[[image:ur5-img.png|right|x200px]]<br />
<br />
Several of the CoppeliaSim simulation scenes require a plain-text comma-separated values (CSV) file as input. A CSV file may represent the trajectory of a robot, where each row contains the configuration of the robot at an instant in time, with a fixed time between each row. If the robot has <math>n</math> joints, then each row has <math>n</math> numbers separated by commas. For example, five rows of a CSV file for a six-joint robot might look like this:<br />
<br />
2.950000, -1.570000, 0.000000, 0.000000, 0.000000, 0.000000<br />
2.987484, -1.540050, 0.019967, 0.019992, 0.012495, 0.009996<br />
3.024875, -1.510399, 0.039734, 0.039933, 0.024958, 0.019967<br />
3.062079, -1.481344, 0.059104, 0.059775, 0.037360, 0.029888<br />
3.099002, -1.453174, 0.077884, 0.079468, 0.049667, 0.039734<br />
<br />
where each number is a joint angle in radians.<br />
<br />
Below are code snippets in Python, MATLAB, and Mathematica that you can modify to create your own CSV files. <br />
<br />
[[Getting_Started_with_the_CoppeliaSim_Simulator|'''This page''']] contains information on getting started quickly with Coppelia. [[CoppeliaSim_Introduction|'''This page''']] contains a number of scenes that accept CSV file inputs for visualization of robot trajectories.<br />
<br />
===Python===<br />
<br />
<nowiki><br />
import numpy as np<br />
<br />
# Generate random 3x4 matrix of floats y, 3x1 vector of ints d<br />
y = np.random.rand(3, 4)<br />
d = np.random.randint(-100, 100, 3)<br />
<br />
# Open a file for output<br />
# Overwrite<br />
f = open("output.csv", "w") <br />
# Append<br />
#f = open("output.csv", "a")<br />
<br />
# For loop running 3 times to print each csv row<br />
for i in range(len(d)):<br />
output = " %10.6f, %10.6f, %10.6f, %10.6f, %d\n" % (y[i,0], y[i,1], y[i,2], y[i,3], d[i])<br />
f.write(output)<br />
<br />
# close file<br />
f.close()<br />
</nowiki><br />
<br />
The code below is a somewhat simpler version.<br />
<br />
<nowiki><br />
import numpy as np<br />
<br />
# Generate random 3x4 matrix of floats y, 3x1 vector of ints d<br />
y = np.random.rand(3, 4)<br />
d = np.random.randint(-100, 100, 3)<br />
<br />
# Set number precision<br />
y = np.round(y, 6)<br />
<br />
# Overwrite csv file<br />
np.savetxt("output.csv", np.asarray(np.c_[y, d]), delimiter = ",") <br />
</nowiki><br />
<br />
===MATLAB===<br />
<br />
<nowiki><br />
% Generate random 3x4 matrix of floats y, 3x1 vector of ints d<br />
y = rand(3, 4);<br />
d = randi([-100, 100], 3, 1);<br />
<br />
% Open a file for output<br />
% Overwrite<br />
f = fopen('output.csv', 'w');<br />
% Append<br />
%f = fopen('output.csv', 'a');<br />
<br />
% For loop running 3 times to print each csv row<br />
for i = 1: length(d)<br />
fprintf(f, ' %10.6f, %10.6f, %10.6f, %10.6f, %d\n', y(i, :), d(i));<br />
end<br />
<br />
% Close file<br />
fclose(f);<br />
</nowiki><br />
<br />
The code below is a somewhat simpler version.<br />
<br />
<nowiki><br />
% Generate random 3x4 matrix of floats y, 3x1 vector of ints d<br />
y = rand(3, 4);<br />
d = randi([-100, 100], 3, 1);<br />
<br />
% Set number precision<br />
y = round(y, 6);<br />
<br />
% Overwrite csv file<br />
csvwrite('output.csv', [y, d]);<br />
</nowiki><br />
<br />
===Mathematica===<br />
<br />
<nowiki><br />
(* Generate random 3x4 matrix of floats y,3x1 vector of ints d *)<br />
<br />
y = RandomReal[1, {3, 4}];<br />
d = RandomInteger[{-100, 100}, {3, 1}];<br />
<br />
(* Open a file for output *)<br />
(* Overwrite *)<br />
<br />
f = OpenWrite[FileNameJoin[{NotebookDirectory[], "output.csv"}]];<br />
(* Append *)<br />
(* \<br />
f=OpenAppend[FileNameJoin[{NotebookDirectory[],"output.csv"}]]; *)<br />
<br />
(* For loop running 3 times to print each csv row *)<br />
<br />
Do[WriteString[f, <br />
ExportString[{Flatten[{SetAccuracy[y[[i, ;;]], 6], d[[i]]}]}, <br />
"CSV"]], {i, Length[d]}];<br />
<br />
(* Close file *)<br />
Close[f];<br />
</nowiki><br />
<br />
The code below is a somewhat simpler version.<br />
<br />
<nowiki><br />
(* Generate random 3x4 matrix of floats y,3x1 vector of ints d *)<br />
<br />
y = RandomReal[1, {3, 4}];<br />
d = RandomInteger[{-100, 100}, {3, 1}];<br />
<br />
(* Set number precision *)<br />
y = SetAccuracy[y, 6];<br />
<br />
(* Overwrite csv file *)<br />
<br />
Export[FileNameJoin[{NotebookDirectory[], "output.csv"}], <br />
ArrayFlatten[{{y, d}}], "CSV"];<br />
</nowiki></div>Lynchhttp://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_CapstoneMobile Manipulation Capstone2020-01-25T07:47:37Z<p>Lynch: </p>
<hr />
<div>[[image:youbot-capstone.png|right|x250px]]<br />
<br />
This page describes the Capstone Project for the Coursera "Modern Robotics" Specialization. This project forms the sixth and final course: "Modern Robotics, Course 6: Capstone Project, Mobile Manipulation." This project draws on pieces of Courses 1 to 5. <br />
<br />
[https://youtu.be/Q1CekpBW6Js '''A video summary of this project is given in this YouTube video'''].<br />
<br />
Depending on your programming experience, this project should take approximately 20 hours, broken down into three intermediate milestones and your final submission.<br />
<br />
You should use the Modern Robotics code library to help you complete this project.<br />
<br />
== Introduction, and the CSV Mobile Manipulation youBot CoppeliaSim Scene ==<br />
<br />
In your capstone project, you will write software that plans a trajectory for the end-effector of the youBot mobile manipulator (a mobile base with four mecanum wheels and a 5R robot arm), performs odometry as the chassis moves, and performs feedback control to drive the youBot to pick up a block at a specified location, carry it to a desired location, and put it down. <br />
<br />
The final output of your software will be a comma-separated values (csv) text file that specifies the configurations of the chassis and the arm, the angles of the four wheels, and the state of the gripper (open or closed) as a function of time. This specification of the position-controlled youBot will then be "played" on the CoppeliaSim simulator to see if your trajectory succeeds in solving the task. [[Writing_a_CSV_File|'''This page''']] has information on writing csv files in Python, MATLAB, and Mathematica.<br />
<br />
'''[[Getting_Started_with_the_CoppeliaSim_Simulator|Make sure you have a working CoppeliaSim installation]]''' (from Course 1 of the [https://www.coursera.org/specializations/modernrobotics Coursera specialization]). [[CoppeliaSim_Introduction#Scene_6:_CSV_Mobile_Manipulation_youBot|'''This project uses Scene 6 (CSV Mobile Manipulation youBot) from the CoppeliaSim Introduction wiki page''']]. You should download it and test it with its sample csv file, to see what a solution looks like. (Even if you have downloaded it before, download it again before you begin your project, to make sure you have the most up-to-date version of this scene.) Leave the block's initial and goal configurations as the default. The default initial block configuration is at <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the final block configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Unlike previous projects, where we used CoppeliaSim to simply animate the robot's motion, in this project CoppeliaSim will use a physics simulator to simulate the interaction of the youBot with the block. In other words, if the gripper closes on the block in the wrong position or orientation, the block may simply slide out of the grasp. The interaction between the robot and the block is governed by a physics simulator, often called a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. CoppeliaSim has different physics engines which you can select, including Bullet and ODE, but ODE is the default for Scene 6.<br />
<br />
'''The time between each successive configuration in your csv file is 0.01 seconds (10 milliseconds).''' This is an important bit of information, since, unlike the previous visualization scenes which simply animated a csv file with no particular notion of time, the notion of time is critical in a dynamic simulation.<br />
<br />
A typical line of your csv file would be something like<br />
<br />
-0.75959, -0.47352, 0.058167, 0.80405, -0.91639, -0.011436, 0.054333, 0.00535, 1.506, -1.3338, 1.5582, 1.6136, 0<br />
<br />
i.e., thirteen values separated by commas, representing<br />
<br />
chassis phi, chassis x, chassis y, J1, J2, J3, J4, J5, W1, W2, W3, W4, gripper state<br />
<br />
where J1 to J5 are the arm joint angles and W1 to W4 are the four wheel angles.<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
Wheels 1 to 4 are numbered as shown in the image to the right. The ten angles (phi for the chassis, five arm joint angles, and four wheel angles) are in radians and the two chassis position coordinates (x,y) are in meters. A gripper state of 0 indicates that you want the gripper to be open, and a gripper state of 1 indicates that you want the gripper to be closed. In practice, the transition from open to closed (or from closed to open) takes up to 0.625 seconds, so any transition from 0 to 1, or 1 to 0, on successive lines in your csv file initiates an action (opening or closing) that will take some time to complete. You should keep the gripper state at the same value for 63 consecutive lines if you want to ensure that the opening/closing operation completes. An opening/closing operation terminates when a force limit is reached (e.g., an object is grasped) or the gripper has fully opened or closed.<br />
<br />
Your program will take as input:<br />
* the initial resting configuration of the cube object (which has a known geometry), represented by a frame attached to the center of the object<br />
* the desired final resting configuration of the cube object<br />
* the actual initial configuration of the youBot<br />
* the reference initial configuration of the youBot (which will generally be different from the actual initial configuration, to allow you to test feedback control)<br />
* optionally: gains for your feedback controller (or these gains can be hard-coded in your program)<br />
<br />
The output of your program will be:<br />
* a csv file which, when "played" through the CoppeliaSim scene, should drive the youBot to successfully pick up the block and put it down at the desired location<br />
* a data file containing the 6-vector end-effector error (the twist that would take the end-effector to the reference end-effector configuration in unit time) as a function of time <br />
<br />
Your solution must employ automated planning and control techniques from ''Modern Robotics''. It should not simply be a manually coded trajectory of the robot. Your solution should automatically go from the input to the output, with no other human intervention. In other words, it should automatically produce a working csv file even if the input conditions are changed.<br />
<br />
[[image:capstone-traj1.png|right|150px]]<br />
[[image:capstone-traj2.png|right|150px]]<br />
[[image:capstone-traj3.png|right|150px]]<br />
[[image:capstone-traj4.png|right|150px]]<br />
[[image:capstone-traj5.png|right|150px]]<br />
[[image:capstone-traj6.png|right|150px]]<br />
[[image:capstone-traj7.png|right|150px]]<br />
[[image:capstone-traj8.png|right|150px]]<br />
<br />
In your software, you should piece together a reference trajectory for the gripper of the robot, which the robot is then controlled to follow. A typical reference trajectory would consist of the following eight segments, as illustrated in the eight images to the right (click on any image to make it larger):<br />
<br />
# A trajectory to move the gripper from its initial configuration to a "standoff" configuration a few cm above the block.<br />
# A trajectory to move the gripper down to the grasp position.<br />
# Closing of the gripper.<br />
# A trajectory to move the gripper back up to the "standoff" configuration.<br />
# A trajectory to move the gripper to a "standoff" configuration above the final configuration.<br />
# A trajectory to move the gripper to the final configuration of the object.<br />
# Opening of the gripper.<br />
# A trajectory to move the gripper back to the "standoff" configuration.<br />
<br />
Segments 3 and 7 each keep the end-effector fixed in space but, at the beginning of the segment, change the state of the gripper from 0 to 1 or 1 to 0, waiting for the gripper closing to complete. In other words, each of these segments would consist of at least 63 identical lines of the csv file (as described above), where the first line of the sequence of identical lines has a gripper state different from the previous line in the csv file, to initiate the opening or closing.<br />
<br />
Segments 2, 4, 6, and 8 are simple up or down translations of the gripper of a fixed distance. Good trajectory segments would be cubic or quintic polynomials taking a reasonable amount of time (e.g., one second). <br />
<br />
Trajectory segments 1 and 5 are longer motions requiring motion of the chassis. Segment 1 is calculated from the desired initial configuration of the gripper to the first standoff configuration, and segment 5 is calculated from the first standoff configuration to the second standoff configuration. The gripper trajectories could correspond to constant screw motion paths or decoupled Cartesian straight-line motion plus rotational motion, time scaled by third- or fifth-order polynomials (Chapter 9). <br />
<br />
Once the entire gripper reference trajectory has been pieced together from the 8 segments, the actual trajectory of the youBot is obtained by using a Jacobian pseudoinverse position controller as described in Chapter 13.5. Starting from the actual initial robot configuration (which has some error from the beginning of reference segment 1), your controller drives the gripper to converge to the reference trajectory. Your feedback controller should eliminate initial error before the gripper attempts to grasp the block, to avoid failure.<br />
<br />
To simulate the effect of feedback control, you must write your own motion simulator. For each timestep, you take the initial configuration of the robot and the wheel and joint speeds calculated by your controller and numerically integrate the effect of these speeds over a timestep to get the new robot configuration. To calculate the new configuration of the chassis due to the wheel motions, you must implement an odometry step (Chapter 13.4).<br />
<br />
<br clear=all><br />
<br />
== Kinematics of the youBot ==<br />
<br />
The images to the right illustrate the youBot. Click on them to make them bigger. The description below is consistent with Exercise 13.33 from the book, if you prefer to see the information there. All distances are in meters and all angles are in radians.<br />
<br />
[[image:Yb-book.png|right|500px|thumb|This figure illustrates the arm at its home configuration (all joint angles zero) and the frames {s}, {b}, {0}, and {e}. For the image on the right, joint axes 1 and 5 (not shown) point upward and joint axes 2, 3, and 4 are out of the screen. Click to make the image bigger.]]<br />
<br />
[[image:Yb-base-capstone.png|right|300px|thumb|A top view of the omnidirectional mobile base. The forward-backward distance between the wheels is <math>2l = 0.47</math> meters and the side-to-side distance between wheels is <math>2w = 0.3</math> meters. The radius of each wheel is <math>r = 0.0475</math> meters. The forward driving and "free sliding" direction <math>\gamma</math> of each wheel is indicated.]]<br />
<br />
[[image:Youbot-gripper.png|right|300px|thumb|The gripper and the end-effector frame {e}, which has an origin midway between the fingers of the gripper. The minimum opening distance of the gripper is <math>d_{1,\text{min}} = 2</math> cm, the maximum opening distance is <math>d_{1,\text{max}} = 7</math> cm, the interior length of the fingers is <math>d_{2} = 3.5</math> cm, and the distance from the base of the fingers to the frame {e} is <math>d_{3} = 4.3</math> cm. The axis <math>\hat{\text{x}}_{\text{e}}</math> is into the screen.]]<br />
<br />
[[image:Block-capstone.png|right|300px|thumb|The object being manipulated is a cube, 5 cm x 5 cm x 5 cm. The cube's frame {c} is at its center, and the axes are aligned with the edges of the cube.]]<br />
<br />
The configuration of the frame {b} of the mobile base, relative to the frame {s} on the floor, is described by the 3-vector <math>q = (\phi,x,y)</math> or the <math>SE(3)</math> matrix<br />
<br />
<math> T_{sb}(q) = \left[\begin{array}{cccc} \cos \phi & -\sin \phi & 0 & x \\ \sin \phi & \cos \phi & 0 & y \\ 0 & 0 & 1 & 0.0963 \\ 0 & 0 & 0 & 1 \end{array}\right]</math><br />
<br />
where <math>z = 0.0963</math> meters is the height of the {b} frame above the floor. The forward-backward distance between the wheels is <math>2l = 0.47</math> meters and the side-to-side distance between wheels is <math>2w = 0.3</math> meters. The radius of each wheel is <math>r = 0.0475</math> meters. The wheel numbering and forward driving and "free sliding" direction <math>\gamma</math> of each wheel is indicated in the figures.<br />
<br />
The fixed offset from the chassis frame {b} to the base frame of the arm {0} is<br />
<br />
<math> T_{b0}= \left[\begin{array}{cccc} 1 & 0 & 0 & 0.1662 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0.0026 \\ 0 & 0 & 0 & 1 \end{array}\right].</math><br />
<br />
When the arm is at its home configuration (all joint angles zero, as shown in the figure), the end-effector frame {e} relative to the arm base frame {0} is<br />
<br />
<math> M_{0e}= \left[\begin{array}{cccc} 1 & 0 & 0 & 0.033 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0.6546 \\ 0 & 0 & 0 & 1 \end{array}\right].</math><br />
<br />
When the arm is at its home configuration, the screw axes <math>\mathcal{B}</math> for the five joints are expressed in the end-effector frame {e} as<br />
# <math>\mathcal{B}_1 = (\omega_1,v_1)</math> where <math>\omega_1 = (0,0,1), \; v_1 = (0,0.033,0)</math><br />
# <math>\mathcal{B}_2 = (\omega_2,v_2)</math> where <math>\omega_2 = (0,-1,0), \; v_2 = (-0.5076,0,0)</math><br />
# <math>\mathcal{B}_3 = (\omega_3,v_3)</math> where <math>\omega_3 = (0,-1,0), \; v_3 = (-0.3526,0,0)</math><br />
# <math>\mathcal{B}_4 = (\omega_4,v_4)</math> where <math>\omega_4 = (0,-1,0), \; v_4 = (-0.2176,0,0)</math><br />
# <math>\mathcal{B}_5 = (\omega_5,v_5)</math> where <math>\omega_5 = (0,0,1), \; v_5 = (0,0,0)</math><br />
<br />
In this project, for simplicity '''we assume no joint limits on the five joints of the robot arm.''' It is recommended, however, that you choose limits on the wheel and joint velocities. We will come back to this issue later.<br />
<br />
The end-effector frame {e} is rigidly attached to the last link and is midway between the tips of the gripper fingers. The minimum opening distance of the gripper is <math>d_{1,\text{min}} = 2</math> cm (i.e., the fingers cannot fully close; they can only get within 2 cm of each other), the maximum opening distance is <math>d_{1,\text{max}} = 7</math> cm, the interior length of the fingers is <math>d_{2} = 3.5</math> cm, and the distance from the base of the fingers to the frame {e} is <math>d_{3} = 4.3</math> cm. When the gripper closes, it closes until it reaches its minimum closing distance or encounters a force large enough to prevent further closing.<br />
<br />
The object being manipulated is a cube, 5 cm x 5 cm x 5 cm. The cube's frame {c} is at the center of the cube, and the axes are aligned with the edges of the cube. The default initial configuration of the cube is at (x, y, z) = (1, 0, 0.025 ) m in the space frame {s}, and the axes of {c} are aligned with {s}. The default desired final configuration of the cube is at (x, y, z) = (0, -1, 0.025) m and the axes of {c} are rotated by <math>-\pi/2</math> radians about the <math>\hat{\text{z}}_{\text{s}}</math>-axis of {s}. These are written in <math>SE(3)</math> as<br />
<br />
<math>T_{sc,\text{initial}} = \left[\begin{array}{cccc} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0.025 \\ 0 & 0 & 0 & 1\end{array} \right] </math><br />
<br />
<math>T_{sc,\text{goal}} = \left[\begin{array}{cccc} 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0.025 \\ 0 & 0 & 0 & 1\end{array} \right].<br />
</math><br />
<br />
Both the initial and final configurations of the cube can be altered in the CoppeliaSim scene. (You can only alter the (x,y) position and the orientation of the cube about the <math>\hat{\text{z}}_{\text{s}}</math>-axis.) A good choice for the "standoff" configuration before moving down to the cube and moving back up (the ends of trajectories 1, 4, 5, and 8) is to have the {e} frame a few cm above the {c} frame.<br />
<br />
<br clear=all><br />
<br />
== Some Background on Dynamic Simulations in CoppeliaSim ==<br />
<br />
''This section contains more information about how the CoppeliaSim simulation works. It contains more details than you need for the final project. You may skip this section and go directly to [[Mobile_Manipulation_Capstone#Milestones_and_Details|Milestones and Details]].''<br />
<br />
The CoppeliaSim scene used for the capstone project (Scene 6, CSV Mobile Manipulation youBot) is the first scene in which we've used CoppeliaSim's ability to simulate bodies in contact. A "physics engine" (sometimes called a "game engine," since such simulators are often used in video games) simulates the motions of bodies when forces are applied to them, and when they make contact or collide with each other. Physics engines also handle articulated bodies with joints and other constraints.<br />
<br />
CoppeliaSim does not have its own physics engine; instead, it bundles and makes available several different physics engines, including Bullet, ODE, Vortex, and Newton. While these simulators have many features in common, they each have their own strengths and weaknesses, and none is perfect. A simulator must detect collisions and contacts, simulate restitution ("bounciness") and friction, employ numerical integration to take timesteps to advance the simulation, etc. All of these are approximate operations with a variety of "magic numbers" and error tolerances, with the goal of making the simulations physically realistic without consuming too much CPU time.<br />
<br />
As a result of these approximations, you can often observe bizarre behavior, such as an object spontaneously beginning to bounce on the floor. In this capstone project, the unexpected behavior may be the object slipping out of the grasp. These are just realities of dynamic simulation, and it is beyond the scope of this project to delve into the details of dynamic simulation. If you would like to learn more, you can check out the documentation for [http://www.ode.org/ ODE] and [http://bulletphysics.org/wordpress/ Bullet].<br />
<br />
For block grasping, we have found ODE to give the best results, so that is the default physics engine when you open Scene 6.<br />
<br />
=== Rigid Bodies in Scene 6 ===<br />
<br />
In CoppeliaSim, each rigid body is classified as either '''respondable''' or '''non-respondable''':<br />
* '''respondable''': The body can make contact and collide with other bodies.<br />
* '''non-respondable''': The body can pass through other bodies.<br />
Thus if a respondable body and a non-respondable body overlap, or if two non-respondable bodies overlap, there is no collision. If two respondable bodies make contact, however, forces will keep them from penetrating each other.<br />
<br />
'''In Scene 6, only the floor, the gripper fingers, and the cube are respondable. All other bodies are non-respondable.''' This means, for example, that the robot can drive over the cube, and the cube will never move. (The chassis and wheels do not interact with the cube.) This also means that the youBot's arm can intersect the mobile base, or arm links can intersect each other. This is unrealistic, of course, but we are focusing on the interaction of the cube with the gripper and the floor. <br />
<br />
[[image:cube_dynamic_properties.png|right|x250px]]<br />
In addition, each rigid body can be classified as '''dynamic''' or '''non-dynamic''':<br />
* '''dynamic''': The body has mass and inertial properties that are used to compute its motion. For example, as shown in the image to the right, you can click on "Cuboid_initial" to learn about the mass properties of the cube in Scene 6. You can also learn about material properties, like "friction values." (The simulated friction coefficient of two bodies in contact is calculated as the product of the friction values of the two materials. This is a simple, but non-physical, way to come up with a friction coefficient for two bodies in contact without having to specify a friction coefficient for every possible pair of materials in contact.)<br />
* '''non-dynamic''': The body's motion is not computed according to dynamics computed by the physics engine.<br />
<br />
'''In Scene 6, only the gripper fingers and the cube are dynamic.''' In other words, the motions of the fingers and the cube are computed according to the physics engine; other bodies are not part of the dynamic simulation.<br />
<br />
<br clear=all><br />
<br />
=== Joints in Scene 6 ===<br />
<br />
In Scene 6, each joint is either in '''torque/force mode''' or '''passive mode''':<br />
* '''torque/force mode''': In torque/force mode, the motion of the joint is controlled by a torque or force applied by an actuator, possibly governed by a PID control law, for example.<br />
* '''passive mode''': In this mode, the joint is kinematically controlled to go to specified positions, without reference to forces or torques.<br />
<br />
'''In Scene 6, all joints are in passive mode, except for the two joints controlling the gripper motion.''' All passive joints kinematically follow the motions commanded in the csv file.<br />
<br />
All joint limits for the youBot's 5R arm are disabled in Scene 6. This is unrealistic, but respecting joint limits is not part of this capstone project.<br />
<br />
=== Gripper ===<br />
<br />
The gripper fingers have joint limits: each finger of the gripper can travel 2.5 cm. At maximum opening, the distance between the fingers is 7 cm, and at maximum closing the distance is 2 cm. The gripper fingers are controlled to always be opening (until force limits are reached or the maximum inter-finger distance is obtained) or always closing (until force limits are reached, as when closed on the cube, or the minimum inter-finger distance is obtained). <br />
<br />
=== Running Your Solution in Scene 6 ===<br />
<br />
When you load your csv file into Scene 6 for the first time and press "Play File," the robot will jump to its starting configuration, pause for a second, and then begin executing your csv file. When it jumps like this, the "passive mode" joints are repositioned immediately, but the "torque/force mode" joints (for the gripper fingers) take time to be repositioned. So you may see some weird behavior as the gripper fingers reposition themselves in the initial fraction of a second when you run your csv file the first time. If you don't like this, then just run the csv file a second time. The robot will have been repositioned to the starting point of the csv file before you press "Play File," so the gripper will not have to reposition itself. <br />
<br />
<br clear=all><br />
<br />
== Milestones and Details ==<br />
<br />
Your solution to this project will be a fairly complex piece of software. To help you structure the project, and to allow you to test individual pieces of your solution, the project has three milestones before you finally complete the project. You do not turn in your solutions to these milestone subprojects; you only turn in your final project.<br />
<br />
=== Milestone 1: youBot Kinematics Simulator and csv Output ===<br />
<br />
You will write a simulator for the kinematics of the youBot. The main function in the simulator, let's call it <tt>NextState</tt>, is specified by the following inputs and outputs: <br />
<br />
'''Input:'''<br />
* A 12-vector representing the current configuration of the robot (3 variables for the chassis configuration, 5 variables for the arm configuration, and 4 variables for the wheel angles).<br />
* A 9-vector of controls indicating the arm joint speeds <math>\dot{\theta}</math> (5 variables) and the wheel speeds <math>u</math> (4 variables).<br />
* A timestep <math>\Delta t</math>.<br />
* A positive real value indicating the maximum angular speed of the arm joints and the wheels. For example, if this value is 12.3, the angular speed of the wheels and arm joints is limited to the range [-12.3 radians/s, 12.3 radians/s]. Any speed in the 9-vector of controls that is outside this range will be set to the nearest boundary of the range. If you don't want speed limits, just use a very large number. If you prefer, your function can accept separate speed limits for the wheels and arm joints.<br />
<br />
'''Output:''' A 12-vector representing the configuration of the robot time <math>\Delta t</math> later.<br />
<br />
The function <tt>NextState</tt> is based on a simple first-order Euler step, i.e.,<br />
* new arm joint angles = (old arm joint angles) + (joint speeds) * <math> \Delta t</math><br />
* new wheel angles = (old wheel angles) + (wheel speeds) * <math>\Delta t</math><br />
* new chassis configuration is obtained from odometry, as described in Chapter 13.4<br />
<br />
'''Testing the <tt>NextState</tt> function:''' To test your <tt>NextState</tt> function, you should embed it in a program that takes an initial configuration of the youBot and simulates constant controls for one second. For example, you can set <math>\Delta t</math> to 0.01 seconds and run a loop that calls <tt>NextState</tt> 100 times with constant controls <math>(u,\dot{\theta})</math>. Your program should write a csv file, where each line has 13 values separated by commas (the 12-vector consisting of 3 chassis configuration variables, the 5 arm joint angles, and the 4 wheel angles, plus a "0" for "gripper open") representing the robot's configuration after each integration step. Then you should load the csv file into the CSV Mobile Manipulation youBot CoppeliaSim scene and watch the animation of the constant controls to see if your <tt>NextState</tt> function is working properly (and to check your ability to produce a csv file).<br />
<br />
[[Writing_a_CSV_File|'''This page''']] has information on writing csv files in Python, MATLAB, and Mathematica.<br />
<br />
'''Sample controls to try:''' Simulate the following controls for 1 second and watch the results in the CoppeliaSim capstone scene (Scene 6). The controls below are only for the wheels; you can choose the arm joint speeds as you wish.<br />
# <math>u = (10,10,10,10)</math>. The robot chassis should drive forward (in the <math>+\hat{\text{x}}_{\text{b}}</math> direction) by 0.475 meters.<br />
# <math>u = (-10,10,-10,10)</math>. The robot chassis should slide sideways in the <math>+\hat{\text{y}}_{\text{b}}</math> direction by 0.475 meters.<br />
# <math>u = (-10,10,10,-10)</math>. The robot chassis should spin counterclockwise in place by 1.234 radians.<br />
<br />
If the chassis motion is not what is described, then something is wrong with your implementation of odometry. If you are uncertain that your wheel motions and chassis motions correspond to each other, you can check out the five basic mobile base motions shown in a .zip file in [[CoppeliaSim_Introduction#Scene_4:_CSV_Animation_youBot|the CSV Animation youBot scene]].<br />
<br />
You should also check that your wheel angles and arm joint angles are being updated properly, too, but this should be easy.<br />
<br />
You should also try specifying a speed limit of 5 for the joints and wheels, then try the same tests above. Since your commanded controls exceed the speed limit, your function should properly restrict the actual speeds executed by the wheels and joints to the range [-5, 5]. As a result, the chassis should only move half the distance in these tests.<br />
<br />
'''Review material:''' This capstone project builds on material throughout the textbook "Modern Robotics: Mechanics, Planning, and Control." '''[[Modern Robotics|Click here for links to the preprint version of the textbook and the videos.]]''' Particularly relevant to this milestone are the following chapters and their associated videos:<br />
* [https://youtu.be/NcOT9hOsceE '''Chapter 13.2: Omnidirectional Wheeled Mobile Robots (Part 1 of 2)'''] (6:02)<br />
* [https://youtu.be/B1K-ti5Lqjc '''Chapter 13.2: Omnidirectional Wheeled Mobile Robots (Part 2 of 2)'''] (3:00)<br />
* [https://youtu.be/eQ9E0Zvp9jw '''Chapter 13.4: Odometry'''] (4:32)<br />
<br />
=== Milestone 2: Reference Trajectory Generation ===<br />
<br />
For this milestone you will write a function <tt>TrajectoryGenerator</tt> to generate the reference trajectory for the end-effector frame {e}. This trajectory consists of eight concatenated trajectory segments, as described above. Each trajectory segment begins and ends at rest.<br />
<br />
'''Input:'''<br />
* The initial configuration of the end-effector in the reference trajectory: <math>T_{se,\text{initial}}</math>.<br />
* The cube's initial configuration: <math>T_{sc,\text{initial}}</math>.<br />
* The cube's desired final configuration: <math>T_{sc,\text{final}}</math>.<br />
* The end-effector's configuration relative to the cube when it is grasping the cube: <math>T_{ce,\text{grasp}}</math>.<br />
* The end-effector's standoff configuration above the cube, before and after grasping, relative to the cube: <math>T_{ce,\text{standoff}}</math>. This specifies the configuration of the end-effector {e} relative to the cube frame {c} before lowering to the grasp configuration <math>T_{ce,\text{grasp}}</math>, for example. <br />
* The number of trajectory reference configurations per 0.01 seconds: <math>k</math>. The value <math>k</math> is an integer with a value of 1 or greater. Although your final animation will be based on snapshots separated by 0.01 seconds in time, the points of your reference trajectory (and your controller servo cycle) can be at a higher frequency. For example, if you want your controller to operate at 1000 Hz, you should choose <math>k=10</math> (10 reference configurations, and 10 feedback servo cycles, per 0.01 seconds). It is fine to choose <math>k=1</math> if you'd like to keep things simple.<br />
<br />
'''Outputs:'''<br />
* A representation of the <math>N</math> configurations of the end-effector along the entire concatenated eight-segment reference trajectory. Each of these <math>N</math> reference points represents a transformation matrix <math>T_{se}</math> of the end-effector frame {e} relative to {s} at an instant in time, plus the gripper state (0 or 1). For example, if your entire eight-segment trajectory takes 30 seconds, for example, you will have approximately <math>N \approx 30k/0.01</math> sequential reference configurations (perhaps one or a few more, depending on how you treat boundary conditions), each separated by <math>0.01/k</math> seconds in time. These reference configurations will be used by your controller. Your representation of the reference configurations could be anything you want. If you use an <math>N \times 13</math> matrix, for example, each of the <math>N</math> rows would represent a configuration of the end-effector frame {e} relative to {s} at that instant in time. Twelve of the 13 entries of a matrix row are the top three rows of the transformation matrix <math>T_{se}</math> at that instant of time, i.e., <math>r_{11}, r_{12}, r_{13}, r_{21}, r_{22}, r_{23}, r_{31}, r_{32}, r_{33}, p_x, p_y, p_z</math> from <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right], </math> <br />
<br />
and the 13th entry is the gripper state: 0 = open, 1 = closed. Keep in mind that opening and closing the gripper takes up to 1 second (initiated when the gripper state transitions from 0 to 1, or 1 to 0, in your csv file), so the trajectories involving opening and closing the gripper should keep the {e} frame stationary while the gripper completes its motion.<br />
<br />
* A csv file with the entire eight-segment reference trajectory. Each line of the csv file corresponds to one configuration <math>T_{se}</math> of the end-effector, expressed as 13 variables separated by commas. The 13 variables are, in order,<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
It is up to you to determine the duration of each trajectory segment, but it is recommended that each segment's duration be an integer multiple of 0.01 seconds. You could automatically choose the duration of each trajectory segment to be equal to the maximum of: the distance the origin of the {e} frame has to travel divided by some reasonable maximum linear velocity of the end-effector, and the angle the {e} frame must rotate divided by some reasonable maximum angular velocity of the end-effector. The duration of each trajectory should not be so short as to require unreasonable joint and wheel speeds.<br />
<br />
Your <tt>TrajectoryGenerator</tt> function is likely to use either <tt>ScrewTrajectory</tt> or <tt>CartesianTrajectory</tt>, from the Modern Robotics code library, to generate the individual trajectory segments. <br />
<br />
'''Testing your function:''' We have created a [[CoppeliaSim_Introduction#Scene_8:_CSV_youBot_End-Effector_Animation|'''CoppeliaSim scene (Scene 8)''']] to help you test your <tt>TrajectoryGenerator</tt> function. This scene reads in your csv file and animates it, showing how the end-effector frame moves as a function of time. You should verify that your <tt>TrajectoryGenerator</tt> works as you expect before moving on with the project. [https://youtu.be/8d_cYwV58lI '''This video shows an example of a typical output of your trajectory generator function, as animated by CoppeliaSim Scene 8'''].<br />
<br />
'''Review material:''' This capstone project builds on material throughout the textbook "Modern Robotics: Mechanics, Planning, and Control." '''[[Modern Robotics|Click here for links to the preprint version of the textbook and the videos.]]''' Particularly relevant to this milestone are the following chapters and their associated videos:<br />
* [https://youtu.be/1JRMqfEm79c '''Chapters 9.1 and 9.2: Point-to-Point Trajectories (Part 1 of 2)'''] (5:40)<br />
* [https://youtu.be/0ZqeBEa_MWo '''Chapters 9.1 and 9.2: Point-to-Point Trajectories (Part 2 of 2)'''] (3:07)<br />
<br />
=== Milestone 3: Feedforward Control ===<br />
<br />
Now that you are able to simulate the motion of the robot and generate a reference trajectory for the end-effector, you are ready to begin experimenting with feedback control of the mobile manipulator. You will write the function <tt>FeedbackControl</tt> to calculate the kinematic task-space feedforward plus feedback control law, written both as Equation (11.16) and (13.37) in the textbook:<br />
<br />
<math><br />
\mathcal{V}(t) = [\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d(t) + K_p X_{\text{err}}(t) + K_i \int_0^t X_{\text{err}}(\text{t}) d\text{t}.<br />
</math><br />
<br />
'''Input:''' <br />
* The current ''actual'' end-effector configuration <math>X</math> (also written <math>T_{se}</math>).<br />
* The current end-effector ''reference'' configuration <math>X_{d}</math> (i.e., <math>T_{se,d}</math>).<br />
* The end-effector ''reference'' configuration at the next timestep in the reference trajectory, <math>X_{d,\text{next}}</math> (i.e., <math>T_{se,d,\text{next}}</math>), at a time <math>\Delta t</math> later.<br />
* The PI gain matrices <math>K_p</math> and <math>K_i</math>.<br />
* The timestep <math>\Delta t</math> between reference trajectory configurations.<br />
<br />
'''Output:'''<br />
* The commanded end-effector twist <math>\mathcal{V}</math> expressed in the end-effector frame {e}.<br />
<br />
To calculate the control law <tt>FeedbackControl</tt>, we need the current actual end-effector configuration <math>X(q,\theta)</math>, a function of the chassis configuration <math>q</math> and the arm configuration <math>\theta</math>. The values <math>(q, \theta)</math> come directly from the simulation results (Milestone 1). In other words, assume perfect sensors.<br />
<br />
The error twist <math>X_{\text{err}}</math> that takes <math>X</math> to <math>X_{d}</math> in unit time is extracted from the 4x4 <math>se(3)</math> matrix <math>[X_{\text{err}}] = \log (X^{-1} X_{d})</math>. <tt>FeedbackControl</tt> also needs to maintain an estimate of the integral of the error, e.g., by adding <math>X_{\text{err}} \Delta t</math> to a running total at each timestep. The feedforward reference twist <math>\mathcal{V}_d</math> that takes <math>X_{d}</math> to <math>X_{d,\text{next}}</math> in time <math>\Delta t</math> is extracted from <math>[\mathcal{V}_d] = (1/\Delta t) \log(X_{d}^{-1} X_{d,\text{next}})</math>. (Make sure you understand why the factor <math>(1/\Delta t)</math> is there!)<br />
<br />
The output of <tt>FeedbackControl</tt> is the commanded end-effector twist <math>\mathcal{V}</math> expressed in the end-effector frame {e}. To turn this into commanded wheel and arm joint speeds <math>(u,\dot{\theta})</math>, we use the pseudoinverse of the mobile manipulator Jacobian <math>J_e(\theta)</math>,<br />
<br />
<math><br />
\left[\begin{array}{c} u \\ \dot{\theta} \end{array} \right] = J_e^\dagger(\theta) \mathcal{V}.<br />
</math><br />
<br />
[[image:Yb-fbtest-new.png|right|500px|thumb|This figure illustrates a test for your <tt>FeedbackControl</tt> and Jacobian pseudoinverse functions. The current robot configuration <math>(q,\theta)</math> is shown, as well as the current end-effector configuration <math>X</math>, the current reference end-effector configuration <math>X_d</math>, and the reference end-effector configuration <math>X_{d,\text{next}}</math> a time <math>\Delta t</math> later.]]<br />
<br />
'''Testing your <tt>FeedbackControl</tt> function and your Jacobian pseudoinverse:''' Before moving on, it is a good idea to confirm that you are correctly calculating <math>\mathcal{V}</math> and the controls <math>(u,\dot{\theta})</math> using the Jacobian pseudoinverse. Here are some test inputs you should try:<br />
<br />
* robot configuration: <math>(\phi, x, y, \theta_1, \theta_2, \theta_3, \theta_4, \theta_5) = (0, 0, 0, 0, 0, 0.2, -\!1.6, 0)</math>, as illustrated in the figure to the right. In other words, all configuration variables are zero except arm joint angle 3, which is 0.2 radians, and arm joint angle 4, which is -1.6 radians.<br />
* <math>X_d = \left[\begin{array}{cccc} 0 & 0 & 1 & 0.5 \\ 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & 0.5 \\ 0 & 0 & 0 & 1\end{array}\right]</math><br />
* <math>X_{d,\text{next}} = \left[\begin{array}{cccc} 0 & 0 & 1 & 0.6 \\ 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & 0.3 \\ 0 & 0 & 0 & 1\end{array}\right]</math><br />
* <math>X = \left[\begin{array}{cccc} 0.170 & 0 & 0.985 & 0.387 \\ 0 & 1 & 0 & 0 \\ -0.985 & 0 & 0.170 & 0.570 \\ 0 & 0 & 0 & 1\end{array}\right]</math> (this is calculated from the robot configuration given above)<br />
* <math>K_p</math> and <math>K_i</math> matrices are zero matrices<br />
* <math>\Delta t = 0.01</math><br />
<br />
With these inputs, your program should give you<br />
<br />
* <math>\mathcal{V}_d = (0,0,0,20,0,10)</math><br />
* <math>[\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d = (0,0,0,21.409,0,6.455)</math><br />
* <math>\mathcal{V} = (0,0,0,21.409,0,6.455)</math><br />
* <math>X_{\text{err}} \, = (0,0.171,0,0.080,0,0.107)</math><br />
* increment to the numerical integral of the error should be <math>X_{\text{err}} * \Delta t</math><br />
* <math>J_e = \left[\begin{array}{ccccccccc} 0.030 & -0.030 & -0.030 & 0.030 & -0.985 & 0 & 0 & 0 & 0 \\<br />
0 & 0 & 0 & 0 & 0 & -1 & -1 & -1 & 0 \\<br />
-0.005 & 0.005 & 0.005 & -0.005 & 0.170 & 0 & 0 & 0 & 1 \\<br />
0.002 & 0.002 & 0.002 & 0.002 & 0 & -0.240 & -0.214 & -0.218 & 0 \\<br />
-0.024 & 0.024 & 0 & 0 & 0.221 & 0 & 0 & 0 & 0 \\<br />
0.012 & 0.012 & 0.012 & 0.012 & 0 & -0.288 & -0.135 & 0 & 0 \end{array}\right]</math><br />
* <math>(u,\dot{\theta}) = (157.2,157.2,157.2,157.2,0,-652.9,1398.6,-745.7,0)</math><br />
<br />
Looking at the figure, these results should make sense to you. The feedforward twist <math>\mathcal{V}_d</math>, from <math>X_d</math> to <math>X_{d,\text{next}}</math>, should only have nonzero linear components, since the orientation of both frames is the same; these linear components should be in the x and z directions of the <math>X_d</math> frame; and the component in the x direction should be larger. Expressing this twist in the current frame of the end-effector at <math>X</math>, <math>[\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d</math>, shows us that there are still only x and z components, but the component in the <math>X</math> frame's x direction is a bit larger and the component in the z direction is a bit smaller. Since the feedback gains are zero, the commanded twist <math>\mathcal{V}</math> is just <math>[\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d</math>. The error <math>X_{\text{err}}</math> (from <math>X</math> to <math>X_d</math>) shows us that, to drive <math>X</math> to <math>X_d</math>, we must rotate in the positive direction about <math>\hat{\text{y}}_{\text{e}}</math> and move linearly in the <math>\hat{\text{x}}_{\text{e}}</math> and <math>\hat{\text{z}}_{\text{e}}</math> directions. Finally, the calculated controls <math>u</math> drive the wheels forward at equal speed (so the chassis translates forward) and only arm joints 2, 3, and 4 rotate, since joints 1 and 5 do not help generate <math>\mathcal{V}</math>. '''Note: The joint speeds in this illustrative example are unreasonably large!'''<br />
<br />
If your <math>K_p</math> matrix is the identity matrix instead of zero, then you should get <math>\mathcal{V} = (0,0.171,0,21.488,0,6.562)</math> and <math>(u,\dot{\theta}) = (157.5,157.5,157.5,157.5,0,-654.3,1400.9,-746.8,0)</math>. <br />
<br />
If you don't get these results, you should correct your program before moving on.<br />
<br />
'''Singularities:''' If the 6x9 Jacobian matrix <math>J_e</math> is singular (i.e., its rank drops below 6) or nearly singular, the pseudoinverse algorithm may generate a pseudoinverse <math>J_e^\dagger</math> with unreasonably large entries, which could lead to unacceptably large commanded joint speeds if we ask for even a very small component of a twist in a direction that the near-singularity nearly prevents. A better behavior for the robot would be to essentially ignore any requested twist components in directions that the near-singularity renders difficult to achieve. To achieve this in MATLAB and Mathematica, you may wish to explore the tolerance options for the pseudoinverse algorithm. The tolerance option allows you to specify how close to zero a singular value must be to be treated as zero. By treating small singular values (that are greater than the default tolerance) as zero, you will avoid having pseudoinverse matrices with unreasonably large entries. A MATLAB example is shown below:<br />
<br />
>> M = [[2,0];[0,0.00001]] % a matrix that's nearly singular<br />
M =<br />
2.000000 0<br />
0 0.000010<br />
<br />
>> s = svd(M) % confirming that the singular values are 2 and 1e-5, i.e., the 2nd singular value is very small<br />
s =<br />
2.000000<br />
0.000010<br />
<br />
>> Mp = pinv(M) % the default MATLAB pseudoinverse treats the 2nd singular value as nonzero; Mp has nonzero entries of 0.5 and 100,000<br />
Mp =<br />
1.0e+05 *<br />
0.000005 0<br />
0 1.000000<br />
<br />
>> Mptol = pinv(M,1e-4) % tell pinv to treat singular values less than 0.0001 as zero; Mptol has no large entries<br />
Mptol =<br />
0.500000 0<br />
0 0<br />
<br />
(You may find it better to use an even larger tolerance than 1e-4, e.g., 1e-3 or 1e-2. Experiment!) <br />
In any case, you should always place "reasonable" limits on the maximum speeds for the robot joints and wheels, to mimic the limitations of a real robot and to prevent the simulated robot from moving wildly. Other methods have been proposed in the robotics literature to deal with the nearly-singular-Jacobian issue. Feel free to experiment with other methods if you wish.<br />
<br />
'''Why does the robot arm always seem to approach a singularity?''' You may notice that your controller tends to make the robot arm approach a singularity (e.g., straighten out) before the wheels move much to help move the end-effector. Why do you think this is? Think about the properties of the pseudoinverse. How does it extract a single solution <math>x = A^\dagger b</math> to the equation <math> Ax = b</math> when there are many solutions <math>x</math>? How would things change if the wheels had a much larger radius?<br />
<br />
'''Implementing joint limits to avoid self-collisions and singularities (optional, but recommended):''' Until now, we have not implemented joint limits, so you can easily command robot configurations that result in self-collision, i.e., the arm links intersect each other or the mobile base. You can also command the robot arm to come close to a singularity, e.g., by making the angles of joints 3 and 4 zero (or nearly zero). Singularities like this can cause a problem when you are tracking trajectories specified in terms of the motion of the end-effector (see the discussion above).<br />
<br />
To avoid these problems, you can implement joint limits. For example, you could constrain joints 3 and 4 to always be less than <math>-0.2</math> radians (or so). The arm will avoid singularities occurring when joints 3 or 4 are at the zero angle, but it will still be able to perform many useful tasks, such as the block pick-and-place task of this capstone. To avoid self-collisions, you can use the arm joint angle sliders in [[CoppeliaSim_Introduction#Scene_3:_Interactive_youBot|Scene 3: Interactive youBot]] to approximately find the joint-angle combinations that avoid self-collision. Your approximation should be conservative, meaning that allowed configurations are never in self-collision. But it should not be so conservative that the arm's workspace is overly constrained, preventing the robot from doing useful work. <br />
<br />
With these joint limits, you could write a function called <tt>testJointLimits</tt> to return a list of joint limits that are violated given the robot arm's configuration <math>\theta</math>.<br />
<br />
You should make sure that your robot's initial configuration satisfies all the joint limits. Then, each time you calculate your wheel and arm joint speeds <math>(u,\dot{\theta})</math> using the pseudoinverse <math>J_e^\dagger</math>, use <tt>testJointLimits</tt> to check if the new configuration at a time <math>\Delta t</math> later will violate the joint limits. If so, you should recalculate the controls <math>(u,\dot{\theta})</math>, by first changing the Jacobian <math>J_e</math> to indicate that the offending joint(s) should not be used---the robot must use other joints (if possible) to generate the desired end-effector twist <math>\mathcal{V}</math>. To recalculate the controls, change each column of <math>J_e</math> corresponding to an offending joint to all zeros. This indicates that moving these joints causes no motion at the end-effector, so the pseudoinverse solution will not request any motion from these joints.<br />
<br />
This method is simple, but there are other ways to avoid joint limits. If you use a different approach, be sure to document it in your final README file.<br />
<br />
'''Tip from a Coursera student!''' "Try making a version that avoids joint limits and self-collisions! I recommend making a new function other than <tt>testJointLimits</tt> to see the difference between your original code and the enhanced code. Use the original code to find a trajectory which causes the robot to self collide and then use the enhanced one. It's pretty easy and fun to watch."<br />
<br />
'''The full program:''' Now write your full program, according to the input specifications at the top of this page. Your program should first generate a reference trajectory using <tt>TrajectoryGenerator</tt> and set the initial robot configuration, a 13-vector as described earlier on this page:<br />
<br />
chassis phi, chassis x, chassis y, J1, J2, J3, J4, J5, W1, W2, W3, W4, gripper state<br />
<br />
Now the program enters a loop that loops through the reference trajectory generated by <tt>TrajectoryGenerator</tt>. If the reference trajectory has <math>N</math> reference configurations, the loop runs <math>N-1</math> times. For example, the 10th time through the loop, the controller uses the 10th configuration of the reference trajectory as <math>X_d</math> and the 11th configuration as <math>X_{d,\text{next}}</math> to calculate the feedforward twist <math>\mathcal{V}_d</math>. <br />
<br />
Each time through the loop, you <br />
* calculate the control law using <tt>FeedbackControl</tt> and generate the wheel and joint controls using <math>J_e^\dagger(\theta)</math>; <br />
* send the controls, configuration, and timestep to <tt>NextState</tt> to calculate the new configuration; <br />
* store every <math>k</math>th configuration for later animation (note that the reference trajectory has <math>k</math> reference configurations per 0.01 second step, as described in Milestone 2; you may choose <math>k=1</math> for simplicity); and <br />
* store every <math>k</math>th <math>X_{\text{err}}</math> 6-vector, so you can later plot the evolution of the error over time.<br />
<br />
Once the program has completed all iterations of the loop, it should write out the csv file of configurations. If the total time of motion of the youBot is 15 seconds, your csv file should have 1500 lines (or 1501 lines), corresponding to 0.01 seconds between each configuration. Load the csv file into the CSV Mobile Manipulation youBot scene (Scene 6) to see the results. Your program should also generate a file with the log of the <math>X_{\text{err}}</math> 6-vector as a function of time, suitable for plotting by your favorite plotting software.<br />
<br />
'''Testing feedforward control:''' You should make sure feedforward control works as you expect before testing feedback control. Choose an initial configuration of the robot that puts the end-effector exactly at the configuration at the beginning of the reference trajectory. Run your program with <math>K_p = K_i = 0</math>, i.e., feedforward control only. This should result in a csv file which, when played through the mobile manipulation capstone scene, drives the robot to pick up the block and put it down at the desired configuration. (Or at least it should come very close to doing so! Small numerical error in the integration will be fixed when you add a feedback controller.) If not, time to start debugging! Your end-effector reference trajectory must be correct, if you already tested Milestone 2. So now you have to figure out why the wheel and arm controls your feedforward controller and Jacobian pseudoinverse are generating do not drive the end-effector along the reference trajectory. (You could try removing joint speed limits if these are preventing the robot from following the planned trajectory, or increase the time of the trajectory so large joint speeds are not needed to follow the trajectory.)<br />
<br />
You should also try starting the end-effector with some initial error from the reference trajectory, but still only use feedforward control. See how the end-effector moves under these circumstances. Does it make sense to you?<br />
<br />
Do not move on with the project until your feedforward control works as you expect. Otherwise the effects of PI feedback control will only further confuse the situation.<br />
<br />
'''The physics engine in CoppeliaSim:''' By default, Scene 6 (the capstone mobile manipulation scene) uses a simulation timestep of dt = 10 ms and the physics engine ODE. You should keep the timestep at 10 ms for simulated time to be correct, and we have found ODE to yield more easily understood results than Bullet for Scene 6. But you are welcome to try different physics engines if you'd like; specify your choice in the CoppeliaSim GUI. Keep in mind that simulation of bodies in contact is computationally intensive, and approximate solution methods could lead to unexpected behavior, like the block slipping in the grasp. We don't have a suggested "fix" for this; if you want to learn about how physics engines work, and the various approximations they make, you are encouraged to consult the documentation for [http://www.ode.org/ ODE] and [http://bulletphysics.org/wordpress/ Bullet].<br />
<br />
'''Review material:''' This capstone project builds on material throughout the textbook "Modern Robotics: Mechanics, Planning, and Control." '''[[Modern Robotics|Click here for links to the preprint version of the textbook and the videos.]]''' Particularly relevant to this milestone are the following chapters and their associated videos:<br />
* [https://youtu.be/27jUrkFdyks '''Chapter 4.1.2: Product of Exponentials Formula in the End-Effector Frame'''] (4:41)<br />
* [https://youtu.be/69HeL2XvL9Y '''Chapter 5.1.2: Body Jacobian'''] (4:51)<br />
* [https://youtu.be/WuhEEidkes8 '''Chapter 11.3: Motion Control with Velocity Inputs (Part 3 of 3)'''] (4:29)<br />
* [https://youtu.be/1MgpqD7v2x0 '''Chapter 13.5: Mobile Manipulation'''] (6:19)<br />
<br />
=== Final Step: Completing the Project and Your Submission ===<br />
<br />
Now that feedforward control is working, you are ready to complete your project. Use the default initial and goal configurations for the cube in the capstone CoppeliaSim scene, i.e., the initial cube configuration is at <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the final cube configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>. Let the initial configuration of the end-effector reference trajectory be at<br />
<br />
<math><br />
T_{se} = \left[\begin{array}{cccc} <br />
0 & 0 & 1 & 0 \\ <br />
0 & 1 & 0 & 0 \\<br />
-1 & 0 & 0 & 0.5 \\<br />
0 & 0 & 0 & 1 \end{array}\right]<br />
</math><br />
<br />
Choose an initial configuration of the youBot so that the end-effector has at least 30 degrees of orientation error and 0.2 m of position error. Try executing the feedforward controller (<math>K_p = K_i = 0</math>) and play the resulting csv file through the CoppeliaSim capstone scene to see what happens.<br />
<br />
Now add a positive-definite diagonal proportional gain matrix <math>K_p</math> while keeping the integral gains zero. You can keep the gains "small" initially so the behavior is not much different from the case of feedforward control only. As you increase the gains, can you see some corrective effect due to the proportional control?<br />
<br />
Eventually you will have to design a controller so that essentially all initial error is driven to zero by the end of the first trajectory segment; otherwise, your grasp operation may fail.<br />
<br />
Once you get good behavior with feedforward-plus-P control, try experimenting with other variants: P control only; PI control only; and feedforward-plus-PI control. <br />
<br />
'''What to submit:''' You will submit a single .zip file of a directory with the following contents:<br />
# '''A file called README.txt or README.pdf.''' This file should briefly explain your software and your results. If you needed to follow a different approach to solve the problem than the one described above, explain why and explain your solution method. If you encountered anything surprising, or if there is something you still don't understand, or if you think an important point is neglected in the description of the project on this page, explain it. If you implemented singularity avoidance, joint limit avoidance, or any other enhancement over the basic project description given on this page, explain your method. You may also wish to include more results in the three results directories described below, showing the results when using your enhancements vs. when you don't use your enhancements, to highlight the value of your enhancements.<br />
# '''Your commented code in a directory called "code."''' Your code should be commented, so it is clear to the reader what the code is doing. No need to go overboard with too many comments, but keep in mind your reviewer may not be fluent in your programming language. Your code comments must include an example of how to use the code. Only turn in functions that you wrote or modified; you don't need to turn in other MR functions that your code uses. If your code is in MATLAB or Python, just turn in the source files (text files) with your functions. If your code is in Mathematica, turn in (a) your .nb notebook file and (b) a .pdf printout of your code, so a reviewer can read your code without having to have the Mathematica software. <br />
# '''A directory called "results" with the results of your program.''' This directory should contain three directories: one titled "best," one titled "overshoot," and one titled "newTask." The directories "best" and "overshoot" both solve a pick-and-place task where the initial and final configurations of the cube are at the default locations in the capstone CoppeliaSim scene, i.e., the initial block configuration is at <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the final block configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>. The directory "newTask" should have different initial and final block configurations, which you are free to choose yourself. In all cases, the initial configuration of the end-effector should have at least 30 degrees of orientation error and 0.2 m of position error from the first configuration on the reference trajectory. The directory "best" should contain results using a well-tuned controller, either feedforward-plus-P or feedforward-plus-PI. The convergence exhibited by the controller does not necessarily have to be fast (in fact, it is more interesting if the convergence is not too fast, so the transient response is clearly visible), but the motion should be smooth, with no overshoot, and very little error by partway through trajectory segment 1. The directory "overshoot" should contain the results using a less-well-tuned controller, one that exhibits overshoot and a bit of oscillation. Nonetheless, the error should be eliminated before the end of trajectory segment 1. Your controller for "overshoot" will likely be feedforward-plus-PI or just PI. You can use any controller to solve the "newTask" task. In each of the three directories, give:<br />
## A very brief README.txt or README.pdf file that indicates the type of controller, the feedback gains, and any other useful information about the results. For the "newTask" directory, indicate the initial and goal configurations for the cube.<br />
## The CoppeliaSim .csv file produced by your program when it is called with the input from the log file.<br />
## A video of your .csv file being animated by the CoppeliaSim scene.<br />
## The <math>X_{\text{err}}</math> data file produced by your program.<br />
## A plot of the six elements of <math>X_{\text{err}}</math> as a function of time, showing the convergence to zero. This plot should '''not''' require any special software (e.g., MS excel) to be viewable. In other words, you should save it as a .pdf or other freely-viewable format.<br />
## A log file showing your program being called with the input. In MATLAB, for example, this log file could be something like: <br />
>> runscript<br />
Generating animation csv file.<br />
Writing error plot data.<br />
Done.<br />
>><br />
:::In this case, the file/function "runscript" contains the data for the program and actually invokes the program, and you should include the file "runscript". It is recommended that your program provide some simple feedback to the user, like "Generating animation csv file. Writing error plot data. Done." or similar, but it is not strictly necessary.<br />
<br />
'''Project grading.''' Your project will be graded on the clarity and correctness of your README files and your code. Your "results" directories will be graded on their correctness, including the quality of your videos and whether your error plots show reasonable convergence to zero.<br />
<br />
'''If you succeed in this project, congratulations!''' You have integrated concepts from all five previous Modern Robotics courses in a fairly sophisticated piece of software.<br />
<br />
== Other Things to Try ==<br />
<br />
You could imagine other approaches to solving the mobile manipulator pick-and-place problem, instead of just planning a trajectory for the end-effector and using feedback control to track it. For example, you could use an obstacle-avoiding motion planner to plan a reference trajectory for the entire robot, not just the end-effector. You could incorporate joint limits for the robot arm. You could use a weighted pseudoinverse, instead of the standard pseudoinverse, to indicate a preference to use wheel or joint motions. You could actively avoid singularities of the arm. You could decide to keep the mobile base stationary during trajectory segments 2, 4, 6, and 8.<br />
<br />
If you have other ideas on better ways to approach the mobile manipulation problem, feel free to mention them in a discussion prompt or your main README file.<br />
<br />
If you are interested, you could delve more deeply into CoppeliaSim, for example by changing the respondability or dynamic properties of rigid bodies. If you make the youBot chassis respondable, the youBot's chassis can push the block around.<br />
<br />
'''For fun:''' See if you can plan and execute a trajectory for the robot arm that causes the gripper to throw the block to a desired landing point!</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Modern_RoboticsModern Robotics2020-01-25T07:46:12Z<p>Lynch: /* Simulation */</p>
<hr />
<div>[[File:ModernRoboticsCover.jpg|right|thumb|x300px|The Cambridge University Press cover.]] <br />
This is the home page of the textbook "Modern Robotics: Mechanics, Planning, and Control," Kevin M. Lynch and Frank C. Park, Cambridge University Press, 2017, ISBN 9781107156302. Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below.<br />
<br />
[[File:ModernRoboticsCMPCover.jpg|right|thumb|x300px|[https://item.jd.com/12788036.html The Chinese version from China Machine Press.]]] <br />
<br />
'''New!''' You can purchase [https://item.jd.com/12788036.html '''the Chinese translation of the book'''].<br />
<br />
If you find this book useful for a course or self-study, please contact Kevin or Frank and let us know!<br />
<br />
'''[[Modern_Robotics#Online_Courses | Modern Robotics is now available as online courses on Coursera.]]'''<br />
<br />
'''From the foreword:'''<br />
<br />
"Frank and Kevin have provided a wonderfully clear and patient explanation of their subject." '''Roger Brockett''', ''Harvard University''<br />
<br />
"''Modern Robotics'' imparts the most important insights of robotics ... with a clarity that makes it accessible to undergraduate students." '''Matthew T. Mason''', ''Carnegie Mellon University''<br />
<br />
== Book, Practice Exercises, and Linear Algebra Review ==<br />
<br />
Purchase the hardback through [https://www.amazon.com/gp/product/1107156300/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1107156300&linkCode=as2&tag=nu32book-20&linkId=f522685bc8cc019b5e064ce65fb510df '''Amazon''']or through [http://www.cambridge.org/ModernRobotics '''Cambridge University Press'''], or check out the free preprint version below. You can also purchase [https://item.jd.com/12788036.html '''the Chinese version of the book'''].<br />
<br />
The current version of the book is the updated first edition (online preprint dated December 2019, printed published version from Cambridge marked "3rd printing 2019" or later). The updated first edition (also referred to as "version 2") includes several corrections and minor additions to the original first edition (first published in May 2017).<br />
<br />
This book is the result of course notes developed over many years for the course M2794.0027 Introduction to Robotics at Seoul National University and ME 449 Robotic Manipulation at Northwestern University. The evolving course notes have been posted on the internet for years to support these classes. <br />
<br />
The for-purchase version of the book from Cambridge University Press has improved layout and typesetting, updated figures, different pagination (and fewer pages), and more careful copyediting, and it is considered the "official" version of the book. But the online preprint version of the book has the same chapters, sections, and exercises, and it is quite close in content to the Cambridge-published version. <br />
<br />
We are posting four versions of the book. All versions have exactly the same contents and pagination. They differ only in the sizes of the margins and the size of the print, as manipulated in Adobe Acrobat after latex'ing. Two of the versions have working hyperlinks for navigating the book on your computer or tablet.<br />
<br />
'''With working hyperlinks.''' (To navigate the book using the hyperlinks, click on the hyperlink. To go back where you came from, choose the button or keystroke appropriate to your pdf reader. For example, on the Mac with Acrobat or Acrobat Reader, use cmd-left arrow. With Preview on the Mac, use cmd-[. Some readers on other operating systems use alt-left arrow. You can google to see which solution works for your pdf reader.)<br />
* [[Media:MR-v2.pdf|Default 8.5x11 or A4 version]]. Printable version with 10 pt font and large margins.<br />
* [[Media:MR-tablet-v2.pdf|Tablet version]]. Margins have been eliminated so that no space is wasted when viewing the document on a computer or tablet.<br />
<br />
'''Printable versions without working hyperlinks.'''<br />
* [[Media:MR-largefont-v2.pdf|Large font 8.5x11 or A4 version]]. Printable version with 12 pt font equivalent and smaller margins than the 10 pt default version.<br />
* [[Media:MR-2up-v2.pdf|2up version]]. Printable version with 2 book pages per page, for saving paper if you have good eyes. Approximately 8.5 pt font equivalent.<br />
<br />
These files have been compressed to about 7 MB. Let us know if you have any problems reading them. Please note that some versions of the default Mac OS X pdf reader, Preview, are known to have bugs displaying certain images in pdf files. If a figure is not appearing properly, please try a better pdf viewer, like Acrobat Reader.<br />
<br />
'''Table of Contents:'''<br />
# Preview<br />
# Configuration Space<br />
# Rigid-Body Motions<br />
# Forward Kinematics<br />
# Velocity Kinematics and Statics<br />
# Inverse Kinematics<br />
# Kinematics of Closed Chains<br />
# Dynamics of Open Chains<br />
# Trajectory Generation<br />
# Motion Planning<br />
# Robot Control<br />
# Grasping and Manipulation<br />
# Wheeled Mobile Robots<br />
<br />
:Appendix A. Summary of Useful Formulas<br />
<br />
:Appendix B. Other Representations of Rotations<br />
<br />
:Appendix C. Denavit-Hartenberg Parameters<br />
<br />
:Appendix D. Optimization and Lagrange Multipliers<br />
<br />
== Useful Supplemental Documents ==<br />
<br />
* [[Media:MR_practice_exercises.pdf|Practice exercises to give you more experience with the material]]. These practice exercises come with solutions, since Cambridge makes the end-of-chapter solutions available to instructors only.<br />
* [[Modern Robotics Linear Algebra Review|A linear algebra refresher appendix to accompany the book.]]<br />
<br clear=all><br />
<br />
== Videos ==<br />
<br />
* [http://modernrobotics.northwestern.edu '''Click here'''] to watch the video lectures embedded in a convenient viewing environment. <br />
* [[Modern Robotics Videos|'''Click here''']] if you prefer to watch the videos within the YouTube environment.<br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension]. Also check out the [https://robotacademy.net.au/ Robot Academy at Queensland University of Technology].<br />
<br />
== Solution Manual ==<br />
<br />
If you are an instructor, you can obtain a copy of the exercise solutions from Cambridge University Press. Go to the "Resources" section of [http://www.cambridge.org/us/academic/subjects/computer-science/computer-graphics-image-processing-and-robotics/modern-robotics-mechanics-planning-and-control '''the Cambridge University Press webpage for the book'''].<br />
<br />
== Prerequisites ==<br />
<br />
This book was written to be accessible to engineering students after taking typical first-year engineering courses. The student should have an understanding of:<br />
* freshman-level physics, including f = ma; free-body diagrams with masses, springs, and dampers; vector forces; and vector torques (or moments) as the cross product of a distance vector and a force;<br />
* linear algebra, including matrix operations, positive definiteness of a matrix, determinants, complex numbers, eigenvalues, and eigenvectors; <br />
* some calculus, derivatives, and partial derivatives; and<br />
* basic linear ordinary differential equations.<br />
<br />
The student should also be prepared to program, but only basic programming skills are needed. Code is provided in python (freely available), MATLAB (for purchase, or you could use the freely available GNU Octave clone), and Mathematica (for purchase), so those languages are preferred.<br />
<br />
== Errata == <br />
<br />
'''[[Modern Robotics Errata|Errata for the book can be found here. Please click here to report any corrections, typos, or comments.]]'''<br />
<br />
== Software ==<br />
<br />
[https://github.com/NxRLab/ModernRobotics '''Download the book software from GitHub.''']<br />
<br />
The software accompanying the book is written in Mathematica, MATLAB, and Python. It is written to be educational and to reinforce the concepts in the book, not to be as computationally efficient or robust as possible. <br />
<br />
The origin of the software is student solutions to homework exercises. A major update was committed in January 2017, correcting some bugs in the earlier version.<br />
<br />
[https://github.com/NxRLab/ModernRobotics/issues '''To report any issues with the software, please click the "Issues" tab in GitHub.''']<br />
<br />
== Simulation ==<br />
<br />
[[image:youbot.jpg|right]]<br />
<br />
We have found [http://www.coppeliarobotics.com/ '''the CoppeliaSim robot simulation environment'''] (formerly known as V-REP) to be a valuable learning tool accompanying the book. It is free for educational use and cross platform. In ME 449 at Northwestern, we use it to experiment with the kinematics of different robots and to animate solutions to inverse kinematics, dynamic simulations, and controllers. <br />
<br />
[[Getting_Started_with_the_CoppeliaSim_Simulator|'''This page''']] gets you started with CoppeliaSim quickly.<br />
<br />
[[CoppeliaSim_Introduction|'''This page''']] provides "scenes" that allow you to interactively explore the kinematics of different robots (e.g., the Universal Robots UR5 6R robot arm and the KUKA youBot mobile manipulator) and to animate trajectories that are the results of exercises in chapters on kinematics, dynamics, and control.<br />
<br />
* [[Media:UR5-IK-720p.mov|A video of a UR5 trajectory created by solving numerical inverse kinematics (Chapter 6, Inverse Kinematics)]]<br />
* [[Media:UR5-falling-720p.mov|A video of the UR5 falling under gravity for 10 s, assuming no friction or gearing at the joints (Chapter 8, Dynamics of Open Chains)]]<br />
* [[Media:youbot-controlled.mov|A video of the KUKA youBot mobile manipulator using Jacobian-pseudoinverse-based control of the end-effector's motion (Chapter 13, Wheeled Mobile Robots)]]<br />
<br />
<br clear=all><br />
<!-- == Videos ==<br />
[https://youtu.be/ftOle31x9NM '''Welcome to Modern Robotics!''' (2:00)]<br />
<br />
Videos supporting the book will be posted to YouTube and linked to from this wiki. [https://youtu.be/PCeP30q795g '''Here is a sample video.'''] Others will be posted in August 2017. <br />
<br />
Videos are made with [http://lightboard.info Northwestern's Lightboard]. We have used this tool in the past to make the [http://nu32.org '''mechatronics videos at http://nu32.org'''].<br />
<br />
You can see an excellent collection of robotics videos at the [http://handbookofrobotics.org/ Springer Handbook of Robotics Multimedia Extension].<br />
--><br />
<br />
== Online Courses ==<br />
<br />
Modern Robotics is now available as a MOOC (massive open online course) Specialization on Coursera!<br />
<br />
'''[https://www.coursera.org/specializations/modernrobotics This is a link to the Specialization home page.]''' The Specialization consists of six short courses, each expected to take approximately four weeks of approximately five hours of effort per week:<br />
* [https://www.coursera.org/learn/modernrobotics-course1 Course 1: Foundations of Robot Motion (Chapters 2 and 3)]<br />
* [https://www.coursera.org/learn/modernrobotics-course2 Course 2: Robot Kinematics (Chapters 4, 5, 6, and 7)]<br />
* [https://www.coursera.org/learn/modernrobotics-course3 Course 3: Robot Dynamics (Chapters 8 and 9)]<br />
* [https://www.coursera.org/learn/modernrobotics-course4 Course 4: Robot Motion Planning and Control (Chapters 10 and 11)]<br />
* [https://www.coursera.org/learn/modernrobotics-course5 Course 5: Robot Manipulation and Wheeled Mobile Robots (Chapters 12 and 13)]<br />
* [https://www.coursera.org/learn/modernrobotics-course6 Course 6: Capstone Project, Mobile Manipulation]<br />
<br />
'''[[Coursera Resources|This page collects together some of the supplemental material used in the Coursera MOOCs]]'''.<br />
<br />
The material in Modern Robotics also forms the basis for two edX online courses. These courses were created before the book was finished, so some of the notation used is a bit different from that used in the book.<br />
<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-i Robot Mechanics and Control, Part I]<br />
* [https://www.edx.org/course/robot-mechanics-and-control-part-ii Robot Mechanics and Control, Part II]<br />
<br />
== Using the Online Course Materials in a Traditional Classroom Course ==<br />
<br />
If you are using the book in a traditional university setting, you can ask your students to sign up for the relevant courses on Coursera (see above). They can audit the courses, so they don't have to pay. They will have access to the video lectures and to the video comprehension questions that follow each video lecture. They will also have access to discussion forums. (They won't have access to graded tests and peer-graded assignments, which require paying the Coursera fee.) If students watch the videos and do the reading before class, you can spend class time working on example problems, homework problems, or discussing points where confusion arises, rather than delivering a traditional lecture.<br />
<br />
== Supplemental Information ==<br />
<br />
* UR5 parameters you can use for dynamic simulations (note: the values are not exact, and do not account for the effect of gearing at the joints)<br />
** [[Media:UR5-parameters.nb|UR5 parameters in a Mathematica notebook]]<br />
** [[Media:UR5-parameters.m|UR5 parameters in MATLAB]]<br />
** [[Media:UR5-parameters-py.txt|UR5 parameters in Python]]<br />
* The UR5 URDF file from Chapter 4 of the book ([[Media:UR5-URDF.pdf|.pdf format]] or [[Media:UR5-URDF.txt|.txt format]]). For learning purposes only, not actual use; it contains only kinematic and inertial properties, and does not fully account for the effects of gearing. This file is based on the [https://github.com/ros-industrial/universal_robot/blob/indigo-devel/ur_description/urdf/ur5.urdf.xacro UR5 URDF from the ROS-Industrial team].<br />
* [http://petercorke.com/Robotics_Toolbox.html Peter Corke's excellent Robotics Toolbox for MATLAB] and other robotics software linked to from his site.<br />
* [https://github.com/quangounet/TOPP Open-source software for time-optimal time scaling (Chapter 9.4), courtesy of Quang-Cuong Pham].<br />
<br />
== About the Authors ==<br />
<br />
[[image:kevin-m-lynch-headshot.jpg|right]]<br />
<br />
'''Kevin M. Lynch''' is Professor and Chair of the Mechanical Engineering Department at Northwestern University. He is director of the [https://robotics.northwestern.edu Center for Robotics and Biosystems] and a member of the [http://nico.northwestern.edu Northwestern Institute on Complex Systems]. His research focuses on dynamics, motion planning, and control for robot manipulation and locomotion; self-organizing multi-agent systems; and physically interacting human-robot systems.<br />
<br />
He is Editor-in-Chief of the ''IEEE Transactions on Robotics'', former Editor-in-Chief of the IEEE International Conference on Robotics and Automation Conference Editorial Board, and a former Editor of the IEEE Transactions on Robotics, the IEEE Robotics and Automation Letters, and the IEEE Transactions on Automation Science and Engineering. He is a co-author of [https://www.amazon.com/Principles-Robot-Motion-Implementations-Intelligent/dp/0262033275 ''The Principles of Robot Motion''] (MIT Press, 2005) and [http://nu32.org ''Embedded Computing and Mechatronics with the PIC32 Microcontroller''] (Elsevier, 2015), an IEEE fellow, and the recipient of the IEEE Early Career Award in Robotics and Automation, Northwestern's Professorship of Teaching Excellence, and the Northwestern Teacher of the Year award in engineering. He earned a BSE in Electrical Engineering from Princeton University and a PhD in Robotics from Carnegie Mellon University.<br />
<br />
<br clear=all><br />
<br />
[[image:frank-park-headshot.jpg|right]]<br />
<br />
'''Frank C. Park''' received his BS in electrical engineering from MIT and his PhD in applied mathematics from Harvard University. From 1991 to 1995 he was assistant professor of mechanical and aerospace engineering at the University of California, Irvine. Since 1995 he has been professor of mechanical and aerospace engineering at Seoul National University, where he is currently chair of the department. His research interests are in robot mechanics, planning and control, vision and image processing, and related areas of applied mathematics. He has been an IEEE Robotics and Automation Society Distinguished Lecturer, and received best paper awards for his work on visual tracking and parallel robot design. He has served on the editorial boards of the Springer Handbook of Robotics, Springer Advanced Tracts in Robotics (STAR), Robotica, and the ASME Journal of Mechanisms and Robotics. He has held adjunct faculty positions at the HKUST Robotics Institute, NYU Courant Institute, and the Interactive Computing Department at Georgia Tech. In 2014 he received the Seoul National University Teaching Excellence Award. He is a fellow of the IEEE, former Editor-in-Chief of the ''IEEE Transactions on Robotics'', and developer of the edX courses Robot Mechanics and Control I, II.<br />
<br clear=all><br />
<br />
<!--<br />
=== Why LynchAndPark.org? ===<br />
<br />
[[File:ModernRoboticsFlyer.jpg|right|thumb|x300px|Advertising flyer for the book.]]<br />
You may have gotten here from the URL http://lynchandpark.org. If you're like us, you forget the name of the textbook, but remember the names of the authors. We thought it would be easiest to remember this URL. If you ever have any problems with http://lynchandpark.org, you can try http://www.lynchandpark.org , http://modernrobotics.org, or http://www.modernrobotics.org.<br />
--><br />
<br clear=all><br />
<br />
== Mechatronics ==<br />
<br />
[[Image:NU32_Book_Cover.jpg|x200px |right | link=NU32]]<br />
<br />
<!--<br />
[[File:NU32_Book_Cover.jpg|x200px|thumb|right|''Embedded Computing and Mechatronics,'' Lynch Marchuk, and Elwin, Elsevier 2015.]]<br />
--><br />
''Modern Robotics'' is written at the system level: you learn about the kinematics, dynamics, motion planning, and control of an entire robot system. If you would like to learn more about the details of implementation, e.g., joint-level feedback control, driving motors (including brushed, brushless, steppers, and servos), gearing, sensors, signal processing, etc., check out [[NU32|''Embedded Computing and Mechatronics'']] by Lynch, Marchuk, and Elwin, Elsevier 2015.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Mobile_Manipulation_CapstoneMobile Manipulation Capstone2020-01-25T07:30:23Z<p>Lynch: </p>
<hr />
<div>[[image:youbot-capstone.png|right|x250px]]<br />
<br />
This page describes the Capstone Project for the Coursera "Modern Robotics" Specialization. This project forms the sixth and final course: "Modern Robotics, Course 6: Capstone Project, Mobile Manipulation." This project draws on pieces of Courses 1 to 5. <br />
<br />
[https://youtu.be/Q1CekpBW6Js '''A video summary of this project is given in this YouTube video'''].<br />
<br />
Depending on your programming experience, this project should take approximately 20 hours, broken down into three intermediate milestones and your final submission.<br />
<br />
You should use the Modern Robotics code library to help you complete this project.<br />
<br />
== Introduction, and the CSV Mobile Manipulation youBot CoppeliaSim Scene ==<br />
<br />
In your capstone project, you will write software that plans a trajectory for the end-effector of the youBot mobile manipulator (a mobile base with four mecanum wheels and a 5R robot arm), performs odometry as the chassis moves, and performs feedback control to drive the youBot to pick up a block at a specified location, carry it to a desired location, and put it down. <br />
<br />
The final output of your software will be a comma-separated values (csv) text file that specifies the configurations of the chassis and the arm, the angles of the four wheels, and the state of the gripper (open or closed) as a function of time. This specification of the position-controlled youBot will then be "played" on the CoppeliaSim simulator to see if your trajectory succeeds in solving the task. [[Writing_a_CSV_File|'''This page''']] has information on writing csv files in Python, MATLAB, and Mathematica.<br />
<br />
'''[[Getting_Started_with_the_CoppeliaSim_Simulator|Make sure you have a working CoppeliaSim installation]]''' (from Course 1 of the [https://www.coursera.org/specializations/modernrobotics Coursera specialization]). [[CoppeliaSim_Introduction#Scene_6:_CSV_Mobile_Manipulation_youBot|'''This project uses Scene 6 (CSV Mobile Manipulation youBot) from the CoppeliaSim Introduction wiki page''']]. You should download it and test it with its sample csv file, to see what a solution looks like. (Even if you have downloaded it before, download it again before you begin your project, to make sure you have the most up-to-date version of this scene.) Leave the block's initial and goal configurations as the default. The default initial block configuration is at <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the final block configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Unlike previous projects, where we used CoppeliaSim to simply animate the robot's motion, in this project CoppeliaSim will use a physics simulator to simulate the interaction of the youBot with the block. In other words, if the gripper closes on the block in the wrong position or orientation, the block may simply slide out of the grasp. The interaction between the robot and the block is governed by a physics simulator, often called a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. CoppeliaSim has different physics engines which you can select, including Bullet and ODE, but ODE is the default for Scene 6.<br />
<br />
'''The time between each successive configuration in your csv file is 0.01 seconds (10 milliseconds).''' This is an important bit of information, since, unlike the previous visualization scenes which simply animated a csv file with no particular notion of time, the notion of time is critical in a dynamic simulation.<br />
<br />
A typical line of your csv file would be something like<br />
<br />
-0.75959, -0.47352, 0.058167, 0.80405, -0.91639, -0.011436, 0.054333, 0.00535, 1.506, -1.3338, 1.5582, 1.6136, 0<br />
<br />
i.e., thirteen values separated by commas, representing<br />
<br />
chassis phi, chassis x, chassis y, J1, J2, J3, J4, J5, W1, W2, W3, W4, gripper state<br />
<br />
where J1 to J5 are the arm joint angles and W1 to W4 are the four wheel angles.<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
Wheels 1 to 4 are numbered as shown in the image to the right. The ten angles (phi for the chassis, five arm joint angles, and four wheel angles) are in radians and the two chassis position coordinates (x,y) are in meters. A gripper state of 0 indicates that you want the gripper to be open, and a gripper state of 1 indicates that you want the gripper to be closed. In practice, the transition from open to closed (or from closed to open) takes up to 0.625 seconds, so any transition from 0 to 1, or 1 to 0, on successive lines in your csv file initiates an action (opening or closing) that will take some time to complete. You should keep the gripper state at the same value for 63 consecutive lines if you want to ensure that the opening/closing operation completes. An opening/closing operation terminates when a force limit is reached (e.g., an object is grasped) or the gripper has fully opened or closed.<br />
<br />
Your program will take as input:<br />
* the initial resting configuration of the cube object (which has a known geometry), represented by a frame attached to the center of the object<br />
* the desired final resting configuration of the cube object<br />
* the actual initial configuration of the youBot<br />
* the reference initial configuration of the youBot (which will generally be different from the actual initial configuration, to allow you to test feedback control)<br />
* optionally: gains for your feedback controller (or these gains can be hard-coded in your program)<br />
<br />
The output of your program will be:<br />
* a csv file which, when "played" through the CoppeliaSim scene, should drive the youBot to successfully pick up the block and put it down at the desired location<br />
* a data file containing the 6-vector end-effector error (the twist that would take the end-effector to the reference end-effector configuration in unit time) as a function of time <br />
<br />
Your solution must employ automated planning and control techniques from ''Modern Robotics''. It should not simply be a manually coded trajectory of the robot. Your solution should automatically go from the input to the output, with no other human intervention. In other words, it should automatically produce a working csv file even if the input conditions are changed.<br />
<br />
[[image:capstone-traj1.png|right|150px]]<br />
[[image:capstone-traj2.png|right|150px]]<br />
[[image:capstone-traj3.png|right|150px]]<br />
[[image:capstone-traj4.png|right|150px]]<br />
[[image:capstone-traj5.png|right|150px]]<br />
[[image:capstone-traj6.png|right|150px]]<br />
[[image:capstone-traj7.png|right|150px]]<br />
[[image:capstone-traj8.png|right|150px]]<br />
<br />
In your software, you should piece together a reference trajectory for the gripper of the robot, which the robot is then controlled to follow. A typical reference trajectory would consist of the following eight segments, as illustrated in the eight images to the right (click on any image to make it larger):<br />
<br />
# A trajectory to move the gripper from its initial configuration to a "standoff" configuration a few cm above the block.<br />
# A trajectory to move the gripper down to the grasp position.<br />
# Closing of the gripper.<br />
# A trajectory to move the gripper back up to the "standoff" configuration.<br />
# A trajectory to move the gripper to a "standoff" configuration above the final configuration.<br />
# A trajectory to move the gripper to the final configuration of the object.<br />
# Opening of the gripper.<br />
# A trajectory to move the gripper back to the "standoff" configuration.<br />
<br />
Segments 3 and 7 each keep the end-effector fixed in space but, at the beginning of the segment, change the state of the gripper from 0 to 1 or 1 to 0, waiting for the gripper closing to complete. In other words, each of these segments would consist of at least 63 identical lines of the csv file (as described above), where the first line of the sequence of identical lines has a gripper state different from the previous line in the csv file, to initiate the opening or closing.<br />
<br />
Segments 2, 4, 6, and 8 are simple up or down translations of the gripper of a fixed distance. Good trajectory segments would be cubic or quintic polynomials taking a reasonable amount of time (e.g., one second). <br />
<br />
Trajectory segments 1 and 5 are longer motions requiring motion of the chassis. Segment 1 is calculated from the desired initial configuration of the gripper to the first standoff configuration, and segment 5 is calculated from the first standoff configuration to the second standoff configuration. The gripper trajectories could correspond to constant screw motion paths or decoupled Cartesian straight-line motion plus rotational motion, time scaled by third- or fifth-order polynomials (Chapter 9). <br />
<br />
Once the entire gripper reference trajectory has been pieced together from the 8 segments, the actual trajectory of the youBot is obtained by using a Jacobian pseudoinverse position controller as described in Chapter 13.5. Starting from the actual initial robot configuration (which has some error from the beginning of reference segment 1), your controller drives the gripper to converge to the reference trajectory. Your feedback controller should eliminate initial error before the gripper attempts to grasp the block, to avoid failure.<br />
<br />
To simulate the effect of feedback control, you must write your own motion simulator. For each timestep, you take the initial configuration of the robot and the wheel and joint speeds calculated by your controller and numerically integrate the effect of these speeds over a timestep to get the new robot configuration. To calculate the new configuration of the chassis due to the wheel motions, you must implement an odometry step (Chapter 13.4).<br />
<br />
<br clear=all><br />
<br />
== Kinematics of the youBot ==<br />
<br />
The images to the right illustrate the youBot. Click on them to make them bigger. The description below is consistent with Exercise 13.33 from the book, if you prefer to see the information there. All distances are in meters and all angles are in radians.<br />
<br />
[[image:Yb-book.png|right|500px|thumb|This figure illustrates the arm at its home configuration (all joint angles zero) and the frames {s}, {b}, {0}, and {e}. For the image on the right, joint axes 1 and 5 (not shown) point upward and joint axes 2, 3, and 4 are out of the screen. Click to make the image bigger.]]<br />
<br />
[[image:Yb-base-capstone.png|right|300px|thumb|A top view of the omnidirectional mobile base. The forward-backward distance between the wheels is <math>2l = 0.47</math> meters and the side-to-side distance between wheels is <math>2w = 0.3</math> meters. The radius of each wheel is <math>r = 0.0475</math> meters. The forward driving and "free sliding" direction <math>\gamma</math> of each wheel is indicated.]]<br />
<br />
[[image:Youbot-gripper.png|right|300px|thumb|The gripper and the end-effector frame {e}, which has an origin midway between the fingers of the gripper. The minimum opening distance of the gripper is <math>d_{1,\text{min}} = 2</math> cm, the maximum opening distance is <math>d_{1,\text{max}} = 7</math> cm, the interior length of the fingers is <math>d_{2} = 3.5</math> cm, and the distance from the base of the fingers to the frame {e} is <math>d_{3} = 4.3</math> cm. The axis <math>\hat{\text{x}}_{\text{e}}</math> is into the screen.]]<br />
<br />
[[image:Block-capstone.png|right|300px|thumb|The object being manipulated is a cube, 5 cm x 5 cm x 5 cm. The cube's frame {c} is at its center, and the axes are aligned with the edges of the cube.]]<br />
<br />
The configuration of the frame {b} of the mobile base, relative to the frame {s} on the floor, is described by the 3-vector <math>q = (\phi,x,y)</math> or the <math>SE(3)</math> matrix<br />
<br />
<math> T_{sb}(q) = \left[\begin{array}{cccc} \cos \phi & -\sin \phi & 0 & x \\ \sin \phi & \cos \phi & 0 & y \\ 0 & 0 & 1 & 0.0963 \\ 0 & 0 & 0 & 1 \end{array}\right]</math><br />
<br />
where <math>z = 0.0963</math> meters is the height of the {b} frame above the floor. The forward-backward distance between the wheels is <math>2l = 0.47</math> meters and the side-to-side distance between wheels is <math>2w = 0.3</math> meters. The radius of each wheel is <math>r = 0.0475</math> meters. The wheel numbering and forward driving and "free sliding" direction <math>\gamma</math> of each wheel is indicated in the figures.<br />
<br />
The fixed offset from the chassis frame {b} to the base frame of the arm {0} is<br />
<br />
<math> T_{b0}= \left[\begin{array}{cccc} 1 & 0 & 0 & 0.1662 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0.0026 \\ 0 & 0 & 0 & 1 \end{array}\right].</math><br />
<br />
When the arm is at its home configuration (all joint angles zero, as shown in the figure), the end-effector frame {e} relative to the arm base frame {0} is<br />
<br />
<math> M_{0e}= \left[\begin{array}{cccc} 1 & 0 & 0 & 0.033 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0.6546 \\ 0 & 0 & 0 & 1 \end{array}\right].</math><br />
<br />
When the arm is at its home configuration, the screw axes <math>\mathcal{B}</math> for the five joints are expressed in the end-effector frame {e} as<br />
# <math>\mathcal{B}_1 = (\omega_1,v_1)</math> where <math>\omega_1 = (0,0,1), \; v_1 = (0,0.033,0)</math><br />
# <math>\mathcal{B}_2 = (\omega_2,v_2)</math> where <math>\omega_2 = (0,-1,0), \; v_2 = (-0.5076,0,0)</math><br />
# <math>\mathcal{B}_3 = (\omega_3,v_3)</math> where <math>\omega_3 = (0,-1,0), \; v_3 = (-0.3526,0,0)</math><br />
# <math>\mathcal{B}_4 = (\omega_4,v_4)</math> where <math>\omega_4 = (0,-1,0), \; v_4 = (-0.2176,0,0)</math><br />
# <math>\mathcal{B}_5 = (\omega_5,v_5)</math> where <math>\omega_5 = (0,0,1), \; v_5 = (0,0,0)</math><br />
<br />
In this project, for simplicity '''we assume no joint limits on the five joints of the robot arm.''' It is recommended, however, that you choose limits on the wheel and joint velocities. We will come back to this issue later.<br />
<br />
The end-effector frame {e} is rigidly attached to the last link and is midway between the tips of the gripper fingers. The minimum opening distance of the gripper is <math>d_{1,\text{min}} = 2</math> cm (i.e., the fingers cannot fully close; they can only get within 2 cm of each other), the maximum opening distance is <math>d_{1,\text{max}} = 7</math> cm, the interior length of the fingers is <math>d_{2} = 3.5</math> cm, and the distance from the base of the fingers to the frame {e} is <math>d_{3} = 4.3</math> cm. When the gripper closes, it closes until it reaches its minimum closing distance or encounters a force large enough to prevent further closing.<br />
<br />
The object being manipulated is a cube, 5 cm x 5 cm x 5 cm. The cube's frame {c} is at the center of the cube, and the axes are aligned with the edges of the cube. The default initial configuration of the cube is at (x, y, z) = (1, 0, 0.025 ) m in the space frame {s}, and the axes of {c} are aligned with {s}. The default desired final configuration of the cube is at (x, y, z) = (0, -1, 0.025) m and the axes of {c} are rotated by <math>-\pi/2</math> radians about the <math>\hat{\text{z}}_{\text{s}}</math>-axis of {s}. These are written in <math>SE(3)</math> as<br />
<br />
<math>T_{sc,\text{initial}} = \left[\begin{array}{cccc} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0.025 \\ 0 & 0 & 0 & 1\end{array} \right] </math><br />
<br />
<math>T_{sc,\text{goal}} = \left[\begin{array}{cccc} 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0.025 \\ 0 & 0 & 0 & 1\end{array} \right].<br />
</math><br />
<br />
Both the initial and final configurations of the cube can be altered in the CoppeliaSim scene. (You can only alter the (x,y) position and the orientation of the cube about the <math>\hat{\text{z}}_{\text{s}}</math>-axis.) A good choice for the "standoff" configuration before moving down to the cube and moving back up (the ends of trajectories 1, 4, 5, and 8) is to have the {e} frame a few cm above the {c} frame.<br />
<br />
<br clear=all><br />
<br />
== Some Background on Dynamic Simulations in CoppeliaSim ==<br />
<br />
''This section contains more information about how the CoppeliaSim simulation works. It contains more details than you need for the final project. You may skip this section and go directly to [[Mobile_Manipulation_Capstone#Milestones_and_Details|Milestones and Details]].''<br />
<br />
The CoppeliaSim scene used for the capstone project (Scene 6, CSV Mobile Manipulation youBot) is the first scene in which we've used CoppeliaSim's ability to simulate bodies in contact. A "physics engine" (sometimes called a "game engine," since such simulators are often used in video games) simulates the motions of bodies when forces are applied to them, and when they make contact or collide with each other. Physics engines also handle articulated bodies with joints and other constraints.<br />
<br />
CoppeliaSim does not have its own physics engine; instead, it bundles and makes available several different physics engines, including Bullet, ODE, Vortex, and Newton. While these simulators have many features in common, they each have their own strengths and weaknesses, and none is perfect. A simulator must detect collisions and contacts, simulate restitution ("bounciness") and friction, employ numerical integration to take timesteps to advance the simulation, etc. All of these are approximate operations with a variety of "magic numbers" and error tolerances, with the goal of making the simulations physically realistic without consuming too much CPU time.<br />
<br />
As a result of these approximations, you can often observe bizarre behavior, such as an object spontaneously beginning to bounce on the floor. In this capstone project, the unexpected behavior may be the object slipping out of the grasp. These are just realities of dynamic simulation, and it is beyond the scope of this project to delve into the details of dynamic simulation. If you would like to learn more, you can check out the documentation for [http://www.ode.org/ ODE] and [http://bulletphysics.org/wordpress/ Bullet].<br />
<br />
For block grasping, we have found ODE to give the best results, so that is the default physics engine when you open Scene 6.<br />
<br />
=== Rigid Bodies in Scene 6 ===<br />
<br />
In CoppeliaSim, each rigid body is classified as either '''respondable''' or '''non-respondable''':<br />
* '''respondable''': The body can make contact and collide with other bodies.<br />
* '''non-respondable''': The body can pass through other bodies.<br />
Thus if a respondable body and a non-respondable body overlap, or if two non-respondable bodies overlap, there is no collision. If two respondable bodies make contact, however, forces will keep them from penetrating each other.<br />
<br />
'''In Scene 6, only the floor, the gripper fingers, and the cube are respondable. All other bodies are non-respondable.''' This means, for example, that the robot can drive over the cube, and the cube will never move. (The chassis and wheels do not interact with the cube.) This also means that the youBot's arm can intersect the mobile base, or arm links can intersect each other. This is unrealistic, of course, but we are focusing on the interaction of the cube with the gripper and the floor. <br />
<br />
[[image:cube_dynamic_properties.png|right|x250px]]<br />
In addition, each rigid body can be classified as '''dynamic''' or '''non-dynamic''':<br />
* '''dynamic''': The body has mass and inertial properties that are used to compute its motion. For example, as shown in the image to the right, you can click on "Cuboid_initial" to learn about the mass properties of the cube in Scene 6. You can also learn about material properties, like "friction values." (The simulated friction coefficient of two bodies in contact is calculated as the product of the friction values of the two materials. This is a simple, but non-physical, way to come up with a friction coefficient for two bodies in contact without having to specify a friction coefficient for every possible pair of materials in contact.)<br />
* '''non-dynamic''': The body's motion is not computed according to dynamics computed by the physics engine.<br />
<br />
'''In Scene 6, only the gripper fingers and the cube are dynamic.''' In other words, the motions of the fingers and the cube are computed according to the physics engine; other bodies are not part of the dynamic simulation.<br />
<br />
<br clear=all><br />
<br />
=== Joints in Scene 6 ===<br />
<br />
In Scene 6, each joint is either in '''torque/force mode''' or '''passive mode''':<br />
* '''torque/force mode''': In torque/force mode, the motion of the joint is controlled by a torque or force applied by an actuator, possibly governed by a PID control law, for example.<br />
* '''passive mode''': In this mode, the joint is kinematically controlled to go to specified positions, without reference to forces or torques.<br />
<br />
'''In Scene 6, all joints are in passive mode, except for the two joints controlling the gripper motion.''' All passive joints kinematically follow the motions commanded in the csv file.<br />
<br />
All joint limits for the youBot's 5R arm are disabled in Scene 6. This is unrealistic, but respecting joint limits is not part of this capstone project.<br />
<br />
=== Gripper ===<br />
<br />
The gripper fingers have joint limits: each finger of the gripper can travel 2.5 cm. At maximum opening, the distance between the fingers is 7 cm, and at maximum closing the distance is 2 cm. The gripper fingers are controlled to always be opening (until force limits are reached or the maximum inter-finger distance is obtained) or always closing (until force limits are reached, as when closed on the cube, or the minimum inter-finger distance is obtained). <br />
<br />
=== Running Your Solution in Scene 6 ===<br />
<br />
When you load your csv file into Scene 6 for the first time and press "Play File," the robot will jump to its starting configuration, pause for a second, and then begin executing your csv file. When it jumps like this, the "passive mode" joints are repositioned immediately, but the "torque/force mode" joints (for the gripper fingers) take time to be repositioned. So you may see some weird behavior as the gripper fingers reposition themselves in the initial fraction of a second when you run your csv file the first time. If you don't like this, then just run the csv file a second time. The robot will have been repositioned to the starting point of the csv file before you press "Play File," so the gripper will not have to reposition itself. <br />
<br />
<br clear=all><br />
<br />
== Milestones and Details ==<br />
<br />
Your solution to this project will be a fairly complex piece of software. To help you structure the project, and to allow you to test individual pieces of your solution, the project has three milestones before you finally complete the project. You do not turn in your solutions to these milestone subprojects; you only turn in your final project.<br />
<br />
=== Milestone 1: youBot Kinematics Simulator and csv Output ===<br />
<br />
You will write a simulator for the kinematics of the youBot. The main function in the simulator, let's call it <tt>NextState</tt>, is specified by the following inputs and outputs: <br />
<br />
'''Input:'''<br />
* A 12-vector representing the current configuration of the robot (3 variables for the chassis configuration, 5 variables for the arm configuration, and 4 variables for the wheel angles).<br />
* A 9-vector of controls indicating the arm joint speeds <math>\dot{\theta}</math> (5 variables) and the wheel speeds <math>u</math> (4 variables).<br />
* A timestep <math>\Delta t</math>.<br />
* A positive real value indicating the maximum angular speed of the arm joints and the wheels. For example, if this value is 12.3, the angular speed of the wheels and arm joints is limited to the range [-12.3 radians/s, 12.3 radians/s]. Any speed in the 9-vector of controls that is outside this range will be set to the nearest boundary of the range. If you don't want speed limits, just use a very large number. If you prefer, your function can accept separate speed limits for the wheels and arm joints.<br />
<br />
'''Output:''' A 12-vector representing the configuration of the robot time <math>\Delta t</math> later.<br />
<br />
The function <tt>NextState</tt> is based on a simple first-order Euler step, i.e.,<br />
* new arm joint angles = (old arm joint angles) + (joint speeds) * <math> \Delta t</math><br />
* new wheel angles = (old wheel angles) + (wheel speeds) * <math>\Delta t</math><br />
* new chassis configuration is obtained from odometry, as described in Chapter 13.4<br />
<br />
'''Testing the <tt>NextState</tt> function:''' To test your <tt>NextState</tt> function, you should embed it in a program that takes an initial configuration of the youBot and simulates constant controls for one second. For example, you can set <math>\Delta t</math> to 0.01 seconds and run a loop that calls <tt>NextState</tt> 100 times with constant controls <math>(u,\dot{\theta})</math>. Your program should write a csv file, where each line has 13 values separated by commas (the 12-vector consisting of 3 chassis configuration variables, the 5 arm joint angles, and the 4 wheel angles, plus a "0" for "gripper open") representing the robot's configuration after each integration step. Then you should load the csv file into the CSV Mobile Manipulation youBot CoppeliaSim scene and watch the animation of the constant controls to see if your <tt>NextState</tt> function is working properly (and to check your ability to produce a csv file).<br />
<br />
[[Writing_a_CSV_File|'''This page''']] has information on writing csv files in Python, MATLAB, and Mathematica.<br />
<br />
'''Sample controls to try:''' Simulate the following controls for 1 second and watch the results in the CoppeliaSim capstone scene (Scene 6). The controls below are only for the wheels; you can choose the arm joint speeds as you wish.<br />
# <math>u = (10,10,10,10)</math>. The robot chassis should drive forward (in the <math>+\hat{\text{x}}_{\text{b}}</math> direction) by 0.475 meters.<br />
# <math>u = (-10,10,-10,10)</math>. The robot chassis should slide sideways in the <math>+\hat{\text{y}}_{\text{b}}</math> direction by 0.475 meters.<br />
# <math>u = (-10,10,10,-10)</math>. The robot chassis should spin counterclockwise in place by 1.234 radians.<br />
<br />
If the chassis motion is not what is described, then something is wrong with your implementation of odometry. If you are uncertain that your wheel motions and chassis motions correspond to each other, you can check out the five basic mobile base motions shown in a .zip file in [[CoppeliaSim_Introduction#Scene_4:_CSV_Animation_youBot|the CSV Animation youBot scene]].<br />
<br />
You should also check that your wheel angles and arm joint angles are being updated properly, too, but this should be easy.<br />
<br />
You should also try specifying a speed limit of 5 for the joints and wheels, then try the same tests above. Since your commanded controls exceed the speed limit, your function should properly restrict the actual speeds executed by the wheels and joints to the range [-5, 5]. As a result, the chassis should only move half the distance in these tests.<br />
<br />
'''Review material:''' This capstone project builds on material throughout the textbook "Modern Robotics: Mechanics, Planning, and Control." '''[[Modern Robotics|Click here for links to the preprint version of the textbook and the videos.]]''' Particularly relevant to this milestone are the following chapters and their associated videos:<br />
* [https://youtu.be/NcOT9hOsceE '''Chapter 13.2: Omnidirectional Wheeled Mobile Robots (Part 1 of 2)'''] (6:02)<br />
* [https://youtu.be/B1K-ti5Lqjc '''Chapter 13.2: Omnidirectional Wheeled Mobile Robots (Part 2 of 2)'''] (3:00)<br />
* [https://youtu.be/eQ9E0Zvp9jw '''Chapter 13.4: Odometry'''] (4:32)<br />
<br />
=== Milestone 2: Reference Trajectory Generation ===<br />
<br />
For this milestone you will write a function <tt>TrajectoryGenerator</tt> to generate the reference trajectory for the end-effector frame {e}. This trajectory consists of eight concatenated trajectory segments, as described above. Each trajectory segment begins and ends at rest.<br />
<br />
'''Input:'''<br />
* The initial configuration of the end-effector in the reference trajectory: <math>T_{se,\text{initial}}</math>.<br />
* The cube's initial configuration: <math>T_{sc,\text{initial}}</math>.<br />
* The cube's desired final configuration: <math>T_{sc,\text{final}}</math>.<br />
* The end-effector's configuration relative to the cube when it is grasping the cube: <math>T_{ce,\text{grasp}}</math>.<br />
* The end-effector's standoff configuration above the cube, before and after grasping, relative to the cube: <math>T_{ce,\text{standoff}}</math>. This specifies the configuration of the end-effector {e} relative to the cube frame {c} before lowering to the grasp configuration <math>T_{ce,\text{grasp}}</math>, for example. <br />
* The number of trajectory reference configurations per 0.01 seconds: <math>k</math>. The value <math>k</math> is an integer with a value of 1 or greater. Although your final animation will be based on snapshots separated by 0.01 seconds in time, the points of your reference trajectory (and your controller servo cycle) can be at a higher frequency. For example, if you want your controller to operate at 1000 Hz, you should choose <math>k=10</math> (10 reference configurations, and 10 feedback servo cycles, per 0.01 seconds). It is fine to choose <math>k=1</math> if you'd like to keep things simple.<br />
<br />
'''Outputs:'''<br />
* A representation of the <math>N</math> configurations of the end-effector along the entire concatenated eight-segment reference trajectory. Each of these <math>N</math> reference points represents a transformation matrix <math>T_{se}</math> of the end-effector frame {e} relative to {s} at an instant in time, plus the gripper state (0 or 1). For example, if your entire eight-segment trajectory takes 30 seconds, for example, you will have approximately <math>N \approx 30k/0.01</math> sequential reference configurations (perhaps one or a few more, depending on how you treat boundary conditions), each separated by <math>0.01/k</math> seconds in time. These reference configurations will be used by your controller. Your representation of the reference configurations could be anything you want. If you use an <math>N \times 13</math> matrix, for example, each of the <math>N</math> rows would represent a configuration of the end-effector frame {e} relative to {s} at that instant in time. Twelve of the 13 entries of a matrix row are the top three rows of the transformation matrix <math>T_{se}</math> at that instant of time, i.e., <math>r_{11}, r_{12}, r_{13}, r_{21}, r_{22}, r_{23}, r_{31}, r_{32}, r_{33}, p_x, p_y, p_z</math> from <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right], </math> <br />
<br />
and the 13th entry is the gripper state: 0 = open, 1 = closed. Keep in mind that opening and closing the gripper takes up to 1 second (initiated when the gripper state transitions from 0 to 1, or 1 to 0, in your csv file), so the trajectories involving opening and closing the gripper should keep the {e} frame stationary while the gripper completes its motion.<br />
<br />
* A csv file with the entire eight-segment reference trajectory. Each line of the csv file corresponds to one configuration <math>T_{se}</math> of the end-effector, expressed as 13 variables separated by commas. The 13 variables are, in order,<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
It is up to you to determine the duration of each trajectory segment, but it is recommended that each segment's duration be an integer multiple of 0.01 seconds. You could automatically choose the duration of each trajectory segment to be equal to the maximum of: the distance the origin of the {e} frame has to travel divided by some reasonable maximum linear velocity of the end-effector, and the angle the {e} frame must rotate divided by some reasonable maximum angular velocity of the end-effector. The duration of each trajectory should not be so short as to require unreasonable joint and wheel speeds.<br />
<br />
Your <tt>TrajectoryGenerator</tt> function is likely to use either <tt>ScrewTrajectory</tt> or <tt>CartesianTrajectory</tt>, from the Modern Robotics code library, to generate the individual trajectory segments. <br />
<br />
'''Testing your function:''' We have created a [[CoppeliaSim_Introduction|'''CoppeliaSim scene (Scene 8)''']] to help you test your <tt>TrajectoryGenerator</tt> function. This scene reads in your csv file and animates it, showing how the end-effector frame moves as a function of time. You should verify that your <tt>TrajectoryGenerator</tt> works as you expect before moving on with the project. [https://youtu.be/8d_cYwV58lI '''This video shows an example of a typical output of your trajectory generator function, as animated by CoppeliaSim Scene 8'''].<br />
<br />
'''Review material:''' This capstone project builds on material throughout the textbook "Modern Robotics: Mechanics, Planning, and Control." '''[[Modern Robotics|Click here for links to the preprint version of the textbook and the videos.]]''' Particularly relevant to this milestone are the following chapters and their associated videos:<br />
* [https://youtu.be/1JRMqfEm79c '''Chapters 9.1 and 9.2: Point-to-Point Trajectories (Part 1 of 2)'''] (5:40)<br />
* [https://youtu.be/0ZqeBEa_MWo '''Chapters 9.1 and 9.2: Point-to-Point Trajectories (Part 2 of 2)'''] (3:07)<br />
<br />
=== Milestone 3: Feedforward Control ===<br />
<br />
Now that you are able to simulate the motion of the robot and generate a reference trajectory for the end-effector, you are ready to begin experimenting with feedback control of the mobile manipulator. You will write the function <tt>FeedbackControl</tt> to calculate the kinematic task-space feedforward plus feedback control law, written both as Equation (11.16) and (13.37) in the textbook:<br />
<br />
<math><br />
\mathcal{V}(t) = [\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d(t) + K_p X_{\text{err}}(t) + K_i \int_0^t X_{\text{err}}(\text{t}) d\text{t}.<br />
</math><br />
<br />
'''Input:''' <br />
* The current ''actual'' end-effector configuration <math>X</math> (also written <math>T_{se}</math>).<br />
* The current end-effector ''reference'' configuration <math>X_{d}</math> (i.e., <math>T_{se,d}</math>).<br />
* The end-effector ''reference'' configuration at the next timestep in the reference trajectory, <math>X_{d,\text{next}}</math> (i.e., <math>T_{se,d,\text{next}}</math>), at a time <math>\Delta t</math> later.<br />
* The PI gain matrices <math>K_p</math> and <math>K_i</math>.<br />
* The timestep <math>\Delta t</math> between reference trajectory configurations.<br />
<br />
'''Output:'''<br />
* The commanded end-effector twist <math>\mathcal{V}</math> expressed in the end-effector frame {e}.<br />
<br />
To calculate the control law <tt>FeedbackControl</tt>, we need the current actual end-effector configuration <math>X(q,\theta)</math>, a function of the chassis configuration <math>q</math> and the arm configuration <math>\theta</math>. The values <math>(q, \theta)</math> come directly from the simulation results (Milestone 1). In other words, assume perfect sensors.<br />
<br />
The error twist <math>X_{\text{err}}</math> that takes <math>X</math> to <math>X_{d}</math> in unit time is extracted from the 4x4 <math>se(3)</math> matrix <math>[X_{\text{err}}] = \log (X^{-1} X_{d})</math>. <tt>FeedbackControl</tt> also needs to maintain an estimate of the integral of the error, e.g., by adding <math>X_{\text{err}} \Delta t</math> to a running total at each timestep. The feedforward reference twist <math>\mathcal{V}_d</math> that takes <math>X_{d}</math> to <math>X_{d,\text{next}}</math> in time <math>\Delta t</math> is extracted from <math>[\mathcal{V}_d] = (1/\Delta t) \log(X_{d}^{-1} X_{d,\text{next}})</math>. (Make sure you understand why the factor <math>(1/\Delta t)</math> is there!)<br />
<br />
The output of <tt>FeedbackControl</tt> is the commanded end-effector twist <math>\mathcal{V}</math> expressed in the end-effector frame {e}. To turn this into commanded wheel and arm joint speeds <math>(u,\dot{\theta})</math>, we use the pseudoinverse of the mobile manipulator Jacobian <math>J_e(\theta)</math>,<br />
<br />
<math><br />
\left[\begin{array}{c} u \\ \dot{\theta} \end{array} \right] = J_e^\dagger(\theta) \mathcal{V}.<br />
</math><br />
<br />
[[image:Yb-fbtest-new.png|right|500px|thumb|This figure illustrates a test for your <tt>FeedbackControl</tt> and Jacobian pseudoinverse functions. The current robot configuration <math>(q,\theta)</math> is shown, as well as the current end-effector configuration <math>X</math>, the current reference end-effector configuration <math>X_d</math>, and the reference end-effector configuration <math>X_{d,\text{next}}</math> a time <math>\Delta t</math> later.]]<br />
<br />
'''Testing your <tt>FeedbackControl</tt> function and your Jacobian pseudoinverse:''' Before moving on, it is a good idea to confirm that you are correctly calculating <math>\mathcal{V}</math> and the controls <math>(u,\dot{\theta})</math> using the Jacobian pseudoinverse. Here are some test inputs you should try:<br />
<br />
* robot configuration: <math>(\phi, x, y, \theta_1, \theta_2, \theta_3, \theta_4, \theta_5) = (0, 0, 0, 0, 0, 0.2, -\!1.6, 0)</math>, as illustrated in the figure to the right. In other words, all configuration variables are zero except arm joint angle 3, which is 0.2 radians, and arm joint angle 4, which is -1.6 radians.<br />
* <math>X_d = \left[\begin{array}{cccc} 0 & 0 & 1 & 0.5 \\ 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & 0.5 \\ 0 & 0 & 0 & 1\end{array}\right]</math><br />
* <math>X_{d,\text{next}} = \left[\begin{array}{cccc} 0 & 0 & 1 & 0.6 \\ 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & 0.3 \\ 0 & 0 & 0 & 1\end{array}\right]</math><br />
* <math>X = \left[\begin{array}{cccc} 0.170 & 0 & 0.985 & 0.387 \\ 0 & 1 & 0 & 0 \\ -0.985 & 0 & 0.170 & 0.570 \\ 0 & 0 & 0 & 1\end{array}\right]</math> (this is calculated from the robot configuration given above)<br />
* <math>K_p</math> and <math>K_i</math> matrices are zero matrices<br />
* <math>\Delta t = 0.01</math><br />
<br />
With these inputs, your program should give you<br />
<br />
* <math>\mathcal{V}_d = (0,0,0,20,0,10)</math><br />
* <math>[\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d = (0,0,0,21.409,0,6.455)</math><br />
* <math>\mathcal{V} = (0,0,0,21.409,0,6.455)</math><br />
* <math>X_{\text{err}} \, = (0,0.171,0,0.080,0,0.107)</math><br />
* increment to the numerical integral of the error should be <math>X_{\text{err}} * \Delta t</math><br />
* <math>J_e = \left[\begin{array}{ccccccccc} 0.030 & -0.030 & -0.030 & 0.030 & -0.985 & 0 & 0 & 0 & 0 \\<br />
0 & 0 & 0 & 0 & 0 & -1 & -1 & -1 & 0 \\<br />
-0.005 & 0.005 & 0.005 & -0.005 & 0.170 & 0 & 0 & 0 & 1 \\<br />
0.002 & 0.002 & 0.002 & 0.002 & 0 & -0.240 & -0.214 & -0.218 & 0 \\<br />
-0.024 & 0.024 & 0 & 0 & 0.221 & 0 & 0 & 0 & 0 \\<br />
0.012 & 0.012 & 0.012 & 0.012 & 0 & -0.288 & -0.135 & 0 & 0 \end{array}\right]</math><br />
* <math>(u,\dot{\theta}) = (157.2,157.2,157.2,157.2,0,-652.9,1398.6,-745.7,0)</math><br />
<br />
Looking at the figure, these results should make sense to you. The feedforward twist <math>\mathcal{V}_d</math>, from <math>X_d</math> to <math>X_{d,\text{next}}</math>, should only have nonzero linear components, since the orientation of both frames is the same; these linear components should be in the x and z directions of the <math>X_d</math> frame; and the component in the x direction should be larger. Expressing this twist in the current frame of the end-effector at <math>X</math>, <math>[\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d</math>, shows us that there are still only x and z components, but the component in the <math>X</math> frame's x direction is a bit larger and the component in the z direction is a bit smaller. Since the feedback gains are zero, the commanded twist <math>\mathcal{V}</math> is just <math>[\text{Ad}_{X^{-1} X_d}] \mathcal{V}_d</math>. The error <math>X_{\text{err}}</math> (from <math>X</math> to <math>X_d</math>) shows us that, to drive <math>X</math> to <math>X_d</math>, we must rotate in the positive direction about <math>\hat{\text{y}}_{\text{e}}</math> and move linearly in the <math>\hat{\text{x}}_{\text{e}}</math> and <math>\hat{\text{z}}_{\text{e}}</math> directions. Finally, the calculated controls <math>u</math> drive the wheels forward at equal speed (so the chassis translates forward) and only arm joints 2, 3, and 4 rotate, since joints 1 and 5 do not help generate <math>\mathcal{V}</math>. '''Note: The joint speeds in this illustrative example are unreasonably large!'''<br />
<br />
If your <math>K_p</math> matrix is the identity matrix instead of zero, then you should get <math>\mathcal{V} = (0,0.171,0,21.488,0,6.562)</math> and <math>(u,\dot{\theta}) = (157.5,157.5,157.5,157.5,0,-654.3,1400.9,-746.8,0)</math>. <br />
<br />
If you don't get these results, you should correct your program before moving on.<br />
<br />
'''Singularities:''' If the 6x9 Jacobian matrix <math>J_e</math> is singular (i.e., its rank drops below 6) or nearly singular, the pseudoinverse algorithm may generate a pseudoinverse <math>J_e^\dagger</math> with unreasonably large entries, which could lead to unacceptably large commanded joint speeds if we ask for even a very small component of a twist in a direction that the near-singularity nearly prevents. A better behavior for the robot would be to essentially ignore any requested twist components in directions that the near-singularity renders difficult to achieve. To achieve this in MATLAB and Mathematica, you may wish to explore the tolerance options for the pseudoinverse algorithm. The tolerance option allows you to specify how close to zero a singular value must be to be treated as zero. By treating small singular values (that are greater than the default tolerance) as zero, you will avoid having pseudoinverse matrices with unreasonably large entries. A MATLAB example is shown below:<br />
<br />
>> M = [[2,0];[0,0.00001]] % a matrix that's nearly singular<br />
M =<br />
2.000000 0<br />
0 0.000010<br />
<br />
>> s = svd(M) % confirming that the singular values are 2 and 1e-5, i.e., the 2nd singular value is very small<br />
s =<br />
2.000000<br />
0.000010<br />
<br />
>> Mp = pinv(M) % the default MATLAB pseudoinverse treats the 2nd singular value as nonzero; Mp has nonzero entries of 0.5 and 100,000<br />
Mp =<br />
1.0e+05 *<br />
0.000005 0<br />
0 1.000000<br />
<br />
>> Mptol = pinv(M,1e-4) % tell pinv to treat singular values less than 0.0001 as zero; Mptol has no large entries<br />
Mptol =<br />
0.500000 0<br />
0 0<br />
<br />
(You may find it better to use an even larger tolerance than 1e-4, e.g., 1e-3 or 1e-2. Experiment!) <br />
In any case, you should always place "reasonable" limits on the maximum speeds for the robot joints and wheels, to mimic the limitations of a real robot and to prevent the simulated robot from moving wildly. Other methods have been proposed in the robotics literature to deal with the nearly-singular-Jacobian issue. Feel free to experiment with other methods if you wish.<br />
<br />
'''Why does the robot arm always seem to approach a singularity?''' You may notice that your controller tends to make the robot arm approach a singularity (e.g., straighten out) before the wheels move much to help move the end-effector. Why do you think this is? Think about the properties of the pseudoinverse. How does it extract a single solution <math>x = A^\dagger b</math> to the equation <math> Ax = b</math> when there are many solutions <math>x</math>? How would things change if the wheels had a much larger radius?<br />
<br />
'''Implementing joint limits to avoid self-collisions and singularities (optional, but recommended):''' Until now, we have not implemented joint limits, so you can easily command robot configurations that result in self-collision, i.e., the arm links intersect each other or the mobile base. You can also command the robot arm to come close to a singularity, e.g., by making the angles of joints 3 and 4 zero (or nearly zero). Singularities like this can cause a problem when you are tracking trajectories specified in terms of the motion of the end-effector (see the discussion above).<br />
<br />
To avoid these problems, you can implement joint limits. For example, you could constrain joints 3 and 4 to always be less than <math>-0.2</math> radians (or so). The arm will avoid singularities occurring when joints 3 or 4 are at the zero angle, but it will still be able to perform many useful tasks, such as the block pick-and-place task of this capstone. To avoid self-collisions, you can use the arm joint angle sliders in [[CoppeliaSim_Introduction#Scene_3:_Interactive_youBot|Scene 3: Interactive youBot]] to approximately find the joint-angle combinations that avoid self-collision. Your approximation should be conservative, meaning that allowed configurations are never in self-collision. But it should not be so conservative that the arm's workspace is overly constrained, preventing the robot from doing useful work. <br />
<br />
With these joint limits, you could write a function called <tt>testJointLimits</tt> to return a list of joint limits that are violated given the robot arm's configuration <math>\theta</math>.<br />
<br />
You should make sure that your robot's initial configuration satisfies all the joint limits. Then, each time you calculate your wheel and arm joint speeds <math>(u,\dot{\theta})</math> using the pseudoinverse <math>J_e^\dagger</math>, use <tt>testJointLimits</tt> to check if the new configuration at a time <math>\Delta t</math> later will violate the joint limits. If so, you should recalculate the controls <math>(u,\dot{\theta})</math>, by first changing the Jacobian <math>J_e</math> to indicate that the offending joint(s) should not be used---the robot must use other joints (if possible) to generate the desired end-effector twist <math>\mathcal{V}</math>. To recalculate the controls, change each column of <math>J_e</math> corresponding to an offending joint to all zeros. This indicates that moving these joints causes no motion at the end-effector, so the pseudoinverse solution will not request any motion from these joints.<br />
<br />
This method is simple, but there are other ways to avoid joint limits. If you use a different approach, be sure to document it in your final README file.<br />
<br />
'''Tip from a Coursera student!''' "Try making a version that avoids joint limits and self-collisions! I recommend making a new function other than <tt>testJointLimits</tt> to see the difference between your original code and the enhanced code. Use the original code to find a trajectory which causes the robot to self collide and then use the enhanced one. It's pretty easy and fun to watch."<br />
<br />
'''The full program:''' Now write your full program, according to the input specifications at the top of this page. Your program should first generate a reference trajectory using <tt>TrajectoryGenerator</tt> and set the initial robot configuration, a 13-vector as described earlier on this page:<br />
<br />
chassis phi, chassis x, chassis y, J1, J2, J3, J4, J5, W1, W2, W3, W4, gripper state<br />
<br />
Now the program enters a loop that loops through the reference trajectory generated by <tt>TrajectoryGenerator</tt>. If the reference trajectory has <math>N</math> reference configurations, the loop runs <math>N-1</math> times. For example, the 10th time through the loop, the controller uses the 10th configuration of the reference trajectory as <math>X_d</math> and the 11th configuration as <math>X_{d,\text{next}}</math> to calculate the feedforward twist <math>\mathcal{V}_d</math>. <br />
<br />
Each time through the loop, you <br />
* calculate the control law using <tt>FeedbackControl</tt> and generate the wheel and joint controls using <math>J_e^\dagger(\theta)</math>; <br />
* send the controls, configuration, and timestep to <tt>NextState</tt> to calculate the new configuration; <br />
* store every <math>k</math>th configuration for later animation (note that the reference trajectory has <math>k</math> reference configurations per 0.01 second step, as described in Milestone 2; you may choose <math>k=1</math> for simplicity); and <br />
* store every <math>k</math>th <math>X_{\text{err}}</math> 6-vector, so you can later plot the evolution of the error over time.<br />
<br />
Once the program has completed all iterations of the loop, it should write out the csv file of configurations. If the total time of motion of the youBot is 15 seconds, your csv file should have 1500 lines (or 1501 lines), corresponding to 0.01 seconds between each configuration. Load the csv file into the CSV Mobile Manipulation youBot scene (Scene 6) to see the results. Your program should also generate a file with the log of the <math>X_{\text{err}}</math> 6-vector as a function of time, suitable for plotting by your favorite plotting software.<br />
<br />
'''Testing feedforward control:''' You should make sure feedforward control works as you expect before testing feedback control. Choose an initial configuration of the robot that puts the end-effector exactly at the configuration at the beginning of the reference trajectory. Run your program with <math>K_p = K_i = 0</math>, i.e., feedforward control only. This should result in a csv file which, when played through the mobile manipulation capstone scene, drives the robot to pick up the block and put it down at the desired configuration. (Or at least it should come very close to doing so! Small numerical error in the integration will be fixed when you add a feedback controller.) If not, time to start debugging! Your end-effector reference trajectory must be correct, if you already tested Milestone 2. So now you have to figure out why the wheel and arm controls your feedforward controller and Jacobian pseudoinverse are generating do not drive the end-effector along the reference trajectory. (You could try removing joint speed limits if these are preventing the robot from following the planned trajectory, or increase the time of the trajectory so large joint speeds are not needed to follow the trajectory.)<br />
<br />
You should also try starting the end-effector with some initial error from the reference trajectory, but still only use feedforward control. See how the end-effector moves under these circumstances. Does it make sense to you?<br />
<br />
Do not move on with the project until your feedforward control works as you expect. Otherwise the effects of PI feedback control will only further confuse the situation.<br />
<br />
'''The physics engine in CoppeliaSim:''' By default, Scene 6 (the capstone mobile manipulation scene) uses a simulation timestep of dt = 10 ms and the physics engine ODE. You should keep the timestep at 10 ms for simulated time to be correct, and we have found ODE to yield more easily understood results than Bullet for Scene 6. But you are welcome to try different physics engines if you'd like; specify your choice in the CoppeliaSim GUI. Keep in mind that simulation of bodies in contact is computationally intensive, and approximate solution methods could lead to unexpected behavior, like the block slipping in the grasp. We don't have a suggested "fix" for this; if you want to learn about how physics engines work, and the various approximations they make, you are encouraged to consult the documentation for [http://www.ode.org/ ODE] and [http://bulletphysics.org/wordpress/ Bullet].<br />
<br />
'''Review material:''' This capstone project builds on material throughout the textbook "Modern Robotics: Mechanics, Planning, and Control." '''[[Modern Robotics|Click here for links to the preprint version of the textbook and the videos.]]''' Particularly relevant to this milestone are the following chapters and their associated videos:<br />
* [https://youtu.be/27jUrkFdyks '''Chapter 4.1.2: Product of Exponentials Formula in the End-Effector Frame'''] (4:41)<br />
* [https://youtu.be/69HeL2XvL9Y '''Chapter 5.1.2: Body Jacobian'''] (4:51)<br />
* [https://youtu.be/WuhEEidkes8 '''Chapter 11.3: Motion Control with Velocity Inputs (Part 3 of 3)'''] (4:29)<br />
* [https://youtu.be/1MgpqD7v2x0 '''Chapter 13.5: Mobile Manipulation'''] (6:19)<br />
<br />
=== Final Step: Completing the Project and Your Submission ===<br />
<br />
Now that feedforward control is working, you are ready to complete your project. Use the default initial and goal configurations for the cube in the capstone CoppeliaSim scene, i.e., the initial cube configuration is at <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the final cube configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>. Let the initial configuration of the end-effector reference trajectory be at<br />
<br />
<math><br />
T_{se} = \left[\begin{array}{cccc} <br />
0 & 0 & 1 & 0 \\ <br />
0 & 1 & 0 & 0 \\<br />
-1 & 0 & 0 & 0.5 \\<br />
0 & 0 & 0 & 1 \end{array}\right]<br />
</math><br />
<br />
Choose an initial configuration of the youBot so that the end-effector has at least 30 degrees of orientation error and 0.2 m of position error. Try executing the feedforward controller (<math>K_p = K_i = 0</math>) and play the resulting csv file through the CoppeliaSim capstone scene to see what happens.<br />
<br />
Now add a positive-definite diagonal proportional gain matrix <math>K_p</math> while keeping the integral gains zero. You can keep the gains "small" initially so the behavior is not much different from the case of feedforward control only. As you increase the gains, can you see some corrective effect due to the proportional control?<br />
<br />
Eventually you will have to design a controller so that essentially all initial error is driven to zero by the end of the first trajectory segment; otherwise, your grasp operation may fail.<br />
<br />
Once you get good behavior with feedforward-plus-P control, try experimenting with other variants: P control only; PI control only; and feedforward-plus-PI control. <br />
<br />
'''What to submit:''' You will submit a single .zip file of a directory with the following contents:<br />
# '''A file called README.txt or README.pdf.''' This file should briefly explain your software and your results. If you needed to follow a different approach to solve the problem than the one described above, explain why and explain your solution method. If you encountered anything surprising, or if there is something you still don't understand, or if you think an important point is neglected in the description of the project on this page, explain it. If you implemented singularity avoidance, joint limit avoidance, or any other enhancement over the basic project description given on this page, explain your method. You may also wish to include more results in the three results directories described below, showing the results when using your enhancements vs. when you don't use your enhancements, to highlight the value of your enhancements.<br />
# '''Your commented code in a directory called "code."''' Your code should be commented, so it is clear to the reader what the code is doing. No need to go overboard with too many comments, but keep in mind your reviewer may not be fluent in your programming language. Your code comments must include an example of how to use the code. Only turn in functions that you wrote or modified; you don't need to turn in other MR functions that your code uses. If your code is in MATLAB or Python, just turn in the source files (text files) with your functions. If your code is in Mathematica, turn in (a) your .nb notebook file and (b) a .pdf printout of your code, so a reviewer can read your code without having to have the Mathematica software. <br />
# '''A directory called "results" with the results of your program.''' This directory should contain three directories: one titled "best," one titled "overshoot," and one titled "newTask." The directories "best" and "overshoot" both solve a pick-and-place task where the initial and final configurations of the cube are at the default locations in the capstone CoppeliaSim scene, i.e., the initial block configuration is at <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the final block configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>. The directory "newTask" should have different initial and final block configurations, which you are free to choose yourself. In all cases, the initial configuration of the end-effector should have at least 30 degrees of orientation error and 0.2 m of position error from the first configuration on the reference trajectory. The directory "best" should contain results using a well-tuned controller, either feedforward-plus-P or feedforward-plus-PI. The convergence exhibited by the controller does not necessarily have to be fast (in fact, it is more interesting if the convergence is not too fast, so the transient response is clearly visible), but the motion should be smooth, with no overshoot, and very little error by partway through trajectory segment 1. The directory "overshoot" should contain the results using a less-well-tuned controller, one that exhibits overshoot and a bit of oscillation. Nonetheless, the error should be eliminated before the end of trajectory segment 1. Your controller for "overshoot" will likely be feedforward-plus-PI or just PI. You can use any controller to solve the "newTask" task. In each of the three directories, give:<br />
## A very brief README.txt or README.pdf file that indicates the type of controller, the feedback gains, and any other useful information about the results. For the "newTask" directory, indicate the initial and goal configurations for the cube.<br />
## The CoppeliaSim .csv file produced by your program when it is called with the input from the log file.<br />
## A video of your .csv file being animated by the CoppeliaSim scene.<br />
## The <math>X_{\text{err}}</math> data file produced by your program.<br />
## A plot of the six elements of <math>X_{\text{err}}</math> as a function of time, showing the convergence to zero. This plot should '''not''' require any special software (e.g., MS excel) to be viewable. In other words, you should save it as a .pdf or other freely-viewable format.<br />
## A log file showing your program being called with the input. In MATLAB, for example, this log file could be something like: <br />
>> runscript<br />
Generating animation csv file.<br />
Writing error plot data.<br />
Done.<br />
>><br />
:::In this case, the file/function "runscript" contains the data for the program and actually invokes the program, and you should include the file "runscript". It is recommended that your program provide some simple feedback to the user, like "Generating animation csv file. Writing error plot data. Done." or similar, but it is not strictly necessary.<br />
<br />
'''Project grading.''' Your project will be graded on the clarity and correctness of your README files and your code. Your "results" directories will be graded on their correctness, including the quality of your videos and whether your error plots show reasonable convergence to zero.<br />
<br />
'''If you succeed in this project, congratulations!''' You have integrated concepts from all five previous Modern Robotics courses in a fairly sophisticated piece of software.<br />
<br />
== Other Things to Try ==<br />
<br />
You could imagine other approaches to solving the mobile manipulator pick-and-place problem, instead of just planning a trajectory for the end-effector and using feedback control to track it. For example, you could use an obstacle-avoiding motion planner to plan a reference trajectory for the entire robot, not just the end-effector. You could incorporate joint limits for the robot arm. You could use a weighted pseudoinverse, instead of the standard pseudoinverse, to indicate a preference to use wheel or joint motions. You could actively avoid singularities of the arm. You could decide to keep the mobile base stationary during trajectory segments 2, 4, 6, and 8.<br />
<br />
If you have other ideas on better ways to approach the mobile manipulation problem, feel free to mention them in a discussion prompt or your main README file.<br />
<br />
If you are interested, you could delve more deeply into CoppeliaSim, for example by changing the respondability or dynamic properties of rigid bodies. If you make the youBot chassis respondable, the youBot's chassis can push the block around.<br />
<br />
'''For fun:''' See if you can plan and execute a trajectory for the robot arm that causes the gripper to throw the block to a desired landing point!</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Sampling-Based_PlanningSampling-Based Planning2020-01-25T07:22:06Z<p>Lynch: </p>
<hr />
<div>This page describes the Sampling-Based Planning project from the Coursera course "Modern Robotics, Course 4: Robot Motion Planning and Control."<br />
<br />
[[image:motion_planning_scene.png|right|thumb|x250px|The environment for motion planning for a point robot moving in the plane.]]<br />
<br />
===Introduction===<br />
In this programming assignment, you will implement a sampling-based planner, either an RRT or a PRM, to find a path for a point robot through the cluttered planar environment shown on the right.<br />
<br />
Your project will be graded on:<br />
* An evaluation of your description of your planner. It will be graded on clarity and completeness.<br />
* An evaluation of your source code, including its clarity for the reader.<br />
* The correctness of your code's output, according to the specification below.<br />
* The correctness of your CoppeliaSim screenshot of your solution path on the graph.<br />
<br />
===Details===<br />
<br />
In this assignment you will use the same CoppeliaSim visualization scene as in the previous assignment, [[CoppeliaSim Introduction|the csv motion planning kilobot scene]] (Scene 5). You have the choice of programming either an RRT or a PRM to find a path for a point robot moving in a plane among the obstacles shown in the image at the right. <br />
<br />
[[Media:planning_coursera.zip|'''You can download the files for this obstacle-cluttered environment in the zipped folder here.''']] Only the obstacles.csv file is relevant, since it is the input to your planner. The other files in the folder, nodes.csv, edges.csv, and path.csv, are placeholders; your program should write these files as output. The information in the obstacles.csv file is also replicated below:<br />
<br />
0.0, 0.0, 0.2<br />
0.0, 0.1, 0.2<br />
0.3, 0.2, 0.2<br />
-0.3, -0.2, 0.2<br />
-0.1, -0.4, 0.2<br />
-0.2, 0.3, 0.2<br />
0.3, -0.3, 0.2<br />
0.1, 0.4, 0.2<br />
<br />
<br clear=all><br />
<br />
Your program will choose its own random samples in the (x, y) C-space, which is the square [-0.5, 0.5] x [-0.5, 0.5]. You will also employ a straight-line planner as the local planner, regardless of whether you use the RRT or PRM. The distance between two configurations is simply the Euclidean distance <math>\sqrt{(x_1-x_2)^2 + (y_1-y_2)^2}</math>. <br />
<br />
The start configuration is at (x, y) = (-0.5, -0.5), the bottom left corner of the square environment, and the goal configuration is at (x, y) = (0.5, 0.5), the top right corner of the square environment.<br />
<br />
You are responsible for collision checking. Given a straight line segment from (x1, y1) to (x2, y2), you must write your own collision checker to see if the line segment intersects a circle (all the obstacles are circles). This is a fairly simple mathematical exercise. If your solution involves finding the intersection of a line with a circle (there are 0, 1, or 2 intersections), make sure to test if the intersection(s) are within the length of the line segment! A less desirable, but still acceptable, solution could test sample points finely on the line segment between (x1, y1) and (x2, y2). You should treat the robot as a point; in other words, if the radius of the robot is actually <math>r</math> and the radius of an obstacle is <math>R</math>, you can assume the radius of the robot has been shrunk to 0 and the radius of the obstacle has been grown to <math>R+r</math>.<br />
<br />
Your program should take as input the obstacles.csv file that you created by cutting and pasting the obstacle description above. The output of your program should be three files: nodes.csv, edges.csv, and path.csv. ([[Writing_a_CSV_File|'''This page''']] has information on writing csv files in Python, MATLAB, and Mathematica.) All of these should be in the format described on the wiki page for the csv motion planning kilobot scene. When you put your input file and your three output files in a directory (named "results," for example), then when you call the CoppeliaSim scene with this directory as input, you should see the obstacles, your graph or tree, and the solution path, as well as an animation of the motion.<br />
<br />
You may optionally have another input file, perhaps called "parameters.csv" or "parameters.txt," that contain other input to your motion planner. Examples of such input could be the number of nodes to create in a PRM graph or the likelihood (as a percentage) that an RRT "random" sample is chosen as the goal node (to attempt to complete the motion planning problem). <br />
<br />
'''Your program will not be judged on efficiency!''' Ideally you would employ efficient data structures and algorithms to find the nearest nodes to a given configuration, or to check whether a given straight-line path collides with an obstacle. But the point of this assignment is to demonstrate your understanding of the motion planning technique, not to demonstrate mastery of efficient programming, nor to write software that runs quickly on large problems. For example, to find the nearest node to a particular configuration, you could simply calculate the distance to each of the nodes.<br />
<br />
'''However, your program will be judged on clarity!''' Remember that your code may be reviewed by someone unfamiliar with your programming language. Also, you must write your code modularly with multiple functions. For example, a function for testing whether a path from (x1, y1) to (x2, y2) is in collision with any obstacle could call another function which checks if it is in collision with a specific circular obstacle. This single-obstacle collision-detection function could then call a function that returns the intersection points of a line with a circle, then another function that checks if these intersections (if they exist) belong to the line segment or are on the line containing the line segment but are outside the segment.<br />
<br />
===If you choose to program an RRT===<br />
<br />
''Sampling'': You are free to choose your sampling method, though sampling from a uniform random distribution over the square [-0.5, 0.5] x [-0.5, 0.5] is a good choice. Every so often, perhaps 10% of the time (this is up to you, though), your sample should be at the goal configuration, to see if you can connect your tree to the goal.<br />
<br />
''Finding the nearest node to a sampled configuration'': As mentioned above, you can simply test the Euclidean distance to all nodes in the tree.<br />
<br />
''Local planner'': By default the local planner should be a straight-line planner, from the closest node to the sampled configuration. If you decide to do something else, clearly document it.<br />
<br />
===If you choose to program a PRM===<br />
<br />
If you decide to use a PRM planner, where you first build a graph representing the C-space before searching it, you should use the A* search you wrote for the previous assignment, the weight between nodes should be the Euclidean distance between the nodes, and the optimistic cost-to-go from a node should be the Euclidean distance to the goal configuration.<br />
<br />
''Phase 1, sampling'': You are free to choose your sampling method, though sampling from a uniform random distribution over the square [-0.5, 0.5] x [-0.5, 0.5] is a good choice. Since you will always use the same start and goal configurations, as described above, you should also choose samples at these configurations, so they are built into the tree. It is up to you to choose the number of nodes in your graph, but you should choose enough that the start and goal are likely to be in the same connected component of the graph.<br />
<br />
''Phase 2, creating edges'': It is up to you to choose the number of neighbors <math>k</math> to try to connect to each node.<br />
<br />
''Phase 3, searching the graph'': You should use A* search.<br />
<br />
===What to submit===<br />
<br />
Once your program is working, and you are able to consistently find solutions to the path planning problem, '''you will submit a single .zip file with the following contents''':<br />
#'''A README file, preferably as a plain text .txt file or as a .pdf file.''' This file should describe your solution to the motion planning problem: your choice of an RRT or PRM, decisions you made in your implementation, information on any supplementary files the planner needs as input (other than obstacles.csv), and any other comments that help the reader understand your solution. This file should typically be one page or less.<br />
#'''Your commented code in a directory called "code."''' Your code should be lightly commented, so it is clear to the reader what the code is doing. No need to go overboard, but keep in mind your reviewer may not be fluent in your programming language. Your code comments must include an example of how to use the code. You can write your program in any language, provided it is clearly structured, reasonably modular, easy to understand for a reader with no experience in your programming language, and with sufficient comments. Your program can span multiple files, or it can be a single file, if appropriate. If your code is in Mathematica, turn in (a) your .nb notebook file and (b) a .pdf printout of your code, so a reviewer can read your code without having to have the Mathematica software.<br />
#'''A directory called "results" with (at least) four files in it: nodes.csv, edges.csv, obstacles.csv, and path.csv.''' Your results directory should include the obstacles.csv input file as well as output files nodes.csv, edges.csv, and path.csv produced by your planner. These output files must correspond to the screenshot you submit. Your results directory can optionally have another file or files with other input needed by your planner, provided these files are clearly described in the README.<br />
#'''A CoppeliaSim screenshot of your solution path on the graph/tree.''' The graph among the obstacles should be clearly visible.<br />
#'''(OPTIONAL) A second results folder (e.g., "results-extra") with another interesting motion planning problem, its solution, and a CoppeliaSim screenshot.'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/A*_Graph_Search_ProjectA* Graph Search Project2020-01-25T07:17:45Z<p>Lynch: </p>
<hr />
<div>This page describes the A* Graph Search Project from the Coursera course "Modern Robotics, Course 4: Robot Motion Planning and Control."<br />
<br />
[[image:Astar-search.png|right|x200px]]<br />
<br />
===Introduction===<br />
In this programming assignment, you will implement A* search. Given a graph, the start node, and the goal node, your program will search the graph for a minimum-cost path from the start to the goal. Your program will either return a sequence of nodes for a minimum-cost path or indicate that no solution exists.<br />
<br />
Your assignment will be graded based on:<br />
* An evaluation of your source code, including its clarity for the reader.<br />
* The correctness of your code's output, according to the specification below.<br />
* The correctness of your CoppeliaSim screenshot of your solution.<br />
<br />
===Downloading and testing the needed CoppeliaSim files===<br />
<br />
First you should read about the CoppeliaSim simulator scene [[CoppeliaSim Introduction|"CSV Motion Planning Kilobot"]] (Scene 5) on the Modern Robotics wiki. You should then download the associated .ttt CoppeliaSim scene file and the .zip file with sample input to the scene. When you extract the .zip file, you will have a folder with four files inside: nodes.csv (describing the nodes of the graph), edges.csv (describing the edges of the graph), path.csv (describing a solution path), and obstacles.csv (describing cylindrical obstacles, just for visualization purposes). Read the wiki (and the files themselves, which have comments) for more information on the formats of these files.<br />
<br />
Play the scene in CoppeliaSim and choose the folder with the four files as the input. When you press the "play" button on the interface, you will see a display of the graph, the obstacles, and a path through the graph. You will also see a small mobile robot, a swarm robot called a kilobot, travel along the path. Make sure you can do this before moving on with the rest of the assignment.<br />
<br />
In this assignment, you will create a program that implements A* search to find a minimum-cost path through an undirected graph. You will use the CoppeliaSim scene to visualize the graph and the solution path found by your program. ''Although the nodes of your graph are assigned (x,y) coordinates in a plane for visualization purposes (and the solution is animated by a planar mobile robot), the A* graph search you will implement is for fully general undirected weighted graphs.'' As such, the nodes could represent configurations in arbitrary C-spaces, such as the six-dimensional C-space of the rigid chassis of a spacecraft flying among asteroids. We visualize the nodes of the graph as points in a plane, for simplicity.<br />
<br />
===Writing your program===<br />
<br />
You will write a program that takes two files as input, nodes.csv and edges.csv, and produces a single file as output, path.csv. You can test your program on the nodes.csv and edges.csv file that you downloaded from the Modern Robotics wiki, to make sure that your code is working properly.<br />
<br />
The sample nodes.csv and edges.csv files on the wiki have comments in them. All lines beginning with the hashtag character # are ignored. You can write your software to handle comments such as these, or you can assume that the input files have no comments. In the latter case, you will need to delete the comments from the nodes.csv and edges.csv file before using them to test your code.<br />
<br />
You can write your program in any language, provided your program is clearly structured, reasonably modular, easy to understand for a reader with no experience in your programming language, and with sufficient comments. Your program can span multiple files, or it can be a single file, if appropriate.<br />
<br />
If there are N nodes, numbered 1...N in nodes.csv, you can assume that node 1 is the start node and node N is the goal node. Your output file path.csv should be a single line of the form<br />
<br />
1, node2, node3, ..., N<br />
<br />
indicating that the solution path goes from nodes numbered 1, to node2, to node3, etc., finally to N. Your program must find the proper node numbers for node2, node3, etc. The solution path should minimize the sum of the edge costs among all possible paths from node 1 to node N, where the edge costs are given in the edges.csv file. If there is no solution, your output file can be simply<br />
<br />
1<br />
<br />
indicating that the robot does not go anywhere.<br />
<br />
To see the results of your planner, call the CoppeliaSim scene with the nodes.csv and edges.csv file you used as input, the path.csv file that your program wrote as output, and an obstacles.csv file (which is not needed by your program). The obstacles .csv file can be empty if you don't want to visualize obstacles.<br />
<br />
[[Writing_a_CSV_File|'''This page''']] has information on writing csv files in Python, MATLAB, and Mathematica.<br />
<br />
===Data structures, algorithms, and computational efficiency===<br />
<br />
This project is a more extensive programming project than you have done before in the Coursera Modern Robotics specialization. Even if you have not had a lot of programming experience, you should still be able to complete the project based on the A* description in the book. <br />
<br />
You will have to make decisions about how to implement data structures such as OPEN, CLOSED, the graph edges, the past costs, and the search trees. You will also have to decide how to implement certain algorithms on these data structures, such as inserting nodes into the sorted list OPEN. Decisions you make about this will affect the efficiency of your implementation (e.g., the amount of memory needed to store your data, or the amount of time it takes to perform certain operations). '''However, your assignment will not be graded on efficiency.''' You are free to simply use two-dimensional matrices and one-dimensional arrays to represent your data and to use inefficient algorithms on them (e.g., for inserting nodes in the sorted list OPEN). <br />
<br />
For large search problems, efficiency matters, but this is not a computer science course, and there are no prerequisites in data structures or algorithms, so our focus is on understanding the ideas of A* graph search and correctness of the implementation, not efficiency.<br />
<br />
You may also have to choose a maximum number of nodes for your implementation. You can make any reasonable assumption (e.g., at least 100 nodes).<br />
<br />
===What to submit===<br />
<br />
Once your program is producing correct output, you are ready to assemble your documents for submission. '''You will submit a single .zip file of a directory with the following contents:'''<br />
<br />
#'''Your commented code in a directory called "code."''' Your code should be lightly commented, so it is clear to the reader what the code is doing. No need to go overboard, but keep in mind your reviewer may not be fluent in your programming language. Your code comments must include an example of how to use the code. You can write your program in any language, provided it is clearly structured, reasonably modular, easy to understand for a reader with no experience in your programming language, and with sufficient comments. Your program can span multiple files, or it can be a single file, if appropriate. If your code is in Mathematica, turn in (a) your .nb notebook file and (b) a .pdf printout of your code, so a reviewer can read your code without having to have the Mathematica software.<br />
#'''A directory called "results" with four files in it: nodes.csv, edges.csv, obstacles.csv, and path.csv.''' The nodes.csv file and edges.csv file should be readable by your program. The nodes.csv file should be identical to the sample nodes.csv file you downloaded, except you can delete the comments if your code does not handle files with comments. The edges.csv file should also be identical to the sample edges.csv file (perhaps without the comments) '''except the edge from node 4 to node 7 should be deleted''', to change the graph from the original graph. The obstacles.csv file should be identical to the sample file you downloaded from the wiki. The path.csv file should be the unmodified output of your program when taking nodes.csv and edges.csv as input.<br />
#'''A CoppeliaSim screenshot of your solution path on the graph.''' The graph among the obstacles should be clearly visible.<br />
#'''(OPTIONAL) A plain text file called "README.txt" or other explanatory file.''' This has any other information that may help the reviewer understand your submission.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Coursera_ResourcesCoursera Resources2020-01-25T07:15:44Z<p>Lynch: </p>
<hr />
<div>Most resources for the six-course '''[https://www.coursera.org/specializations/modernrobotics Coursera Modern Robotics Specialization]''' are hosted on Coursera, but some are more conveniently collected on this wiki.<br />
<br />
== General (All Courses) ==<br />
<br />
===Things you should complete before taking any course===<br />
<br />
* [[Modern Robotics#Book|Buy the book or download the free preprint version]]<br />
* [[Getting Started with the Modern Robotics Code Library]]<br />
* [[Getting Started with the CoppeliaSim Simulator]]<br />
<br />
===General references===<br />
<br />
* [http://modernrobotics.org The Modern Robotics wiki], which includes a link to purchase the published hardback (Cambridge University Press) or to download a pdf of the book preprint. This site also has book errata, the Modern Robotics (MR) code library (in Mathematica, MATLAB, and Python), CoppeliaSim robot simulator, CoppeliaSim simulation scenes, and other information.<br />
* [[CoppeliaSim Introduction|Introduction to CoppeliaSim and sample CoppeliaSim scenes used in the Specialization]]<br />
* [[Writing_a_CSV_File|This page has information on writing csv files in Python, MATLAB, and Mathematica, useful for some of the CoppeliaSim scenes]]<br />
* [[Modern_Robotics#Book|Direct link to the book preprint, including Appendix A, Summary of Useful Formulas]]<br />
* [[Modern_Robotics_Errata|Errata (if you see an error not already reported, please report it!)]]<br />
* [https://github.com/NxRLab/ModernRobotics MR Code Library]<br />
* [http://www.coppeliarobotics.com/ CoppeliaSim robot simulator]<br />
<br />
===Prerequisite refresher readings===<br />
<br />
* '''[[Modern Robotics Linear Algebra Review|A linear algebra refresher appendix to accompany the book.]]''' (other references: [https://www.math.ucdavis.edu/~linear/linear-guest.pdf online textbook],[http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3274/pdf/imm3274.pdf useful matrix identities], [https://en.wikipedia.org/wiki/Positive-definite_matrix positive-definite matrices], [https://en.wikipedia.org/wiki/Ellipsoid ellipsoids and their relationship to positive-definite matrices], [https://en.wikipedia.org/wiki/Complex_number complex numbers])<br />
* [https://www.math.hmc.edu/calculus/index.html Calculus]<br />
* [https://en.wikipedia.org/wiki/Linear_differential_equation Basic differential equations]<br />
* Mechanics ([https://authors.library.caltech.edu/25023/1/Housner-HudsonDyn80.pdf online textbook], [https://en.wikipedia.org/wiki/Torque moment = r cross f])<br />
* [https://www.python.org/ Programming in Python]<br />
* [https://www.mathworks.com/support/learn-with-matlab-tutorials.html Programming in MATLAB]<br />
* [http://reference.wolfram.com/language/tutorial/GettingStartedOverview.html Programming in Mathematica]<br />
<br />
===Programming===<br />
<br />
The MR code library is written in Python, MATLAB, and Mathematica. Since you will be building on this code, it is highly recommended that you program in one of these languages. If you choose another language, you will have to port the MR library yourself.<br />
<br />
* You can obtain Python for free at [https://www.python.org https://www.python.org].<br />
* You can obtain Mathematica at [https://www.wolfram.com/mathematica/ https://www.wolfram.com/mathematica/]. You will have to pay for it.<br />
* As a result of support from Mathworks, you can obtain a free license to MATLAB while you are taking a course. Please see the individual Coursera course for details. Otherwise you can pay for MATLAB at [https://www.mathworks.com/ https://www.mathworks.com/]. <br />
* An alternative to MATLAB is the [https://www.gnu.org/software/octave/ free GNU Octave scientific programming language], which uses syntax essentially identical to MATLAB.<br />
<br />
== Course 1: Foundations of Robot Motion ==<br />
<br />
* The [[DOF of the Human Arm|degrees of freedom of the human arm discussion prompt]]<br />
<br />
== Course 4: Robot Motion Planning and Control ==<br />
<br />
* The [[A* Graph Search Project|A* graph search project]]<br />
* The [[Sampling-Based Planning|sampling-based motion planning project]]<br />
<br />
== Course 5: Robot Manipulation and Wheeled Mobile Robots ==<br />
<br />
* The [[Evaluating Form Closure Project|planar form-closure testing project]]<br />
* The [[Stability of an Assembly Project|stability of an assembly project]]<br />
<br />
== Course 6: Capstone Project, Mobile Manipulation ==<br />
<br />
* The [[Mobile Manipulation Capstone|capstone mobile manipulation project]]</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_V-REP_SimulatorGetting Started with the V-REP Simulator2020-01-25T07:07:27Z<p>Lynch: Replaced content with "See this page for the updated version."</p>
<hr />
<div>[[Getting_Started_with_the_CoppeliaSim_Simulator|See this page for the updated version.]]</div>Lynchhttp://hades.mech.northwestern.edu/index.php/V-REP_IntroductionV-REP Introduction2020-01-25T07:06:14Z<p>Lynch: Replaced content with "See this page for the updated version."</p>
<hr />
<div>[[CoppeliaSim_Introduction|See this page for the updated version.]]</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T07:01:31Z<p>Lynch: /* Useful Resources */</p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== CoppeliaSim Introduction ==<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP., which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP scenes.'''<br />
<br />
On [http://www.coppeliarobotics.com/index.html CoppeliaSim's homepage] the program is described as<br />
<br />
...the Swiss army knife among robot simulators: you won't find a simulator with more functions, features, or more elaborate APIs.<br />
<br />
CoppeliaSim's strength comes from several features:<br />
<br />
# CoppeliaSim provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# CoppeliaSim is highly extensible. CoppeliaSim developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running CoppeliaSim simulation.<br />
# CoppeliaSim is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use CoppeliaSim. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
CoppeliaSim, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration CoppeliaSim Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION CoppeliaSim SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download CoppeliaSim] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install CoppeliaSim. On Windows, you simply have an EXE that installs CoppeliaSim. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>coppeliaSim.app</code> directory that should allow you start coppeliaSim through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf CoppeliaSim_Edu_V4_0_0_Ubuntu18_04.tar.xz</code>). Then you need to change directories into the CoppeliaSim source directory and run the <code>coppeliaSim.sh</code> shell script. See [[Getting_Started_with_the_CoppeliaSim_Simulator|'''this page''']] for more information on getting started with CoppeliaSim.<br />
<br />
Once CoppeliaSim is open you will want to run one of the scenes below. To run any of them, you first run CoppeliaSim, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every CoppeliaSim scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with CoppeliaSim's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the CoppeliaSim scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the CoppeliaSim scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the CoppeliaSim scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the CoppeliaSim scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the CoppeliaSim scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where CoppeliaSim simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this CoppeliaSim scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the CoppeliaSim scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that CoppeliaSim uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the CoppeliaSim scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
CoppeliaSim will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the CoppeliaSim scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
CoppeliaSim comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with CoppeliaSim. You can find these scenes in the <code>scenes</code> directory under the CoppeliaSim directory. Running and studying these can be a great way to learn more about the CoppeliaSim capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html CoppeliaSim User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/videos.html CoppeliaSim Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm CoppeliaSim Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of CoppeliaSim Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm CoppeliaSim API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how CoppeliaSim enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a CoppeliaSim simulation.</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T06:53:22Z<p>Lynch: /* CoppeliaSim Introduction */</p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== CoppeliaSim Introduction ==<br />
<br />
'''Note 1: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''Note 2: CoppeliaSim evolved from V-REP., which was discontinued in late November, 2019. CoppeliaSim is backward compatible with V-REP scenes.'''<br />
<br />
On [http://www.coppeliarobotics.com/index.html CoppeliaSim's homepage] the program is described as<br />
<br />
...the Swiss army knife among robot simulators: you won't find a simulator with more functions, features, or more elaborate APIs.<br />
<br />
CoppeliaSim's strength comes from several features:<br />
<br />
# CoppeliaSim provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# CoppeliaSim is highly extensible. CoppeliaSim developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running CoppeliaSim simulation.<br />
# CoppeliaSim is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use CoppeliaSim. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
CoppeliaSim, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration CoppeliaSim Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION CoppeliaSim SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download CoppeliaSim] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install CoppeliaSim. On Windows, you simply have an EXE that installs CoppeliaSim. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>coppeliaSim.app</code> directory that should allow you start coppeliaSim through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf CoppeliaSim_Edu_V4_0_0_Ubuntu18_04.tar.xz</code>). Then you need to change directories into the CoppeliaSim source directory and run the <code>coppeliaSim.sh</code> shell script. See [[Getting_Started_with_the_CoppeliaSim_Simulator|'''this page''']] for more information on getting started with CoppeliaSim.<br />
<br />
Once CoppeliaSim is open you will want to run one of the scenes below. To run any of them, you first run CoppeliaSim, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every CoppeliaSim scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with CoppeliaSim's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the CoppeliaSim scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the CoppeliaSim scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the CoppeliaSim scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the CoppeliaSim scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the CoppeliaSim scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where CoppeliaSim simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this CoppeliaSim scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the CoppeliaSim scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that CoppeliaSim uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the CoppeliaSim scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
CoppeliaSim will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the CoppeliaSim scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
CoppeliaSim comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with CoppeliaSim. You can find these scenes in the <code>scenes</code> directory under the CoppeliaSim directory. Running and studying these can be a great way to learn more about the CoppeliaSim capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html CoppeliaSim User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/assets/v-repoverviewpresentation.pdf CoppeliaSim Overview Presentation]<br />
* [http://www.coppeliarobotics.com/videos.html CoppeliaSim Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm CoppeliaSim Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of CoppeliaSim Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm CoppeliaSim API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how CoppeliaSim enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a CoppeliaSim simulation</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T06:50:31Z<p>Lynch: /* Demonstration V-REP Scenes */</p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== CoppeliaSim Introduction ==<br />
<br />
'''Note: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
On [http://www.coppeliarobotics.com/index.html CoppeliaSim's homepage] the program is described as<br />
<br />
...the Swiss army knife among robot simulators: you won't find a simulator with more functions, features, or more elaborate APIs.<br />
<br />
CoppeliaSim's strength comes from several features:<br />
<br />
# CoppeliaSim provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# CoppeliaSim is highly extensible. CoppeliaSim developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running CoppeliaSim simulation.<br />
# CoppeliaSim is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use CoppeliaSim. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
CoppeliaSim, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration CoppeliaSim Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION CoppeliaSim SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download CoppeliaSim] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install CoppeliaSim. On Windows, you simply have an EXE that installs CoppeliaSim. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>coppeliaSim.app</code> directory that should allow you start coppeliaSim through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf CoppeliaSim_Edu_V4_0_0_Ubuntu18_04.tar.xz</code>). Then you need to change directories into the CoppeliaSim source directory and run the <code>coppeliaSim.sh</code> shell script. See [[Getting_Started_with_the_CoppeliaSim_Simulator|'''this page''']] for more information on getting started with CoppeliaSim.<br />
<br />
Once CoppeliaSim is open you will want to run one of the scenes below. To run any of them, you first run CoppeliaSim, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every CoppeliaSim scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with CoppeliaSim's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the CoppeliaSim scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the CoppeliaSim scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the CoppeliaSim scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the CoppeliaSim scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the CoppeliaSim scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where CoppeliaSim simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this CoppeliaSim scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the CoppeliaSim scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that CoppeliaSim uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the CoppeliaSim scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
CoppeliaSim will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the CoppeliaSim scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
CoppeliaSim comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with CoppeliaSim. You can find these scenes in the <code>scenes</code> directory under the CoppeliaSim directory. Running and studying these can be a great way to learn more about the CoppeliaSim capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html CoppeliaSim User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/assets/v-repoverviewpresentation.pdf CoppeliaSim Overview Presentation]<br />
* [http://www.coppeliarobotics.com/videos.html CoppeliaSim Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm CoppeliaSim Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of CoppeliaSim Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm CoppeliaSim API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how CoppeliaSim enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a CoppeliaSim simulation</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T06:50:09Z<p>Lynch: </p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== CoppeliaSim Introduction ==<br />
<br />
'''Note: CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
On [http://www.coppeliarobotics.com/index.html CoppeliaSim's homepage] the program is described as<br />
<br />
...the Swiss army knife among robot simulators: you won't find a simulator with more functions, features, or more elaborate APIs.<br />
<br />
CoppeliaSim's strength comes from several features:<br />
<br />
# CoppeliaSim provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# CoppeliaSim is highly extensible. CoppeliaSim developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running CoppeliaSim simulation.<br />
# CoppeliaSim is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use CoppeliaSim. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
CoppeliaSim, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration V-REP Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION CoppeliaSim SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download CoppeliaSim] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install CoppeliaSim. On Windows, you simply have an EXE that installs CoppeliaSim. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>coppeliaSim.app</code> directory that should allow you start coppeliaSim through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf CoppeliaSim_Edu_V4_0_0_Ubuntu18_04.tar.xz</code>). Then you need to change directories into the CoppeliaSim source directory and run the <code>coppeliaSim.sh</code> shell script. See [[Getting_Started_with_the_CoppeliaSim_Simulator|'''this page''']] for more information on getting started with CoppeliaSim.<br />
<br />
Once CoppeliaSim is open you will want to run one of the scenes below. To run any of them, you first run CoppeliaSim, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every CoppeliaSim scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with CoppeliaSim's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the CoppeliaSim scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the CoppeliaSim scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the CoppeliaSim scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the CoppeliaSim scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the CoppeliaSim scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where CoppeliaSim simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this CoppeliaSim scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the CoppeliaSim scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that CoppeliaSim uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the CoppeliaSim scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
CoppeliaSim will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the CoppeliaSim scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
CoppeliaSim comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with CoppeliaSim. You can find these scenes in the <code>scenes</code> directory under the CoppeliaSim directory. Running and studying these can be a great way to learn more about the CoppeliaSim capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html CoppeliaSim User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/assets/v-repoverviewpresentation.pdf CoppeliaSim Overview Presentation]<br />
* [http://www.coppeliarobotics.com/videos.html CoppeliaSim Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm CoppeliaSim Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of CoppeliaSim Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm CoppeliaSim API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how CoppeliaSim enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a CoppeliaSim simulation</div>Lynchhttp://hades.mech.northwestern.edu/index.php/CoppeliaSim_IntroductionCoppeliaSim Introduction2020-01-25T06:35:22Z<p>Lynch: Created page with "x250px == V-REP Introduction == '''Note: V-REP is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simula..."</p>
<hr />
<div>[[image:v-rep-sim.jpg|right|x250px]]<br />
<br />
== V-REP Introduction ==<br />
<br />
'''Note: V-REP is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
On [http://www.coppeliarobotics.com/index.html V-REP's homepage] the program is described as<br />
<br />
...the Swiss army knife among robot simulators: you won't find a simulator with more functions, features, or more elaborate APIs.<br />
<br />
V-REP's strength comes from several features:<br />
<br />
# V-REP provides a unified framework combining many powerful internal and external libraries that are often useful for robotics simulations. This includes dynamic simulation engines, forward/inverse kinematics tools, collision detection libraries, vision sensor simulations, path planning, GUI development tools, and built-in models of many common robots.<br />
# V-REP is highly extensible. V-REP developers provide an API that allows one to write custom plugins that add new features. You can embed [https://en.wikipedia.org/wiki/Lua_(programming_language) Lua] scripts directly into a simulation scene that, for example, process simulated sensor data, run control algorithms, implement user interfaces, or even send data to a physical robot. They also provide a remote API that allows one to develop standalone applications in many programming languages that are able to pass data in and out of a running V-REP simulation.<br />
# V-REP is cross-platform, mostly open-source, and provides a free educational license.<br />
<br />
The purpose of this page is not to teach you how to use V-REP. Rather it is to<br />
describe demonstration scenes that have been developed to support learning from the book '''[[Modern Robotics]]'''. If you are interested to learn more about<br />
V-REP, check out the [[#Useful Resources|Useful Resources]] section below.<br />
<br />
== Demonstration V-REP Scenes ==<br />
<br />
[[Media:V-REP_scenes-Nov2019.zip|'''DOWNLOAD ALL DEMONSTRATION V-REP SCENES AND INPUT FILES DESCRIBED BELOW, DATED NOVEMBER 2019.''']]<br />
<br />
Older versions of the scenes:<br />
* [[Media:V-REP_scenes.zip|August 2018]]<br />
<br />
To run any of the scenes below, the first step will be to [http://www.coppeliarobotics.com/downloads.html download V-REP] for your operating system. You should download the latest non-limited EDUCATIONAL version. Next you will have to install V-REP. On Windows, you simply have an EXE that installs V-REP. On a Mac, you first need to unzip the download. The directory that is produced by unzipping the download contains a <code>vrep.app</code> directory that should allow you start V-REP through normal mechanisms, e.g., Finder/Spotlight/Launchpad. On Linux, you will need to extract the compressed tar archive (e.g., using a command like <code>tar xvf V-REP_PRO_EDU_V3_3_2_64_Linux.tar.gz</code>). Then you need to change directories into the V-REP source directory and run the <code>vrep.sh</code> shell script.<br />
<br />
Once V-REP is open you will want to run one of the scenes below. To run any of them, you first run V-REP, then you click <code>File->Open scene...</code> and open one of the ttt files that are linked below. Then click either the ''Play'' button from the top toolbar or click <code>Simulation->Start simulation</code> and a GUI should pop up. Clicking the ''Stop'' button or <code>Simulation->Stop simulation</code> will close the GUI and stop the simulation.<br />
<br />
Most of the scenes feature a simulation of a kinematically-controlled, non-respondable robot. ''Kinematically controlled'' means that all dynamics (inertias, torques, friction, etc.) of the system are neglected. We specify a configuration of the robot and it is instantaneously "teleported" to the new configuration. ''Non-respondable'' means that the links of the robot are not capable of interacting with the world or each other through collisions. In other words, we can put the robot in configurations that result in self-collisions. <br />
<br />
The "interactive" scenes allow you to visualize the robot as you change its configuration using sliders. The "CSV" scenes allow animations of a robot based on a trajectory stored in a comma-separated values file, where each line corresponds to a timestep and consists of comma-separated numbers specifying the robot's configuration at that timestep. There are no joint limits in the "CSV" scenes. <br />
<br />
[[Writing_a_CSV_File|'''This page has information on writing csv files in Python, MATLAB, and Mathematica.''']]<br />
<br />
The CSV mobile manipulation scene is a partly dynamically-controlled simulation of a respondable [http://www.youbot-store.com/ youBot] from [https://www.kuka.com/en-us KUKA]. <br />
<br />
: '''Important note regarding csv file format:''' The example csv files included below for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke V-REP using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./vrep.sh<br />
: Another option, also suggested by a Coursera student, is to open the Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
In each scene, there is a single Lua script called a [http://www.coppeliarobotics.com/helpFiles/en/childScripts.htm non-threaded child script]. When the scene is first run, there is a function that is called that sets up the GUI and creates variables that are going to be needed later on in the simulation. Then during every step of the simulation the [http://www.coppeliarobotics.com/helpFiles/en/mainScript.htm main script], which is part of every V-REP scene, runs an "actuation" function from the child script. This actuation function is responsible for processing all of the changes to the GUI since the last time it was called (buttons clicked, label updates, etc.), and for sending joint commands to the simulated robot. Technically, there is also a "sensing" function in the child script that gets called by the main script, but in each of these scenes, the sensing function is empty. The GUIs are all built with V-REP's [http://www.coppeliarobotics.com/helpFiles/en/customUIPlugin.htm Qt-based custom UI framework].<br />
<br />
=== Scene 1: Interactive UR5 ===<br />
<br />
[[image:ur5-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene helps you visualize a [https://www.universal-robots.com/products/ur5-robot/ UR5 robot] from [https://www.universal-robots.com/ Universal Robots]. The model of the UR5 was created by importing a URDF from the ROS-Industrial [https://github.com/ros-industrial/universal_robot/tree/indigo-devel/ur_description/urdf ur5_description package]. The GUI in this scene features two tabs. One tab lets you drag sliders to modify the joint angles of each joint, and the other tab allows you to specify comma-separated angles for all 6 joints in an editable text box and ask for the SE(3) transformation from the base frame to the end-effector frame. The frames attached to the base and end-effector are persistently displayed (x-axis in red, y-axis in green, z-axis in blue). Note that all angles are specified in radians. <br />
<br />
Scene 1 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene1_UR5.ttt: the V-REP scene file.<br />
<br clear=all><br />
<br />
=== Scene 2: CSV Animation UR5 ===<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the UR5 robot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is the joint angle through time for one of the joints (first column is joint 1, last column is joint 6). <br />
<br />
Scene 2 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene2_UR5_csv.ttt: the V-REP scene file.<br />
* Scene2_example.csv: an example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
=== Scene 3: Interactive youBot ===<br />
<br />
[[image:youbot-fig.png|right|x150px]]<br />
<br />
'''(Updated August 2018, to match the frame conventions used in the textbook and in Scene 4, animation of the youBot.)''' <br />
<br />
This scene helps you visualize a youBot mobile manipulator from KUKA. The KUKA youBot consists of a mecanum-wheel omnidirectional base and a 5R robot arm. Move the mobile base of the robot and the joints of the robot using sliders, and inspect the SE(3) representation of the resulting end-effector coordinate frame. All angles are represented in radians, and linear distances are represented in meters. The following frames are illustrated: the world frame {s}, a frame fixed to the center of the mobile chassis {b}, a frame fixed at the base of the robot arm {0}, and a frame fixed to the end-effector {e}.<br />
<br />
Scene 3 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene3_youBot.ttt: the V-REP scene file.<br />
<br />
<br clear=all><br />
<br />
=== Scene 4: CSV Animation youBot ===<br />
<br />
[[image:youbot-top-view.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene animates the motion of the youBot based on a csv file representing the trajectory of the robot. Each row of the csv file represents a timestep and each column of the csv file is a configuration variable through time. The csv file has either 12 or 13 columns. Columns 1-3 represent the mobile base configuration variables, ordered as (phi, x, y), where phi is the angle of the base and (x, y) is the location of its center. Columns 4-8 represent the five arm joint angles, joint 1 through joint 5. Columns 9-12 represent the wheel angles, where wheel 1 is column 9 and wheel 4 is column 12, and the numbering of the wheels is shown in the figure on the right. Column 13 is optional. If it is present, then 0 means the gripper is open and 1 means the gripper is closed. If there is no column 13, then the gripper is open by default. All angles are specified in radians.<br />
<br />
Scene 4 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene4_youBot_csv.ttt: the V-REP scene file.<br />
* Scene4_example.csv: an example input file.<br />
* Scene4_base_motions: this folder has five basic motions of the youBot mobile base, showing the correct wheel motions associated with some basic motions of mobile base. You can check that your wheeled mobile base kinematics (or odometry) are correct by comparing your wheel motions to the wheel motions in these .csv files. <br />
** yb1.csv: Constant speed spin in place (wheels on the left side and right side of the robot move at opposite speeds). <br />
** yb2.csv: Constant speed forward motion (all wheels move at the same speed). <br />
** yb3.csv: Constant speed sideways motion (wheels on opposite corners move at the same speed). <br />
** yb4.csv: Constant speed diagonal motion (wheels 2 and 4 move at the same speed while wheels 1 and 3 are stationary). <br />
** yb5.csv: Constant speed diagonal motion (wheels 1 and 3 move at the same speed while wheels 2 and 4 are stationary).<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 5: CSV Motion Planning Kilobot ===<br />
<br />
[[image:kilobot-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene allows you to visualize motion planning on an undirected graph using graph-search techniques such as A*. To visualize the planned motion, we are using the [https://www.kilobotics.com/ kilobot] robot moving in a planar square environment of dimensions -0.5 <= x <= 0.5 and -0.5 <= y <= 0.5. Obstacles are represented as cylinders, and the graph itself is illustrated as blue nodes with yellow edges. The path that the kilobot actually follows is indicated by green edges, and the goal node is in red. See the image to the right.<br />
<br />
This scene does not do motion planning. Instead, it displays the output of your motion planner. It expects you to provide the path to a folder with four files, named nodes.csv, edges.csv, path.csv, and obstacles.csv:<br />
<br />
* nodes.csv: If the graph has N nodes, then this file has N rows. Each row is of the form ID,x,y,heuristic-cost-to-go. ID is the unique integer ID number of the node, and these ID numbers should take values 1 through N. x, y are the (x,y) coordinates of the node in the plane. heuristic-cost-to-go is an optimistic approximation of the shortest path from this node to the goal node (e.g., the Euclidean distance to the goal node). This information is useful for A-star search but is not represented in the visualization of the path.<br />
<br />
* edges.csv: If the graph has E edges, then this file has E rows. Each row is of the form ID1,ID2,cost. ID1 and ID2 are the node IDs of the nodes connected by the edge. cost is the cost of traversing that edge. This file can be empty if you do not wish to display edges.<br />
<br />
* path.csv: This file specifies the solution path in the graph, and it is a single line, of the form ID1,ID2,... The first number is the ID of the first node in the solution path, and the last number is the ID of the last node in the solution path. If there is no solution to the motion planning problem, the path can consist of a single ID number, the ID of the node where the robot starts (and stays).<br />
<br />
* obstacles.csv: This file specifies the locations and diameters of the circular obstacles. Each row is x, y, diameter, where (x,y) is the center of the obstacle and diameter is the diameter of the obstacle. This file can be empty if there are no obstacles.<br />
<br />
Nothing prevents you from providing files with nodes or edges inside obstacles. The path.csv file is the output of a graph search planner. Inputs to the planner could be the obstacles.csv file and a specification of the positions of the start and goal nodes, or it could be the nodes.csv and edges.csv files and a specification of the start and goal nodes, or it could be other information, depending on your planner. But in any case, this scene requires the four files above for the visualization. <br />
<br />
Scene 5 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene5_motion_planning.ttt: the V-REP scene file.<br />
* Scene5_example.zip: a directory containing example input files nodes.csv, edges.csv, path.csv, and obstacles.csv.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
You may be interested in:<br />
* [[A*_Graph_Search_Project|A description of an A* search project using this scene.]]<br />
* [[Sampling-Based_Planning|A description of a sampling-based planning project using this scene.]]<br />
<br />
<br clear=all><br />
<br />
=== Scene 6: CSV Mobile Manipulation youBot ===<br />
<br />
[[image:youbot-capstone.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in November 2019, to fix a problem on some Macs in loading csv files.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project using this scene, as well as more details regarding the operation of the physics engines, the kinematics of the youBot, properties of the end-effector (gripper), and properties of the cube.''']]<br />
<br />
This scene has a youBot mobile manipulator and a cube. The youBot is expected to pick up the cube and put it down at a goal location ("pick and place"). This scene animates a user-specified csv file specifying the motion of the youBot, much as in Scene 4, except now the gripper interacts dynamically with the cube. Each row of the csv file has 13 variables: 3 for the chassis configuration (phi, x, y), 5 for the arm joint angles, 4 for the wheel angles (where the wheels are numbered as shown in Scene 4), and 1 for the gripper state (0 = open, 1 = closed). Unlike previous csv visualization scenes where V-REP simply makes a movie of the configurations, and there is no notion of the simulated time between successive lines in the csv file, this V-REP scene is performing a dynamic simulation, so the time between each line is important to determine the dynamic behavior. '''The simulated time between each line of the csv file is 0.01 seconds (10 milliseconds).'''<br />
<br />
The gripper of the youBot and the cube are dynamically modeled to simulate practical pick-and-place. In other words, if the gripper does not close on the block properly, it may slide away, and if you open the gripper when it is holding a block, the block will fall to the floor. The interaction between the gripper and the block is governed by a "physics engine," which approximately accounts for friction, mass, inertial, and other properties. The default physics engine for this scene is ODE. <br />
<br />
Gripper opening and closing may take up to approximately 0.625 seconds. Assume, for example, that the first 100 lines of your csv file have the gripper state as 0 (open). Then, on line 101, you change the gripper state to 1 (closed). This transition from 0 to 1 initiates the closing action, but the closing may not actually complete for 0.625 seconds. So you should keep the gripper state at 1 for at least 63 consecutive lines of your csv file to ensure that the gripper closes all the way. Similarly, it may take up to 0.625 seconds for the gripper to open, so you should keep the gripper state at 0 for at least 63 consecutive lines to ensure that the gripper opens all the way. Gripper opening/closing actually terminates when a force threshold is reached on the fingers or the fingers have completed the motion. <br />
<br />
You can set the initial and goal configurations of the cube with a GUI inside the scene, but the default initial configuration is <math>(x,y,\theta) = (1~\text{m}, 0~\text{m}, 0~\text{rad})</math> and the goal configuration is at <math>(x,y,\theta) = (0~\text{m},-1~\text{m},-\pi/2~\text{rad})</math>.<br />
<br />
Scene 6 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene6_youbot_cube.ttt: the V-REP scene file.<br />
* Scene6_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 7: CSV Animation MTB ===<br />
<br />
[[image:MTB-img.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
This scene simulates a RRPR robot. It animates a csv file containing a trajectory of joint angles. Each column of the csv file is the joint angle/length through time for one of the joints (in the order of RRPR). A single row of the csv file represents a complete configuration of the robot at a particular time. The prismatic joint (P) has the joint limit range [0, 0.2]. The assumed time step between rows is equal to the time step that V-REP uses for simulation; the default is 0.05 seconds. <br />
<br />
Scene 7 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene7_MTB_csv.ttt: the V-REP scene file.<br />
* Scene7_example.csv: An example input file.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Scene 8: CSV youBot End-Effector Animation ===<br />
<br />
[[image:capstone-gripper.png|right|x150px]]<br />
<br />
'''(This scene had minor updates in August 2018.)''' <br />
<br />
[[Mobile Manipulation Capstone|'''This page has a description of a capstone mobile manipulation project (specifically Milestone 2) using this scene.''']]<br />
<br />
This scene is used in [[Mobile Manipulation Capstone|Milestone 2 of the capstone mobile manipulation project]]. It animates the motion of the gripper of the youBot only (the rest of the youBot is not shown), and this scene is used to validate the planned motion of the gripper. Each line of the csv file has 13 comma-separated values: 12 from the top three rows of the transformation matrix <math>T_{se}</math> representing the configuration of the end-effector frame {e} relative to the space frame {s}, and 1 representing the gripper state (0 = open, 1 = closed). In other words, one line of the csv file is<br />
<br />
r11, r12, r13, r21, r22, r23, r31, r32, r33, px, py, pz, gripper state<br />
<br />
where the transformation matrix <math>T_{se}</math> is <br />
<br />
<math> T_{se} = \left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & p_x \\ r_{21} & r_{22} & r_{23} & p_y \\ r_{31} & r_{32} & r_{33} & p_z \\ 0 & 0 & 0 & 1 \end{array}\right]. </math> <br />
<br />
V-REP will animate the motion of the end-effector based on this csv file. It will also show the cube that is to be manipulated by the gripper, at its initial and goal configurations. <br />
The gripper does not dynamically interact with the cube, however. <br />
<br />
[https://youtu.be/8d_cYwV58lI '''This video shows an example of an animation created by this scene''']. In this video, the gripper opens and closes instantly, but this scene will show the gripper taking up to 0.625 seconds to open and close, just as in Scene 6. <br />
<br />
Scene 8 files in the [[Media:V-REP_scenes.zip|download of all of the demonstration scenes]]:<br />
<br />
* Scene8_gripper_csv.ttt: the V-REP scene file.<br />
* Scene8_example.csv: an example input file solving the task when the cube's initial and goal configurations are the defaults.<br />
<br />
See the note above about making sure your language settings are appropriate to properly read csv files in Linux.<br />
<br />
<br clear=all><br />
<br />
=== Switching Between Scenes ===<br />
<br />
Press the ''Stop'' button to stop the simulation of the current scene, then choose <code>File>Open scene...</code>. You can also use <code>File>Open recent scene</code> to switch to a scene you previously loaded. Then you press the ''Play'' button to run the scene. Alternatively, stop the simulation and then press the <code>Scenes</code> button in the top toolbar to see which scenes are currently open and select one to be in the foreground. The scene selector toolbar button may also be used to switch between opened scenes. Read more [http://www.coppeliarobotics.com/helpFiles/en/scenes.htm here].<br />
<br />
=== Recording a Movie ===<br />
<br />
V-REP comes with a video recorder. Go to <code>Tools>Video recorder</code>. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording V-REP movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
A simpler option may be to just use your computer's screen recording software. On the Mac, you can use Quicktime. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop]. On Windows, you can use [http://icecreamapps.com/Screen-Recorder/ Screen Recorder]. Or you may have your own solution.<br />
<br />
=== Exploring Other Scenes ===<br />
<br />
You are encouraged to explore some of the (quite impressive) scenes that come pre-loaded with V-REP. You can find these scenes in the <code>scenes</code> directory under the V-REP directory. Running and studying these can be a great way to learn more about the V-REP capabilities and to understand how to put together more complex scenes.<br />
<br />
== Useful Resources ==<br />
<br />
* [http://www.coppeliarobotics.com/resources.html V-REP User Manual and Other Resources]<br />
* [http://www.coppeliarobotics.com/assets/v-repoverviewpresentation.pdf V-REP Overview Presentation]<br />
* [http://www.coppeliarobotics.com/videos.html V-REP Videos Page]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/tutorials.htm V-REP Tutorial Series]<br />
* [http://www.coppeliarobotics.com/features.html Overview of V-REP Features]<br />
* [http://www.coppeliarobotics.com/helpFiles/en/apiOverview.htm V-REP API Documentation] These are all functions that can either be called directly from a custom C/C++ plugin or through a Lua embedded script.<br />
* [http://www.coppeliarobotics.com/helpFiles/en/remoteApiOverview.htm Remote API Documentation] The Remote API is how V-REP enables scripts and programs written in other languages (MATLAB, Java, Python, etc.) to interact with a V-REP simulation</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T06:30:54Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forum].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute CoppeliaSim). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynchhttp://hades.mech.northwestern.edu/index.php/Getting_Started_with_the_CoppeliaSim_SimulatorGetting Started with the CoppeliaSim Simulator2020-01-25T06:22:59Z<p>Lynch: </p>
<hr />
<div>Now that you have the [https://github.com/NxRLab/ModernRobotics MR code library], you need the cross-platform CoppeliaSim robot simulator (formerly known as V-REP) to allow you to visualize the motions of robots. '''You should complete the items on this page before moving on with the rest of the course!''' Click on any of the images to make them larger.<br />
<br />
'''CoppeliaSim is computationally intensive. To minimize power usage, make sure to "pause" or "stop" a simulation when you are not using it.'''<br />
<br />
'''1.''' Go to [http://www.coppeliarobotics.com/ http://www.coppeliarobotics.com/] and download and install the free CoppeliaSim edu software for your operating system. If you are having trouble installing, you can look for help on the [http://www.coppeliarobotics.com/resources Coppelia site], read recommendations from other students on the Coursera week 1 discussion forum regarding CoppeliaSim, or even use an earlier version of the software, known as V-REP (version 3.4 or later).<br />
<br />
'''2.''' Launch CoppeliaSim. On Linux the startup script is coppeliaSim.sh, which you can execute with the command ./coppeliaSim.sh when you are in the directory with the script. On a Mac, if the app crashes on startup, you may have to run <br />
<br />
sudo xattr -r -d com.apple.quarantine *<br />
<br />
in Terminal in the directory where the coppeliaSim app is. <br />
<br />
If you have any troubles, please check out the [http://www.coppeliarobotics.com/resources Coppelia resources] and particularly the [http://forum.coppeliarobotics.com/ forum].<br />
<br />
Experiment with CoppeliaSim. I suggest you choose File > Open scene... and open one of the example "scenes" that comes with the software. CoppeliaSim "scenes" are specifications of environments, robots, and their actions, and when you press the "play" button the simulation begins. Experimenting with these scenes will show you some of the capabilities of CoppeliaSim. For example, you could choose the "motionPlanningAndGrasping.ttt" scene, as shown in the image below. (All scene files end in .ttt.)<br />
<br />
[[image:VREP-demo-open.png|700px]]<br />
<br clear=all><br />
<br />
: '''Important note regarding screen resolution:''' If you find the text and graphics to be too small on a high-resolution screen, you can edit the file "system/usrset.txt" to change the value of the variable "highResDisplay" to 1. On the Mac, this file is hidden in the directory "coppeliaSim.app" (the application you double-click to execute V-REP). You can see the contents of this directory using the Terminal utility on your Mac. In Terminal, use "cd" to navigate to the folder where coppeliaSim.app is, then cd to the directory "Contents/MacOS/system" to see usrset.txt. (Another way to see the contents of the coppeliaSim package on a Mac is to control-click on the coppeliaSim app in Finder, choose "Show Package Contents," and navigate to the MacOS/system directory to see usrset.txt.)<br />
<br />
'''3.''' Press the "play" button at the top of the window to see the robots executing motion plans.<br />
<br />
[[image:VREP-motion-planning.png|700px]]<br />
<br clear=all><br />
<br />
'''4.''' We will be using several custom scenes in this specialization. You should download the .zip folder from [[CoppeliaSim Introduction]] and unzip it. The scenes include: interactive UR5 (Scene 1), csv animation UR5 (Scene 2), interactive youBot (Scene 3), and csv animation youBot (Scene 4). The Universal Robots UR5 is a 6-joint robot arm and the KUKA youBot is a mobile manipulator consisting of a 5-joint robot arm mounted on an omnidirectional robot base with 4 mecanum wheels. "Interactive" means that you can move sliders that represent the joint positions of the robot, and you'll see the robot move in response. "csv animation" means that the scene expects you to provide a "comma-separated values" (csv) file. A row of the file is a set of joint values, separated by commas, corresponding to the configuration of the robot at a particular instant. Subsequent rows are the configuration of the robot at later times, and the csv file is played as an animation by CoppeliaSim.<br />
<br />
Included in the .zip folder are the scene files themselves as well as example input files for some of the scenes. You should make sure your unzipped folder is in a convenient, memorable location on your computer, as you will have to type in the full path to the input files when you use them in the CoppeliaSim scenes that require them.<br />
<br />
'''5.''' If you currently have a simulation running in CoppeliaSim, press the "stop" button to stop it. Then choose File > Open scene... and open the interactive UR5 scene (Scene1_UR5.ttt) you downloaded. Press the "play" button, choose the "Joint Angle Sliders" tab, and experiment with moving the sliders to see how the joints move.<br />
<br />
[[image:vrep-im3.jpg|700px]]<br />
<br clear=all><br />
<br />
'''6.''' Open and run (press "play") the youBot csv animation scene (Scene4_youBot_csv.ttt). Load the example .csv file for the youBot. You will have to provide the full path to the file; in the example on the Mac below, the path is "/Users/kevin/V-REP_scenes/Scene4_example.csv". After clicking "Open File," press the "Play" button just below where you entered the file path. You should see the mobile robot continually executing the trajectory encoded in the .csv file.<br />
<br />
[[image:vrep-im4.png|700px]]<br />
<br clear=all><br />
<br />
The first line of the .csv file is<br />
<br />
0,-0.526,0,0,-0.785,0.785,-1.571,0,0,0,0,0<br />
<br />
where the comma-separated values represent: phi angle of mobile robot base, x position of mobile robot base, y position of mobile robot base, joint1, joint2, joint3, joint4, joint5, wheel1, wheel2, wheel3, wheel4. The angles of the wheels are included so you can see the wheels rotating as the robot moves.<br />
<br />
: '''Important note regarding csv file format:''' The example csv files included for use with the csv scenes assume that periods, not commas, are used as decimal points. So pi is written as 3.14, not as 3,14. If you are using Linux and your region settings are set to a region that uses commas as the decimal separator, one solution, suggested by a Coursera student, is to invoke CoppeliaSim using US English settings:<br />
LC_NUMERIC=en_US.UTF-8 ./coppeliaSim.sh<br />
: Another option, also suggested by a Coursera student, is to open your Linux "System Settings" -> "Language support" -> "Regional Formats" tab. After changing the region to "English (United States)", log out and back in for the change to take effect.<br />
<br />
'''7.''' During this specialization, you will have to generate videos of CoppeliaSim visualizations. We have found it easiest to use screenshot-video tools for your operating system. On the Mac, you can use Quicktime to record videos from the screen. On Linux, you can use [http://www.maartenbaert.be/simplescreenrecorder/ SimpleScreenRecorder] or [http://recordmydesktop.sourceforge.net/about.php recordMyDesktop], for example. On Windows, you can use [https://icecreamapps.com/Screen-Recorder/ Screen Recorder].<br />
<br />
CoppeliaSim provides its own tool, which you can find at Tools>Video recorder. You may need to stop the current scene to be able to configure the video recorder. You can find more information on recording CoppeliaSim movies here: [http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm http://www.coppeliarobotics.com/helpFiles/en/aviRecorder.htm].<br />
<br />
Try recording and saving a 10 second movie of the youBot animating the example .csv file. Your video should be of reasonable quality, but the compression should be such that the video doesn't use too much memory. For example, a few MB is a reasonably sized short video.<br />
<br />
'''When you're finished with the tasks above...'''<br />
<br />
'''Congratulations!''' Your MR code library and the CoppeliaSim simulator are ready to use. Do not move on to the rest of the course until these are working for you.<br />
<br />
In this specialization we will mostly be using CoppeliaSim to visualize the motion of robot arms and wheeled mobile robots. For example, we use CoppeliaSim to animate your solutions to inverse kinematics, to display the dynamic motion of a robot arm according to dynamics calculations that you will write, to animate the results of path planners you develop, and to simulate a mobile manipulator manipulating an object.<br />
<br />
The '''Modern Robotics''' specialization does not teach how to use CoppeliaSim in detail, and it uses only a small fraction of CoppeliaSim's capabilities. If you want to learn more, you can find links to documentation '''[[CoppeliaSim Introduction#Useful_Resources|at the bottom of this page]].'''</div>Lynch