Skip to Content
Learn Robotics Programming
book

Learn Robotics Programming

by Danny Staple
November 2018
Beginner
472 pages
13h 5m
English
Packt Publishing
Content preview from Learn Robotics Programming

Chapter 7, Drive and Turn - Moving Motors with Python

  • Why do we use the atexit.register mechanism?
    • To register a stop function, so the robot's motors will stop when the code stops, even if there is an error
  • How can we correct a motor going the wrong way?
    • We can swap the two motor-lead connections for that motor at the screw terminals.
  • What are the main advantages of a common interface for a Robot object?
    • We can build new behaviors on top of the object without writing setup and translation code repeatedly.
    • We can move our behaviors onto other motor controllers by wrapping them in the same interface.
  • How must the motors move (left and right) to make this robot turn?
    • To turn, one motor must be going at a different speed from the other. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Robotics Programming - Second Edition

Learn Robotics Programming - Second Edition

Danny Staple

Publisher Resources

ISBN: 9781789340747Supplemental Content