Rdis: a Domain Model for Generalizing the Mappings Between Robotic Software Frameworks and Robotic Devices
Total Page:16
File Type:pdf, Size:1020Kb
RDIS: A DOMAIN MODEL FOR GENERALIZING THE MAPPINGS BETWEEN ROBOTIC SOFTWARE FRAMEWORKS AND ROBOTIC DEVICES by PAUL KILGO MONICA ANDERSON, COMMITTEE CHAIR JEFF GRAY QI HAO EUGENE SYRIANI A THESIS Submitted in partial fulfillment of the requirements for the degree of Master of Science in the Department of Computer Science in the Graduate School of The University of Alabama TUSCALOOSA, ALABAMA 2012 Copyright Paul Kilgo 2012 ALL RIGHTS RESERVED ABSTRACT Researchers, hobbyists, and industrial professionals alike have moved toward a framework- based approach to robotics application development. This allows robotic applications to be written for the domain of the framework and benefits the application developer as it offers domain-specific abstractions and reusability of applications. However, a framework must still know how to translate its domain-specific concepts to the device-specific con- cepts. One can do this in a general-purpose programming language, but this strategy is not sustainable because drivers must be hand-crafted for each possible permutation of framework and device. Therefore, exploring the appropriate level of abstraction for device drivers is interesting and may enable a description of a robot for it to be used with any robotics framework. A domain model for defining these mappings has been developed. The domain model allows descriptions of robots to be reused between frameworks. The specific mechanism for this is to describe the domain model using a textual syntax and interpret the de- scription at run-time. One may then define the transformation of framework domain concepts to concepts native to the domain model as an adapter. Thus, any appropriately enabled robotic framework and device can communicate with one another. As further evidence for the viability of the domain model, it was implemented formally using the model-driven tool AToM3. One may then design the model at a high-level directly in the terms introduced by the model without the mental load posed by the textual syntax. As well, the tool presents a preliminary approach for generating adapters for frameworks. Future directions for the domain model include kinematic state modeling. A literature review and a preliminary approach for this has also been prepared. ii DEDICATION This thesis is dedicated to the network of support I have had during my graduate career, including friends, family, and colleagues. Their patience, mentoring, and encour- agement is what has made this research possible. iii LIST OF ABBREVIATIONS AND SYMBOLS AToM3 A Tool for Multi-formalism Meta-Modeling. API Application Programming Interface. ASG Abstract Syntax Graph. AST Abstract Syntax Tree. ATL ATL Transformation Language. COMR Closeness Of Mapping Ratio. DSL Domain-Specific Language. DSML Domain-Specific Modeling Language. EMF Eclipse Modeling Framework. ER Entity-Relationship. GUI Graphical User Interface. IDE Integrated Development Environment. JSON JavaScript Object Notation. LHS Left-Hand Side. MBSD Model-Based Software Development. MDA Model-Driven Architecture. MDE Model-Driven Engineering. OCL Object Constraint Language. ODE Open Dynamics Engine. iv OGRE Open Graphics Rendering Engine. OMG Object Management Group. P2OS Pioneer 2 Operating System. PCRE Perl-Compatible Regular Expression. PEP Python Enhancement Proposal. PIM Platform-Independent Model. PREOP Providing Robotic Experiences Through Object-Based Programming. PSM Platform-Specific Model. QVT Query/View/Transformation. RDIS Robot Device Interface Specification. RDTF Robotics Domain Task Force. RHS Right-Hand Side. ROS Robot Operating System. SDF Simulation Description Format. SDK Software Development Kit. SLOC Source Lines Of Code. UML Unified Modeling Language. URDF Uniform Robot Description Format. VRML Virtual Reality Markup Language. v ACKNOWLEDGMENTS Any appearance of expertise on this subject is no doubt due to someone else pouring hours of their time into helping me understand. That said, I am greatly indebted to the members of my thesis committee. Monica Anderson has spent a great deal of the fall semester helping me get a grasp on the project with a crash course in robotics and the finer points of writing drivers. Eugene Syriani has taught me everything I know about the theory and practice of modeling. Jeff Gray has offered many good ideas for evaluation and model metrics. Qi Hao has as well given me many good ideas from his expertise. I would also like to acknowledge the Department of Computer Science at The Univer- sity of Alabama for financial support for both research and teaching during my graduate career, and for the opportunity to travel and present this research to the robotics com- munity. vi CONTENTS ABSTRACT . ii DEDICATION . iii LIST OF ABBREVIATIONS AND SYMBOLS . iv ACKNOWLEDGMENTS . vi LIST OF TABLES . xii LIST OF FIGURES . xiii 1 INTRODUCTION . 1 1.1 Robot Device Interface Specification . 3 1.2 Contributions . 5 1.2.1 Definition of the RDIS Model . 6 1.2.2 A Model-driven Approach for Describing Robots . 6 1.2.3 A Survey and Analysis of Kinematics Description . 7 1.3 Limitations and Assumptions . 7 1.4 Conclusion . 8 2 MODELING AND ROBOTICS: A LITERATURE REVIEW . 10 2.1 Application and Control Modeling . 10 2.1.1 Pure Modeling and Robotics . 10 2.1.2 Domain-Specific Languages for Robot Applications . 11 2.2 Kinematic Modeling . 12 2.2.1 Pure Modeling for Simulation Description . 12 2.2.2 Domain-Specific Languages for Simulation Description . 12 2.3 Model Metrics . 13 vii 3 TOWARD A MODEL-DRIVEN APPROACH . 15 3.1 Model-driven Software Development and Domain-Specific Modeling . 15 3.1.1 Meta-modeling . 16 3.1.2 Code Generation . 18 3.2 Models Versus Text . 18 3.2.1 Graph-like Versus Tree-like . 18 3.2.2 Editing . 19 3.2.3 Constraints . 20 3.2.4 Maintenance . 20 3.2.5 Drawbacks . 21 3.3 Tools for Model-driven Development . 21 3.3.1 AToM3 ................................. 22 3.3.2 Eclipse Modeling Framework . 22 3.3.3 MATLAB/Simulink . 23 4 THE RDIS DOMAIN MODEL . 24 4.1 Introduction . 24 4.1.1 The High-level Domain Model . 24 4.1.2 The Approach for Implementation . 25 4.1.3 The Framework-RDIS Interface . 25 4.2 Revisions to RDIS . 25 4.2.1 The Model . 25 4.2.2 The Approach . 27 4.3 State Variables . 28 4.3.1 Type System . 28 4.3.2 Scope . 29 4.3.3 Initialization and Default Values . 29 4.3.4 Future Deprecation . 29 4.4 Connection . 30 4.4.1 Startup, Keepalive, and Terminate Interfaces . 30 viii 4.5 Serial Connections . 30 4.5.1 Baud . 30 4.5.2 About Port . 30 4.5.3 Unmodeled Attributes . 30 4.6 Threading . 31 4.7 Single Threading . 31 4.7.1 Frequency . 31 4.8 Other Threading Models . 31 4.9 Primitives . 31 4.9.1 Parameters . 32 4.9.2 Format Arguments . 32 4.9.3 Post-actions . 32 4.9.4 On Variable-length Messages . 32 4.10 Local Interface . 33 4.10.1 Parameters . 33 4.10.2 Types . 33 4.10.3 Primitive Calls . 33 4.11 Domain Adapter . 34 4.11.1 Range . 34 4.11.2 Differential Speed . 34 4.12 Domain Interface . 34 4.12.1 Incoming Domain Adapter . 35 4.13 Domain Output . 35 4.13.1 Outgoing Domain Adapter . 36 4.14 Mini-language . 37 4.15 Evaluation . 38 4.15.1 Abstraction . 38 4.15.2 Understandability . 39 4.15.3 Accuracy . 40 ix 4.15.4 Predictiveness . 42 4.15.5 Inexpensive . 42 4.16 Conclusion . 43 5 IMPLEMENTATION OF RDIS FOR AToM3 . 45 5.1 Introduction . 45 5.1.1 Modeling the Framework . 46 5.2 Solution . 46 5.2.1 The RDIS Formalism . 47 5.2.2 Background for RDIS . 48 5.2.3 The ROS Formalism . 49 5.2.4 Code Generators . 53 5.2.5 ROS Code Generator . 54 5.2.6 RDIS Interpreter . 55 5.2.7 Style . 56 5.3 Evaluation . ..