ERC Center for Computer Integrated Surgical Systems & Technology1 A Review of Two Robot Control Language Papers to Define our Scope Presented by: Andy LaMora IRE Literature Review The Johns Hopkins University April 1, 2004
ERC Center for Computer Integrated Surgical Systems & Technology2 Brief Reminder: IRE C++ Robot Control LibraryC++ Numerical LibraryC++ Vector/Matrix Libraries MFC Windows Application (Including Edit boxes, Dialog boxes, buttons, etc) How a typical ERC/CISST robot application may appear today… No scripting! No Command Line Interaction!
ERC Center for Computer Integrated Surgical Systems & Technology3 Brief Reminder: IRE C++ Robot Control LibraryC++ Numerical LibraryC++ Vector/Matrix Libraries MFC Windows Application (Including Edit boxes, Dialog boxes, buttons, etc) …and how it would appear with IRE We can script whole programs! We can interact with running MFC applications at the command line! And we might be able to do other things too. SWIG Class Wrapper Python Workspace SWIG Class Wrapper Object Registry
ERC Center for Computer Integrated Surgical Systems & Technology4 Pursuing the Literature Goal: to address Architecture issues (distinct from implementation): - Define our role in the world - Understand our scope with respect to other approaches - Identify opportunities afforded by our loosely coupled architecture (AI abstraction?) Selected papers demonstrate successful implementations of layered languages built with different design priorities: - 1: “AML/X: A Programming Language for Design and Manufacturing” - 2: “Python Robotics: An Environment for Exploring Robotics Beyond LEGOs”
ERC Center for Computer Integrated Surgical Systems & Technology5 Paper One: AML/X “AML/X: A Programming Language for Design and Manufacturing” Nackman, LR, Lavin, M, Taylor, RH, Dietrich, Jr., WC, and Grossman, DD (1986) Based on AML: “A Manufacturing Language” AML is a custom, interpreted control language (interpreter written in C). Extended AML to include Object Orientated features, improved Exception handling, and is used in Vision and CAD Is “a general purpose programming language tailored for use in manufacturing and computer aided design.” Why This Paper? Object-Orientated and Interpreted AML was/is used in real commercial applications (“tested by fire”) Excellent description of rationale and design criteria Insight into the experience of the mentors guiding ERC robot software development Sophisticated design but 18 years old: comparison to contemporary efforts might be insightful
ERC Center for Computer Integrated Surgical Systems & Technology6 Paper Outline 1.Introduction 2.Design Rational 1.General Principles 2.Language Design Criterion 3.Language Description 1.Data Objects & Operators 2.Aggregates 3.Control Operators 4.Expression Evaluation 5.Subroutines/Local Variables 6.Exception Handling 7.Object Orientated Programming 4.Examples 5.Implementation 6.Experience & Conclusions
ERC Center for Computer Integrated Surgical Systems & Technology7 Paper Outline 1.Introduction 2.Design Rational 1.General Principles 2.Language Design Criterion 3.Language Description 1.Data Objects & Operators 2.Aggregates 3.Control Operators 4.Expression Evaluation 5.Subroutines/Local Variables 6.Exception Handling 7.Object Orientated Programming 4.Examples 5.Implementation 6.Experience & Conclusions
ERC Center for Computer Integrated Surgical Systems & Technology8 The Problem To develop a stabile, robust, and layered language that allows unsophisticated users to effectively program useful applications, while providing enough expressiveness for sophisticated users to develop more advanced and flexible applications To provide an integrated environment that transcends merely a collection of disparate tool libraries To provide a framework that allows the simultaneous integration and expansion of computer vision, robot control, and CAD.
ERC Center for Computer Integrated Surgical Systems & Technology9 General Design Principles Hoare’s dictum: the language designer’s task is one of “consolidation, not innovation.” –Authors chose from among constructs and ideas that had been tested in other languages. Strong influences: LISP, APL, SMALLTALK Prefer general purpose constructs to those meeting specific, limited, application needs. AML/X debugging tools are an extention of its sophisticated exception handling mechanism, and glues the features into a coherent product. Can be difficult “when an important user requests a specific new feature.” Feature Orthogonality; “meaning of the use of a construct should be independent of its use in combination with some other construct.”
ERC Center for Computer Integrated Surgical Systems & Technology10 Language Criteria Identifies 3 domains: –Robot programming –Machine vision –CAD Three classes of users: –End users (little programming skill but must “chain together” sequences of high level commands) –Application Developers (provide high level functionality for small classes of users) –Application Development Environment Developers (writing robot and CAD systems) Also wanted to preserve procedural C-style support from AML
ERC Center for Computer Integrated Surgical Systems & Technology11 Aggregates A collection of objects that can be treated as one. Most basic data grouping mechanism of AML/X Distinct from scalar objects (INT, CHAR, etc) Akin to Python dictionary object
ERC Center for Computer Integrated Surgical Systems & Technology12 Exception Handling Very similar to Java: can define an Exception Handler for particular exceptions Exceptions can be raised by : –The system on an error –Explicitly by RIASE_EXCEPTION –AML/X finds the most recent (active) block containing a handler for the type of variable that caused the exception.
ERC Center for Computer Integrated Surgical Systems & Technology13 Exception Handling:More EXPR: evaluate an expression. Result becomes result of handler SUBROUTINE: a subroutine is called, information is passed in the arguments (which can be an aggregate). Result of subroutine becomes result of handler. LABEL: branch to label. No result. BOOLEAN: result of the exception handler is TRUE SYMBOL: define another exception to raise instead. Very useful feature: allows hierarchy of exception groups. EXCP_BINDING: a subroutine to determine the current handler, and make a control decision.
ERC Center for Computer Integrated Surgical Systems & Technology14 Implementation
ERC Center for Computer Integrated Surgical Systems & Technology15 Implementation
ERC Center for Computer Integrated Surgical Systems & Technology16 Implementation
ERC Center for Computer Integrated Surgical Systems & Technology17 Relevance to IRE Mostly important design cues: AML provides on-line development by (in part) exposing libraries of objects. –Main architectural difference is that IRE applications are not necessary developed in the scripting language; the IRE developer has no knowledge of line-by-line code unless he/she has the C++ source AML has a sophisticated error handling architecture –Most IRE error handling is processed by C++ code, but some thought on this is necessary if the Python library is extended to include AI constructs. AML was successful and useful
ERC Center for Computer Integrated Surgical Systems & Technology18 Critique Very helpful description of design approach Early (pre-C++) implementation of an OO system System was clearly effective and useful –Initial RoboDoc versions were developed in AML, including the canine clinical study Entire language is interpreted: –Security concerns? –You’re shipping your source to your customers Can it be encoded? Is that safe? –Speed concerns? No apparent built-in AI support –But could probably be extended by including C++ libraries
ERC Center for Computer Integrated Surgical Systems & Technology19 Paper Two: Pyro “Python Robotics: An Environment for Exploring Robotics Beyond LEGOs” Blank, D, Meeden, L, and Kumar, Deepak (2002) ACM Special Interest Group: Computer Science Education Conference, Reno, NV (SIGCSE 2003) Pyro: short for Python Robotics Intended for Undergraduate robotic study courses, to explore control paradigms Cross-platform (works on lots of robots) Includes a simulator Why This Paper? The entire system is implemented in Python (Vision, Control, etc) It is Open-Source Designed to explore abstract AI concepts in addition to robot control
ERC Center for Computer Integrated Surgical Systems & Technology20 Paper Outline 1.Introduction 2.Pyro: Python Robotics 1.Pyro Components 2.Pyro Examples 3.Pyro in the Curriculum 4.Summary
ERC Center for Computer Integrated Surgical Systems & Technology21 The Problem Robots like LEGO MindStorms are too simple for effective undergraduate education (e.g. limited vision and AI support) More advanced robots are available, but are research-orientated and each is implemented with complicated and often proprietary control software, presenting two problems: –Significant time is invested learning specifics of a vendor’s implementation, instead of learning techniques of higher academic value. –Architecture between platforms is substantially different; none of the code and possibly none of the knowledge gained is transferable between platforms.
ERC Center for Computer Integrated Surgical Systems & Technology22 The Solution Write your own uniform, cross-platform library to abstract controller implementation details from application code. In Python. Goals: Easy for beginning students to learn Provide a modern object-oriented programming paradigm Run on several platforms Allow exploration of many different robot control paradigms and methodologies Remain useful as users gain expertise Be extendable Allow for the creation of “modern-looking” visualizations, and be distributed as open source software
ERC Center for Computer Integrated Surgical Systems & Technology23 Pyro Architecture Python code modules interact with vendor-specific APIs, exposing functionality to higher layers via the Pyro library, a uniform API. Other custom or Open Source Python libraries can be integrated (e.g. numerical routines) An arbitrary application imports Pyro libraries to invoke calls to the Pyro API.
ERC Center for Computer Integrated Surgical Systems & Technology24 Components and AI Support ANN and ANN Back-propagation Error module Self-organizing Map module Fuzzy Logic Behavior-based brain module OpenGL Interface and Renderer Graphing Module Generic Simulator Each is a library and can be run stand-alone, or via the Pyro command interpreter. Pyro defines a “brain”
ERC Center for Computer Integrated Surgical Systems & Technology25 Portability: Sensor Abstraction Robot Units –Data is converted into a type that is meaningful to the robot 1 Khepera unit = 60mm 1 Pioneer unit = 2 ft. Avoid naming specific sensors –“Front-left” means; On Khepera: read by a single infrared sensor On Pioneer: read by three sonar sensors
ERC Center for Computer Integrated Surgical Systems & Technology26 Pyro Results Generally acceptable, since the targeted equipment generally handles up to only 10 updates per second. Also, the same module (as tested) can be run on a 75 lbs Pioneer robot, or 2” tall Khepera robot. Probably not be reliable enough for clinical use, or integration with numerous robots.
ERC Center for Computer Integrated Surgical Systems & Technology27 Critique Where’s the discussion on wrapping/implementation? Do the platform APIs provide Python interfaces? –Open source, so I could look there, but I’d like to hear a discussion of the problems they likely encountered, and how they solved them (in other words, were’s the hack?) Language Comparisons: why is Python better than, say, TCL? Paper organization: clumsy Authors use a more narrative than structured style Discussion on sensor abstraction
ERC Center for Computer Integrated Surgical Systems & Technology28 Questions?