Program your NXT robot with Imagine

Our aim is to develop a versatile toolset for constructive learning. We achieve it through the marriage of powerful learning tools: a universal learning environment Imagine Logo (Kalaš and Hrušecká, 2004) and the recent and most popular educational robotics kit LEGO Mindstorms NXT. LEGO Mindstorms NXT is the second generation robotics toolkit. Performance and robustness have been improved, infrared communication medium was replaced by BlueTooth radio, new sensor types and motor actuators are more powerful with built-in encoders. Educational software RoboLab has been completely rewritten based on the collected experiences. And perhaps the most important is that the platform is open and well documented down to the low-level hardware layer. Schools and educational centres already own the sets. However, the chosen approach used in the RoboLab educational software does not necessarily suit all needs. In particular: Despite the communication capabilities of the robots, the software does not provide any means for writing applications for the PC, which could interact with the robots; The software requires learning yet another language, which may be a too high obstacle for educators; The coding style is based on drawing flow-chart diagrams, which easily become complex and difficult to understand, modify, debug, and analyze; the language lacks structure, the possibility to view programs as plain text; and it implies serious limitations; Other environments for NXT programming are already available, but they usually suffer from some of these shortcomings. Our approach is different. Let us use the existing power of Imagine Logo, and give its users the possibility to control and even program their NXT robots. We demonstrate how this on three different levels, all utilizing the BlueTooth communication: Direct interactive control of robot sensors and actuators from Imagine environment; Loadable Imagine project with procedures for interfacing robots from Imagine projects; Possibility to download and run a piece of Logo program directly on NXT robots, while this program may communicate with an Imagine project running on the PC or other NXT robots. The programs running on NXT robots may feature multithreading and get access to all features of the NXT brick. User works only with the procedures that were implemented in Imagine Logo. The logo interpreter – a program written with Next Byte Codes is automatically downloaded to NXT from Imagine environment. The solution does not require the firmware replacement. Our implementation is open-source and available for further development and improvement. In this paper, we describe all three interaction modes on demonstrative examples. In the second part, we develop two educational experiments for physics and mathematics. These include the Imagine project and robot setup. In the mathematics experiment, the children are presented with a black-box with gears, where their task is to write a program in Imagine Logo, which will utilize the sensors in order to measure the angular velocity of the input and output of the gear box, compute the conversion ratio, and thus determine the contents of the box given the known set of gear wheels. The physics experiment demonstrates the use of pulleys and a division of force. Students measure and observe the difference in force applied by the motor in various pulley setups.