1 / 11

OGEL: LEGO Mindstorm Controller Language

OGEL: LEGO Mindstorm Controller Language. Michael Ching Gerardo Flores Matt Kalish Charles O’Donnell May 13, 2003. LEGO Mindstorms. Robotic architecture that allows one to build components from Legos and control sensors and motors from a microcontroller

clayton
Download Presentation

OGEL: LEGO Mindstorm Controller Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OGEL:LEGO Mindstorm Controller Language Michael Ching Gerardo Flores Matt Kalish Charles O’Donnell May 13, 2003

  2. LEGO Mindstorms • Robotic architecture that allows one to build components from Legos and control sensors and motors from a microcontroller • Complexity of microcontroller can be chosen (Scout, RCX 1.0, RCX 2.0, CyberMaster) • Different development environments may be chosen that vary from a drag and drop approach to a C-syntax based language

  3. Not Quite C • Targets experienced programmers • C syntax and semantics • Textual language removes the graphical metaphors that limit the type of programs that may be written • Supported by several IDEs (WinNQC, MacNQC, Visual NQC, NQCEdit, Bricx Command Center) • Not modular in nature • Does not support hierarchy or abstraction of code • Questionable event-based support

  4. OGEL • Designed to support the RCX 1.0 but offers support for future firmware (Compatible with 2.0) • Merge desirable characteristics of available technologies • Built scalable hierarchy which improves code reuse

  5. OGEL (Cont’d) • Able to create code for multiple target microcontrollers from one file • Improved message passing architecture • Improved modularity which leads to a more stable hierarchy • Allows imbedded self-contained Not Quite C code • Permits separation of RCX, task, message, and function declarations into library files which can be added to any existing code by means of include statements

  6. Architecture

  7. Architecture Discussion • 5 Stages: Preprocessor, Lexer/Parser, Static-Semantic Checking, UNI-OGEL Generator, Architectural Translator. • Preprocessor: #include, #define, task/function order independence

  8. Architecture Discussion • Lexer/Parser – Static-Semantic Checking • UNI-OGEL Generator: code duplication & port mapping, source code profiling • Architectural Translator: any architecture, architecture-specific errors discovered (task limit, recursion), optimization

  9. Testing • Testing was done in 3 phases • Isolated Module Testing • Integration Testing • Final Testing

  10. Sample OGEL Code #define TIME_REV 100 message done; rcx demo { SENSOR_TOUCH hit = $1; left_motor = $A; right_motor = $C; } task go(in hit)(out left_motor, out right_motor) { when (hit>0) do reverse(); nqc.OnFwd(left_motor + right_motor); } void turn()()(out left_motor, out right_motor) { nqc.OnRev(left_motor); nqc.OnFwd(right_motor); nqc.Wait(TIME_REV); nqc.Off(left_motor + right_motor); throw done; } void reverse()()(out left_motor, out right_motor) { nqc.OnRev(left_motor + right_motor); nqc.Wait(TIME_REV); nqc.Off(left_motor + right_motor); turn(); } task rev_task()(out left_motor, out right_motor) { int x = 1; while (x > 0) { catch done; reverse(); } } task main() { rcx demo first_born; first_born.addTask(rev_task); first_born.addTask(go); }

  11. Watch This Puppy run! Division of Work: Front-End: Michael Ching / Gerardo Flores Back-End: Charles O’Donnell Floater, Docs Compilation: Matt Kalish

More Related