Difference between revisions of "NXT Logo Overview"

From RoboWiki
Jump to: navigation, search
(moved from main NXT Logo page)
 
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
== Welcome to Logo for NXT ==
 
== Welcome to Logo for NXT ==
  
[[Eurologo2007 Workshop]]
+
''[[Logo for NXT|Return to main page]]''
 
 
This page contains information about the project of programming NXT in Logo language.
 
 
 
The project is under intensive development, and there are no releases yet. '''the first preview will come in the very start of September'''
 
However, the projet is open-source and the latest development version is available in the [http://webcvs.robotika.sk/cgi-bin/cvsweb/robotika/src/imagine/nxt/logo/current/ CVS].
 
 
 
[[Image:nxtlogo.gif]]
 
  
 
== Features ==
 
== Features ==
  
* Implemented in Imagine and [[NBC|Next Byte Codes]] (NBC)
+
* General-purpose educational Lisp-like functional language
 +
* Introduces new level of LEGO Robots programming: children can create interactive educational LOGO projects that control LEGO robots with easy button/turtle controls, and flexible visualization of data collected by robots - programmable by children Logo programmers!
 +
* Implemented in [http://www.logo.com/imagine/ Imagine Logo] and [[NBC|Next Byte Codes]] (NBC)
 
* Three levels of use:
 
* Three levels of use:
# Interactive Imagine project with direct GUI controls that allow interfacing with NXT robot over Bluetooth
+
# Interactive Imagine Logo project with direct GUI controls that allow steering NXT robots over Bluetooth radio
 
# Loadable imagine library (nxt.imt) that contains set of procedures for direct control of NXT robot over Bluetooth from your Imagine projects
 
# Loadable imagine library (nxt.imt) that contains set of procedures for direct control of NXT robot over Bluetooth from your Imagine projects
 
# Interpreter of Logo running on the NXT that can run logo programs (with restricted syntax), which can communicate with Imagine projects and control the robots motors and sensors.  
 
# Interpreter of Logo running on the NXT that can run logo programs (with restricted syntax), which can communicate with Imagine projects and control the robots motors and sensors.  
 +
# Finally :-), ''you can use NXT Logo completely without Imagine Logo'', it is self-contained.
 +
* NXT Logo is available free of charge, and it is open-source project
 +
* First preview version (without memory garbage collection) available for download on 2nd October 2007
 +
* Important note: NXT Logo is currently interpreted by a program implemented in an interpreted language NBC. Therefore, it is not suitable where fast performance is important (for example robotics competitions). We are working on a faster version implemented in firmware to be released in 2008.
  
== Motor & Sensor procedures ==
 
 
(motor m cmd arg)
 
 
  where m is the number of motor(s) as in NBC:
 
    0 - motor A
 
    1 - motor B
 
    2 - motor C
 
    3 - motors AB
 
    4 - motors AC
 
    5 - motors BC
 
    6 - motors ABC
 
   
 
  and cmd is one of (with the corresponding argument, similar to NBC): 
 
    onfwd      power
 
    onrev      power 
 
    off        (ignored)
 
    float      (ignored)
 
    fwdr        [power regmode]
 
    revr        [power regmode]
 
    fwds        [power turnpct]
 
    revs        [power turnpct]
 
    onrot      [power angle]
 
    rst        kind  (1-4)   
 
 
(readmotor m cmd)
 
 
  where cmd is one of:
 
    rotations
 
    tacho
 
    blocktacho
 
 
(sensor N)
 
 
(setsensor N type)
 
 
    where type is number according to NBC:
 
      0 - raw
 
      1 - switch
 
      2 - temperature
 
      3 - refl
 
      4 - angle
 
      5 - light active
 
      6 - light inactive
 
      7 - sound db
 
      8 - sound dba
 
      9 - custom
 
      10 - lowspeed
 
      11 - lowspeed with 9V
 
      12 - high speed
 
    add the following constants for adjusting the output:
 
      32 - boolean output (0/1)
 
      64 - transition count
 
      96 - period counter
 
      128 - percentage (0-1023 value normalized to 0-100)
 
      160 - temperature in C
 
      192 - temperature in F
 
      224 - angle steps
 
      31 - slope mask
 
      224 - mode mask
 
  
== Supported primitives ==
+
== Requirements ==
  
NXT Logo supports the following primitive procedures and operations:
+
NXT Logo currently communicates well with PCs running Windows or Linux platforms and it strongly benefits from interaction with Imagine Logo, which is recommended, but not required. It communicates with NXT robots only using the Bluetooth radio link, therefore the BlueTooth USB dongle (or another BlueTooth device on your PC) is strongly recommended. We are working on a solution that will allow for the whole classroom to work with only one BlueTooth USB dongle (coming soon) as long as the computers are connected through a TCP/IP network.
  
# Arithmetic:  ''<tt>add, sub, mul, div, mod, neg</tt>''
+
NXT Logo is a complete program, i.e. programs written in Logo run on the NXT brick without a PC too, as long as you can copy the text files to NXT Flash memory, it will start them from there. This makes it possible to use NXT Logo also for the Mac and Linux users and for Windows users without BlueTooth radio device.
# Logic: ''<tt>and, or, xor, not</tt>''
 
# Bitwise: ''<tt>bitand, bitor, bitxor, bitnot</tt>''
 
# Lists and words: ''<tt>first, bf, last, bl, item, se, list, word</tt>''
 
# Maps & co.: ''<tt>map, apply, foreach, run, remote</tt>''
 
# Loops and conditions: ''<tt>repeat, while, foreach, if, ifelse</tt>''
 
# Predicates: ''<tt>empty? number? list? word? equal? gt? lt? ge? le? member?</tt>''
 
# Variables and procedures: ''<tt>make, let, to, op, stop, erase, launch</tt>''
 
# NXT file handling: ''<tt>load, printto, fopen, fwrite, fread, fclose, fremove</tt>''
 
# Sounds: ''<tt>tone, sound</tt>''
 
# Motors, sensors: ''<tt>motor, readmotor, sensor, setsensor, battery</tt>''
 
# Other: ''<tt>wait, random, print, draw, ascii, char, boot, gc, fm</tt>''
 
  
The expressions must be in prefix notation. Variables are used the same way as in Logo - as "name when referring to variable name, and as :name when referring to its value. There are global variables as well as local variables, lexical scoping as usual in Logo.
+
Linux users: NXT Logo integrates well with Linux environment and Linux version of UCBLogo using the remote1 command-line utitlity. See the [http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/current/misc/remote/readme.txt  misc/remote/readme.txt] file for details.
 +
  
The <tt>(remote "expression)</tt> operations allow to start evaluating an expression on NXT when started from PC, and vice-versa. This can be used for communication. Of course, one could then easily say, for example:
+
== Publications ==
  
remote "|[print "hello]|
+
* [[Media:eurologo2007_nxtlogo.pdf|Eurologo 2007 paper]] and [http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/doc/nxtlogo.ppt presentation]
 +
* [[Eurologo2007 Workshop]]
 +
* [http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/doc/nxthungarologo.ppt Presentation at HungaroLogo]
 +
* [http://ii.fmph.uniba.sk/~petrovic/didinfo_2008_petrovic_nxt_logo_full.pdf Riadenie modelov a spracovanie udajov v systeme NXT Logo], Didinfo 2008, Banská Bystrica, April 3-4 2008 (in Slovak)
  
or
+
== Notes ==
  
remote "|[my_program 123]|
+
* [http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/doc/ideas.html Ideas for future development]
  
or read value of remote variable:
+
== Links ==
  
remote "|:var|
+
* [[Charts for Imagine]]
 +
* [http://web.mit.edu/manoli/robologo/www/full.html RobotLogo]
 +
* [http://llk.media.mit.edu/projects/cricket/doc/help/logoblocks/ref-rcx.html LogoBlocks]
 +
* [http://www.microworlds.com/solutions/mwexrobotics.html MicroWorlds EX Robotics]
 +
* [http://llk.media.mit.edu/projects/cricket/doc/help/logoblocks/ref-rcx.html Robotics in the Classroom]
 +
* [http://nxtmote.sourceforge.net/ NXTMote: TinyOS for NXT]
 +
* [http://nxtgcc.sourceforge.net NXTGCC]
  
However, one has to keep in mind that BlueTooth communication is slow due to switching of the direction of the transceiver and receiver. Therefore, it is preferable to implement higher-level functions and procedures that can run on NXT brick autonomously. Logo programs have about 30kb of memory available - for storing both the logo programs and data, however, programs can load/erase data and code from NXT files that are stored in the large flash.
+
__notoc__
  
== Examples ==
+
[[Category:LEGO]]
 
 
Some sample code for Logo for NXT is in the [http://webcvs.robotika.sk/cgi-bin/cvsweb/robotika/src/imagine/nxt/logo/current/examples Examples folder].
 
 
 
== Syntax ==
 
 
 
Detailed syntax is shown in the file [http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/current/syntax.txt?content-type=text%2Fplain syntax.txt].
 
 
 
== Reference Guide ==
 
 
 
More detailed description of all commands and the system are located here:
 
[http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/current/reference_guide.html Logo for NXT Reference Guide].
 
 
 
== Internals ==
 
 
 
Short specification of the Logo for NXT internals is in the file
 
[http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/current/specification.txt?content-type=text%2Fplain specification.txt].
 
 
 
== Publications ==
 
 
 
* [[Media:eurologo2007_nxtlogo.pdf|Eurologo 2007 paper]] and [http://webcvs.robotika.sk/cgi-bin/cvsweb/~checkout~/robotika/src/imagine/nxt/logo/doc/nxtlogo.ppt presentation]
 
 
 
__notoc__
 

Latest revision as of 23:59, 4 March 2009

Welcome to Logo for NXT

Return to main page

Features

  • General-purpose educational Lisp-like functional language
  • Introduces new level of LEGO Robots programming: children can create interactive educational LOGO projects that control LEGO robots with easy button/turtle controls, and flexible visualization of data collected by robots - programmable by children Logo programmers!
  • Implemented in Imagine Logo and Next Byte Codes (NBC)
  • Three levels of use:
  1. Interactive Imagine Logo project with direct GUI controls that allow steering NXT robots over Bluetooth radio
  2. Loadable imagine library (nxt.imt) that contains set of procedures for direct control of NXT robot over Bluetooth from your Imagine projects
  3. Interpreter of Logo running on the NXT that can run logo programs (with restricted syntax), which can communicate with Imagine projects and control the robots motors and sensors.
  4. Finally :-), you can use NXT Logo completely without Imagine Logo, it is self-contained.
  • NXT Logo is available free of charge, and it is open-source project
  • First preview version (without memory garbage collection) available for download on 2nd October 2007
  • Important note: NXT Logo is currently interpreted by a program implemented in an interpreted language NBC. Therefore, it is not suitable where fast performance is important (for example robotics competitions). We are working on a faster version implemented in firmware to be released in 2008.


Requirements

NXT Logo currently communicates well with PCs running Windows or Linux platforms and it strongly benefits from interaction with Imagine Logo, which is recommended, but not required. It communicates with NXT robots only using the Bluetooth radio link, therefore the BlueTooth USB dongle (or another BlueTooth device on your PC) is strongly recommended. We are working on a solution that will allow for the whole classroom to work with only one BlueTooth USB dongle (coming soon) as long as the computers are connected through a TCP/IP network.

NXT Logo is a complete program, i.e. programs written in Logo run on the NXT brick without a PC too, as long as you can copy the text files to NXT Flash memory, it will start them from there. This makes it possible to use NXT Logo also for the Mac and Linux users and for Windows users without BlueTooth radio device.

Linux users: NXT Logo integrates well with Linux environment and Linux version of UCBLogo using the remote1 command-line utitlity. See the misc/remote/readme.txt file for details.


Publications

Notes

Links