Robot Programming
A Practical Guide to Behavior-Based Robotics
Joseph L. Jones
Robotic Simulator by Daniel Roth
Copyright 2002 by The McGraw-Hill Companies, Inc. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
ISBN: 978-0-07-170850-0
MHID: 0-07-170850-2
The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-142778-4, MHID: 0-07-142778-3.
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please e-mail us at bulksales@mcgraw-hill.com.
Information contained in this book has been obtained by The McGraw-Hill Companies, Inc. (McGraw-Hill) from sources believed to be reliable. However, neither McGraw-Hill nor its authors guarantee the accuracy or completeness of any information published herein, and neither McGraw-Hill nor its authors shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw-Hill and its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought.
TERMS OF USE
This is a copyrighted work and The McGraw-Hill Companies, Inc. (McGraw-Hill) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hills prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS. McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
To Sue, Kate, and Emily
Contents
Preface
I got my first taste of robot programming in the early 1980s when I joined the research staff at MITs Artificial Intelligence Laboratory. My group was trying to solve a classic challenge in robotics called pick-and-placemake a robot pick up an object at one spot and put it down somewhere else. Given an object and a destination all the robot has to do is to figure out the actual arm and gripper motions needed to move the object to the goalthe sort of thing any two-year-old can do. Four of us worked on the problem for about five years.
Other group members worked on the parts of the program that would generate the large-scale motions of the robot arm, motions to move the arm from one region of the workspace to another. My job was to write the software that would enable our robot arm (see Figure P.1) to work out how to move the last few inches toward an object and grasp the object. The solution to the overall problem has many constraints: the robot has to grasp the object at a viable spot; the robot must avoid bumping into anything as it moves about; the robot must avoid violating what are called kinematic constraints.
Figure P.1 This Puma model 560 with custom-built gripper was one of the manipulator robots used in the Handey project. In the foreground the robot picks up a motor that will be added to an assembly (contained in the white box) at the back right. The Handey program generates all the joint motion commands needed to move the motor from the point where it is picked up, avoiding all the obstacles, and insert it into the assembly. (Photograph courtesy of Prof. Toms Lozano-Prez of the MIT Artificial Intelligence Laboratory.)
Yet another part of our work was to write code that would figure out how to reposition the object in the robots gripper if the initial grasp conflicted with obstacles or the robots kinematic limits at the putdown point. The tricky bit was that our software was supposed to be completely generalthe code had to work for any robot, in any environment, transporting any part.
In order to accomplish all these things we had to first build a world model. A world model tells the robot the geometric shape of every object in the robots workspace and where every object is located in relation to the robot. And in the same meticulous way that we modeled the environment, we also had to model the robot and to program the equations that described the robots kinematicshow the robots joints relate to each other and in which ways and how far each joint is able to move.
Our task was excruciating. Any small error in the world model could cause the robot to collide with an object when the robot tried to execute the motions it had planned. Any little mistake in the equations that describe the robot meant the robot might fail to reach the designated pickup-object or whack something along the way. If one of us accidentally bumped some object in the robots workspace, thus creating a mismatch between the real world and the robots world model, the robot would most likely strike that object. And, when at last the robot came up with a successful plan for moving an object from one place to another, the robots motions invariably looked awkward and unnatural.