Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lego Mindstorms and Tcl

31 views
Skip to first unread message

Alexandre Ferrieux

unread,
Mar 28, 2007, 5:09:05 PM3/28/07
to
Hi,

I'm looking for recent work on using Tcl to drive Lego Mindstorms NXT
I've found on c.l.t the following item, but it dates back to 2002 and
older hardware (RCX)

http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/74c133e783518923/f42ee438d0ae10d1?lnk=gst&q=mindstorms&rnum=2&hl=en#f42ee438d0ae10d1

What I would like to do is have a Tcl program running on a PC interact
in real-time with the sensors and effectors; the Lego-provided
software is only about editing, compiling, and installing in flash a
tiny program for the embedded microcontroller; then the whole stuff
runs autonomously, with the USB wire removed.

With a realtime bidirectional flow of events and commands to/from a
PC, the range of possibilities obviously expands by several orders of
magnitude (there's a bluetooth link if the USB cable is too rigid and
short). And doing all this in Tcl should be a treat...

Any ideas ? Proof that's impossible ? Experiments outside Tcl ?

TIA,

-Alex

Gerald W. Lester

unread,
Mar 28, 2007, 7:40:44 PM3/28/07
to

What kind of an API do they provide?

Will events and sensor information flow over the bluetooth link?

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

Uwe Klein

unread,
Mar 29, 2007, 4:49:45 AM3/29/07
to

The NXT stuff seems to be based in National Instruments LabView.

Someone has done Blootooth connect:
http://www.google.com/search?q=Mindstorms+NXT+linux

Some articles on slashdot.
http://slashdot.org/search.pl?query=lego+nxt

Lots of stuff on sourceforge:
http://sourceforge.net/search/?type_of_search=soft&words=nxt

loks like no tcl though.

uwe

Alexandre Ferrieux

unread,
Mar 29, 2007, 4:52:36 PM3/29/07
to
On Mar 29, 10:49 am, Uwe Klein <uwe_klein_habertw...@t-online.de>
wrote:

>
> The NXT stuff seems to be based in National Instruments LabView.

OK. Now I know whom to blame for the terrible graphical code
editor :-)

> Someone has done Blootooth connect:http://www.google.com/search?q=Mindstorms+NXT+linux

> Some articles on slashdot.http://slashdot.org/search.pl?query=lego+nxt


> Lots of stuff on sourceforge:http://sourceforge.net/search/?type_of_search=soft&words=nxt
> loks like no tcl though.

Thanks very much Uwe. I believe the closest to Tcl would be NXT
Python. I guess I could extract the needed info from there; but for
the BlueTooth part they say they use PyBluez -- this yields the
obvious question: do we have an equivalent Tcl "glove" for bluetooth ?

-Alex

Uwe Klein

unread,
Mar 29, 2007, 5:14:49 PM3/29/07
to
due to a complete lack of royal blood I don't have a single blue tooth.
( white, er slightly tea stained ) i.e I don't know my way around bluetooth stuff.

could one touch this with the tcl magic stick? i.e. accessing python
from tcl via an embedded interp?
>
> -Alex
>

uwe

Uwe Klein

unread,
Mar 29, 2007, 5:19:37 PM3/29/07
to
due to a complete lack of royal blood I don't have a single blue tooth.
( white, er slightly tea stained ) i.e I don't know my way around bluetooth stuff.

could one touch this with the tcl magic stick? i.e. accessing python
from tcl via an embedded interp?

just found this:
http://news.hping.org/comp.lang.tcl.archive/7698.html

if this can be handled via "serial" comm one should be
able to handle it with expect?

>
> -Alex
>

uwe

Message has been deleted

Alexandre Ferrieux

unread,
Mar 30, 2007, 8:44:01 AM3/30/07
to
On Mar 29, 11:19 pm, Uwe Klein <uwe_klein_habertw...@t-online.de>
wrote:

Yup, seen that one too :-)

> if this can be handled via "serial" comm one should be
> able to handle it with expect?

Or even vanilla Tcl (unless somebody has bad news about fileevents on
serial in Windows). My problem with this, is I don't know whether NXT
uses the RFCOMM profile (the one emulating a serial port) or another
one. Have to investigate further into the links you gave.

-Alex

Larry W. Virden

unread,
Mar 30, 2007, 11:34:30 AM3/30/07
to
On Mar 28, 5:09 pm, "Alexandre Ferrieux"

<alexandre.ferri...@gmail.com> wrote:
> Hi,
>
> I'm looking for recent work on using Tcl to drive Lego Mindstorms NXT
> I've found on c.l.t the following item, but it dates back to 2002 and
> older hardware (RCX)
>
> http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/74c133...
>

When I google for "tcl legio mindstorms" 173,000 hits return. However,
near the first I notice something about an article by Laurent Demailly
and Tcl. Yes, it does also talk about RCX. However, I wonder if
contacting Laurent might be useful, to see if he's still working with
Mindstorms.

Alexandre Ferrieux

unread,
Apr 1, 2007, 7:36:49 PM4/1/07
to
Reporting progress:

- All advanced documentation from Lego can be found at
http://mindstorms.lego.com/Overview/NXTreme.aspx

- Basically, to control the robot from a PC, one should write a
generic control loop to be embedded, start it, and interact with it
over the data link (bt or usb).

- In there exquisite wisdom, Lego people wrote one such generic
control loop and built it into the bundled firmware ! That's a relief,
because the VM, which is documented in detail, is not the kind of
thing you'll want to spend time on... This built-in control loop
enables a sub-protocol named "Direct Commands" and lightly documented
in Appendix 2 of the Bluetooth SDK.

- Back to your suggestion, Uwe. I think there's no need to harness
Python to access the Bluetooth link. Indeed, all this works in serial
port emulation mode. So you just have to instruct the BT manager on
your PC to allocate a COM[0-9] port, do the necessary manipulations so
that the two devices shake hands, and voila.

Best regards,

-Alex


0 new messages