You are previewing Robot Programming: A Guide to Controlling Autonomous Robots.
O'Reilly logo
Robot Programming: A Guide to Controlling Autonomous Robots

Book Description

Start programming robots NOW!

Learn hands-on, through easy examples, visuals, and code

This is a unique introduction to programming robots to execute tasks autonomously. Drawing on years of experience in artificial intelligence and robot programming, Cameron and Tracey Hughes introduce the reader to basic concepts of programming robots to execute tasks without the use of remote controls.

Robot Programming: A Guide to Controlling Autonomous Robots takes the reader on an adventure through the eyes of Midamba, a lad who has been stranded on a desert island and must find a way to program robots to help him escape. In this guide, you are presented with practical approaches and techniques to program robot sensors, motors, and translate your ideas into tasks a robot can execute autonomously. These techniques can be used on today’s leading robot microcontrollers (ARM9 and ARM7) and robot platforms (including the wildly popular low-cost Arduino platforms, LEGO® Mindstorms EV3, NXT, and Wowee RS Media Robot) for your hardware/Maker/DIY projects. Along the way the reader will learn how to:

  • Program robot sensors and motors

  • Program a robot arm to perform a task

  • Describe the robot’s tasks and environments in a way that a robot can process using robot S.T.O.R.I.E.S.

  • Develop a R.S.V.P. (Robot Scenario Visual Planning) used for designing the robot’s tasks in an environment

  • Program a robot to deal with the “unexpected” using robot S.P.A.C.E.S.

  • Program robots safely using S.A.R.A.A. (Safe Autonomous Robot Application Architecture) Approach

  • Program robots using Arduino C/C++ and Java languages

  • Use robot programming techniques with LEGO® Mindstorms EV3, Arduino, and other ARM7 and ARM9-based robots.

  • Table of Contents

    1. About This E-Book
    2. Title Page
    3. Copyright Page
    4. Contents at a Glance
    5. Contents
    6. About the Authors
    7. Dedication
    8. Acknowledgments
    9. We Want to Hear from You!
    10. Reader Services
    11. Introduction: Robot Boot Camp
      1. Robot Programming Boot Camp
      2. Ready, Set, Go! No Wires or Strings Attached
      3. Boot Camp Fundamentals
      4. Core Robot Programming Skills Introduced in This Book
        1. BURT—Basic Universal Robot Translator
        2. BRON—Bluetooth Robot Oriented Network
      5. Assumptions About the Reader’s Robot(s)
      6. How Midamba Learned to Program a Robot
    12. 1. What Is a Robot Anyway?
      1. The Seven Criteria of Defining a Robot
        1. Criterion #1: Sensing the Environment
        2. Criterion #2: Programmable Actions and Behavior
        3. Criterion #3: Change, Interact with, or Operate on Environment
        4. Criterion #4: Power Source Required
        5. Criterion #5: A Language Suitable for Representing Instructions and Data
        6. Criterion #6: Autonomy Without External Intervention
        7. Criterion #7: A Nonliving Machine
        8. Robot Categories
        9. What Is a Sensor?
        10. What Is an Actuator?
        11. What Is an End-Effector?
        12. What Is a Controller?
        13. What Scenario Is the Robot In?
      2. Giving the Robot Instructions
        1. Every Robot Has a Language
        2. Meeting the Robot’s Language Halfway
        3. How Is the Robot Scenario Represented in Visual Programming Environments?
        4. Midamba’s Predicament
        5. What’s Ahead?
    13. Code Snippets
    14. 2. Robot Vocabularies
      1. Why the Additional Effort?
      2. Identify the Actions
      3. The Autonomous Robot’s ROLL Model
        1. Robot Capabilities
        2. Robot Roles in Scenarios and Situations
        3. What’s Ahead?
    15. 3. RSVP: Robot Scenario Visual Planning
      1. Mapping the Scenario
        1. Creating a Floorplan
        2. The Robot’s World
        3. RSVP READ SET
      2. Pseudocode and Flowcharting RSVP
        1. Flow of Control and Control Structures
        2. Subroutines
      3. Statecharts for Robots and Objects
        1. Developing a Statechart
        2. What’s Ahead?
    16. 4. Checking the Actual Capabilities of Your Robot
      1. The Reality Check for the Microcontroller
      2. Sensor Reality Check
        1. Determine Your Robot’s Sensor Limitations
      3. Actuators End-Effectors Reality Check
      4. REQUIRE Robot Effectiveness
        1. What’s Ahead?
    17. 5. A Close Look at Sensors
      1. What Do Sensors Sense?
        1. Analog and Digital Sensors
        2. Reading Analog and Digital Signals
        3. The Output of a Sensor
        4. Where Readings Are Stored
        5. Active and Passive Sensors
        6. Sensor Interfacing with Microcontrollers
        7. Attributes of Sensors
        8. Range and Resolution
        9. Precision and Accuracy
        10. Linearity
        11. Sensor Calibration
        12. Problems with Sensors
        13. End User Calibration Process
        14. Calibration Methods
        15. What’s Ahead?
    18. 6. Programming the Robot’s Sensors
      1. Using the Color Sensor
        1. Color Sensor Modes
        2. Detection Range
        3. Lighting in the Robot’s Environment
        4. Calibrating the Color Sensor
        5. Programming the Color Sensor
      2. Digital Cameras Used to Detect and Track Color Objects
      3. Tracking Colored Objects with RS Media
      4. Tracking Colored Objects with the Pixy Vision Sensor
        1. Training Pixy to Detect Objects
        2. Programming the Pixy
        3. A Closer Look at the Attributes
      5. Ultrasonic Sensor
        1. Ultrasonic Sensor Limitations and Accuracy
        2. Modes of the Ultrasonic Sensor
        3. Sample Readings
        4. Data Types for Sensor Reading
        5. Calibration of the Ultrasonic Sensor
        6. Programming the Ultrasonic Sensor
      6. Compass Sensor Calculates Robot’s Heading
        1. Programming the Compass
        2. What’s Ahead?
    19. 7. Programming Motors and Servos
      1. Actuators Are Output Transducers
        1. Motor Characteristics
        2. Voltage
        3. Current
        4. Speed
        5. Torque
        6. Resistance
      2. Different Types of DC Motors
        1. Direct Current (DC) Motors
        2. Speed and Torque
        3. Motors with Gears
      3. Motor Configurations: Direct and Indirect Drivetrains
      4. Terrain Challenge for Indoor and Outdoor Robots
        1. Dealing with Terrain Challenges
        2. Torque Challenge for Robot Arm and End-Effectors
        3. Calculating Torque and Speed Requirements
        4. Motors and REQUIRE
      5. Programming the Robot to Move
        1. One Motor, Two, Three, More?
        2. Making the Moves
        3. Programming the Moves
        4. Programming Motors to Travel to a Location
        5. Programming Motors Using Arduino
      6. Robotic Arms and End-Effectors
        1. Robot Arms of Different Types
        2. Torque of the Robot Arm
        3. Different Types of End-Effectors
        4. Programming the Robot Arm
        5. Calculating Kinematics
        6. What’s Ahead?
    20. 8. Getting Started with Autonomy: Building Your Robot’s Softbot Counterpart
      1. Softbots: A First Look
        1. Parts Section
        2. The Actions Section
        3. The Tasks Section
        4. The Scenarios/Situations Section
      2. The Robot’s ROLL Model and Softbot Frame
        1. BURT Translates Softbots Frames into Classes
        2. Our First Pass at Autonomous Robot Program Designs
        3. What’s Ahead?
    21. 9. Robot SPACES
      1. A Robot Needs Its SPACES
        1. The Extended Robot Scenario
        2. The REQUIRE Checklist
        3. What Happens If Pre/Postconditions Are Not Met?
        4. What Action Choices Do I Have If Pre/Postconditions Are Not Met?
      2. A Closer Look at Robot Initialization Postconditions
        1. Power Up Preconditions and Postconditions
        2. Coding Preconditions and Postconditions
        3. Where Do the Pre/Postconditions Come From?
      3. SPACES Checks and RSVP State Diagrams
        1. What’s Ahead?
    22. 10. An Autonomous Robot Needs STORIES
      1. It’s Not Just the Actions!
        1. Birthday Robot Take 2
        2. Robot STORIES
        3. The Extended Robot Scenario
        4. Converting Unit1’s Scenario into STORIES
        5. A Closer Look at the Scenario’s Ontology
        6. Paying Attention to the Robot’s Intention
        7. Object-Oriented Robot Code and Efficiency Concerns
        8. What’s Ahead?
    23. 11. Putting It All Together: How Midamba Programmed His First Autonomous Robot
      1. Midamba’s Initial Scenario
        1. Midamba Becomes a Robot Programmer Overnight!
        2. Step 1. Robots in the Warehouse Scenario
        3. Step 2. The Robot’s Vocabulary and ROLL Model for Facility Scenario #1
        4. Step 3. RSVP for Facility Scenario #1
        5. Visual Layouts of a Robot POV Diagram
        6. Midamba’s Facility Scenario #1 (Refined)
        7. Graphical Flowchart Component of the RSVP
        8. State Diagram Component of the RSVP
      2. Midamba’s STORIES for Robot Unit1 and Unit2
        1. Autonomous Robots to Midamba’s Rescue
      3. Endnote
        1. What’s Ahead?
    24. 12. Open Source SARAA Robots for All!
      1. Low-Cost, Open-Source, Entry-Level Robots
        1. Scenario-Based Programming Supports Robot Safety and Programmer Responsibility
        2. SARAA Robots for All
        3. Recommendations for First-Time Robot Programmers
        4. Complete RSVPs, STORIES, and Source Code for Midamba’s Scenario
    25. A. BURT’s Gotchas
    26. Index