The Robot Programming Language Interpreter Written in the Logo Language, Journal of Achievements in Materials and Manufacturing Engineering 45/2 (2011) 194-203
Total Page:16
File Type:pdf, Size:1020Kb
VOLUME 45 ISSUE 2 April program, carried with the validation of trajectory points. In some procedures, words and lists, so it does not differ too much from of Achievements in Materials cases, an operator can use an application that will export each other high-level languages. The main advantage is the simplicity and Manufacturing Engineering 2011 point of the trajectory to the CAD program and will present the of the program, while the disadvantages include the fact, that in path in an intelligible form [3,5]. However this method fails if the most cases Logo language is available as interpreter. This means path is created in a dynamic way, based on the result of that during each procedure call, the program code is every time conditional statements in the program. In this case, you can try to re-translated line by line. This affects the speed of program examine all the alternative trajectories, but this would require execution. For this reason, some dialects of the Logo offer sophisticated tool for source code analysis and developing the compilation to the intermediate code ("p-code") or a standalone The robot programming language form of path presentation in the CAD application. Another way of compiler. solving this problem may be the translation of the robot program There are also implementations of the Logo language in to a description similar to the pseudo code, which could be which commands have been translated into the user national interpreter written in the Logo language interpreted in a certain graphical environment. In this case, it was language. Examples include Komeniusz/Comenius Logo, ACLogo decided to adapt the Logo language for the presentation of and Imagine. Translation of commands into the foreign languages manipulator’s trajectory. Compared to the other programming K. Foit* is a non-standard approach when compared to the other languages, the Logo is a convenient tool for use in the field of programming languages. On the one hand, it can help to Institute of Engineering Processes Automation and Integrated Manufacturing robotics, due to: understand the code, but on the other, the source code is not as Systems, Faculty of Mechanical Engineering, Silesian University of Technology, x simple syntax, derived from LISP, universal as in the case of other programming language. In the ul. Konarskiego 18a, 44-100 Gliwice, Poland x direct support for mapping the path on the computer graphics Fig. 1 the sample program written in Logo is shown. On the left device (turtle graphics), * Corresponding author: E-mail address: [email protected] side is the original Logo code and on the right side the Polish x original application of turtle graphics is an interface for translation is shown. Received 14.02.2011; published in revised form 01.04.2011 mobile robot control. In the next part of this work the concept of a simple system 2.2. Turtle graphics used to visualize the trajectory of the robot manipulator, using the Logo interpreter, will be presented. Manufacturing and processing The turtle graphics is a part of the Logo language [11-15]. This graphics subsystem is very different from that used in the other high-level programming languages. In the classic case, we ABSTRACT 2. The overall description of the have a screen with a specific resolution. The points and lines Purpose: of this paper is to elaborate a simple system used to visualize the trajectory of the robot manipulator, approach defined in the absolute coordinates. The Logo language uses a using the interpreter written in the Logo programming language. The interpreter should be able to run on the virtual screen (sometimes called canvas), whose resolution is not older PC class hardware with limited RAM and CPU computing power. directly linked with the capabilities of the graphics device. In Design/methodology/approach: Compared to the other programming languages, the Logo is a convenient addition, it uses a component called the "turtle", which is tool for use in the field of robotics, due to simple syntax, derived from LISP, direct support for mapping the 2.1. The history of the Logo language characteristic for the turtle graphics. This little icon in the shape manipulator path on the computer graphics device (turtle graphics), and because the original application of turtle of a triangle or a turtle-like image (Fig. 2), is a kind of cursor, graphics was an interface for mobile robot control. The first Logo interpreter was created in 1967 at BBN which is controlled by the appropriate commands. Generally, the Findings: As the subject of further consideration, the Mitsubishi RV-M1 robot has been selected. Its laboratory, driven by three scientists: Bolt, Beranek and Newman, turtle moves in the relative coordinates, where the reference is the programming language, called Movemaster Commands, is very simply and in some aspects very similar to located in Cambridge, Massachusetts. The creators were Wally local coordinate system associated with the turtle. It is also regular BASIC programming language. This makes it useful for processing by the interpreter due to imperative Feurzeig and Seymour Papert. Two years later, at Massachusetts possible to move the turtle, giving the coordinates in relation to programming model. Institute of Technology, a turtle robot was created, as a Papert’s the global coordinate system (Fig. 3). The user decides which Research limitations/implications: The current, experimental version of the interpreter lacks some functions initiative. Original idea of turtle robot was designed under method should be used, but in most programming tasks, the first (for example workspace limits checking). Another disadvantage is that the application is dedicated to the auspices of Wiliam Grey Walter in the late forties of XX century. one is used more frequently. particular type of robot. Some problems may also occur during the graphical user interface design, because this In later years Apple and Texas Instruments began a broad part is not well implemented in the Logo. campaign to promote Logo as a programming language for beginners, especially useful for kids in primary schools. In this a) b) Practical implications: The result of the experiment is the computer application. The program is written in the way, this language has gained a reputation as trivial software for FMSLogo programming language. The developed application shares the interface with the FMSLogo. This is children. This opinion seemed to be confirmed by the presence of mainly due the fact, that the Logo is the interpreted language. turtle graphics. Originality/value: The program allows performing a simple check of the trajectory, and complements the typical program editor. There is no need to use dedicated, high-price simulators. a) b) Keywords: Robotics; Simulation; Logo c) Reference to this paper should be given in the following way: K. Foit, The robot programming language interpreter written in the Logo language, Journal of Achievements in Materials and Manufacturing Engineering 45/2 (2011) 194-203. 1. Introduction which allow testing the program - again for a specific type of 1. Introduction robot or a group of robots [1-10]. There are also complex Fig. 1. The example code in standard Logo (a) and its Polish Fig. 2. Some types of standard turtle shapes: a) default shape, simulation systems, such as RobCAD, which have a large base of localization (b) which could be found in almost all Logo implementation; b) the Robot programming is often done in high-level programming robots possible to handle in a virtual environment, but their main turtle from KTurle application - the part of KDE desktop language designed specifically for a particular type of robot. For disadvantage is the high price and fairy complex usage. However, Logo is derived from LISP and retains all the characteristics environment; c) the turtle from Curly Logo - a web implemen- the same reason dedicated simulation applications are created, in most cases, it is required to perform a simple check of the of that language. Programming in this language is based on tation of Logo 194 Research paper © Copyright by International OCSCO World Press. All rights reserved. 2011 Manufacturing and processing program, carried with the validation of trajectory points. In some procedures, words and lists, so it does not differ too much from cases, an operator can use an application that will export each other high-level languages. The main advantage is the simplicity point of the trajectory to the CAD program and will present the of the program, while the disadvantages include the fact, that in path in an intelligible form [3,5]. However this method fails if the most cases Logo language is available as interpreter. This means path is created in a dynamic way, based on the result of that during each procedure call, the program code is every time conditional statements in the program. In this case, you can try to re-translated line by line. This affects the speed of program examine all the alternative trajectories, but this would require execution. For this reason, some dialects of the Logo offer sophisticated tool for source code analysis and developing the compilation to the intermediate code ("p-code") or a standalone form of path presentation in the CAD application. Another way of compiler. solving this problem may be the translation of the robot program There are also implementations of the Logo language in to a description similar to the pseudo code, which could be which commands have been translated into the user national interpreted in a certain graphical environment. In this case, it was language. Examples include Komeniusz/Comenius Logo, ACLogo decided to adapt the Logo language for the presentation of and Imagine. Translation of commands into the foreign languages manipulator’s trajectory. Compared to the other programming is a non-standard approach when compared to the other languages, the Logo is a convenient tool for use in the field of programming languages.