Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program your NXT robot with Imagine Pavel Petrovič IDI NTNU, Trondheim

Similar presentations


Presentation on theme: "Program your NXT robot with Imagine Pavel Petrovič IDI NTNU, Trondheim"— Presentation transcript:

1 Program your NXT robot with Imagine Pavel Petrovič IDI NTNU, Trondheim ppetrovic@acm.org

2 Outline Programmable LEGO Logo and LEGO NXT: features and the ways to program it Why Logo for NXT? NXT Logo! Show… Under the hood (NXT Logo internals) The work remaining

3 Robotics in Education Positive aspects: demonstrate phenomena in novel and more ample ways, provide creative platforms for hands-on exploration for individual or group student work, increase entertainment experience during the learning process, increase motivation for learning, spawn interest in technology among students, Drawbacks and challenges: high cost of robots, extra time, space, work and competence required from teachers and schools, shortage of curriculum materials and guidelines.

4 After-school Robotics Clubs … perform important pioneering work

5 Programmable LEGO Early 90s: LEGO Dacta wired computer interface, well integrated into physics curriculum 1 st autonomous: CodePilot (1997) programmed using barcodes Mindstorms (1998) based on 8-bit Microcontroller, 32KB RAM, IR serial communication, iconic programming language with parallel events: used in many competitions (First LEGO League, RoboCup, LineFollowing, Micromouse, etc.) Many alternative programming environments; NXT (2006) = RCX improved

6 Logo and LEGO Very close relation since the beginnings of robotics LEGO Successful product (LEGO Logo) for wired LEGO Dacta Powerful parallelism, direct and easy graphical visualization of data on screen Concept abandoned with the arrival of autonomous brick

7 NXT features and programming Compatible with RCX sensors and motors Radio BT communication Supports standard I2C bus/sensors Programmed over USB cable Graphical display Powerful motors with built-in rotation sensors Compact rechargeable Li-ion battery Public full documentation of specifications Programmed in new version of RoboLab (LabView), RobotC, NXC, NBC, PbLua, Lejos, Microsoft R.S. etc.)

8 Why Logo for NXT? Shortcomings of RoboLab: –applications run only on robots despite BT Radio, little support for making interactive projects –difficult to learn –no textual form, slow, hard to maintain, debug Logo users love to use robots! Large community of Logo users – large potential for NXT robots

9 NXT Logo! Direct interactive control of NXT brick from Imagine controller project A loadable project with set of predefined procedures and operations that are supported by firmware Logo interpreter written in NBC – communicates interactively with Imagine (remote remote-expression)

10 NXT Logo Internals Implemented in low-level language NBC for reasons of efficiency; NXT firmware: insufficient memory management, our own internal C-style memory management; Garbage collection on demand; Careful handling of memory: use pointer references where possible (each word stored only once, no destructive operations – i.e. shared structures);

11 NXT Logo Internals Parser – converts string expression to internal representation Printer – inverse to parser ‘Evaleval’ – performs one step of evaluation of list-expression (i.e. evaluates one number, word, or function call) Eval – evaluates complete list-expression, i.e. function body

12 NXT Logo Internals Word and variables stored in ordered symbol tables (for fast lookup), which also feature fast insert/delete

13 NXT Logo Internals NBC does not support recursion – we simulate it using stack structures and direct jumps More than 60 primitive procedures: conditions, iterations, variables, list operations, integer arithmetic, logic operations, NXT motor and sensor control, NXT file system, etc. Only prefix operations and fixed argument count – no parentheses! As compatible with Imagine Logo as possible Expressions sent and returned directly between Imagine running on PC and NXT Logo Support for parallelism (not implemented yet)

14 Gears project to measureRatio setsensor 1 “angle setsensor 2 “angle setsensor 1 “rst setsensor 2 “rst motor “A “power 50 ; rotate the first wheel 10-times while [gt? 160 sensor 1] [ ] ; sensor2 measures the opposite ; side, output the ratio op list sensor 1 sensor 2 end

15 Pulleys Project to movePlatform setsensor 1 “lightA let “threshold 30 motor “C “power 15 motor “C “on while [lt? sensor 1 :threshold] [] motor “C “off end

16 Remaining Work Fill-in the missing blanks Update manual Make version independent from Imagine Brick to brick communication Advanced features, USB communication Provide more examples Find the user community Open-source project

17 Summary Functional language for NXT NXT control for Logo users Large NBC project Novel approach based completely on interactive radio communication Bringing NXT closer to teachers, students, and classrooms

18 Thank you for attention… … and see you at the workshop on Friday!


Download ppt "Program your NXT robot with Imagine Pavel Petrovič IDI NTNU, Trondheim"

Similar presentations


Ads by Google