Slashdot Mirror


Lego Mindstorms Controlled by Pilot Via JINI

Nobody writes "JavaSoft has a cool article on how they've used their JINI technology to allow a Palm Pilot to control a Lego Mindstorms brick. " The scary thing is that this is one of the more useful applications of Java I've seen...

31 of 135 comments (clear)

  1. Cellphone printing to Bangkok by Neville · · Score: 4
    It's fine to be cynical of Sun's marketing of java, but it's silly to by cynical of the enterprise changes it's undergone over the past year. When will people talk about the actual apps, and not just lump all java stuff together because they're written in the same tongue?

    Anyway, java is highly useful for things like quickly developing complex object and service distribution. For example, encapsulating a service (like a printer in Bangkok, say, wrapped in a java object referenced as an interface), sticking it in a naming directory (could be iiop-based, could be rmi-based, could be something similar to ldap -- java can do it all in a very similar way), and then obtaining a reference to that object and calling its methods from ANY client (an embedded applet on a cellphone, for example) -- this is very cool stuff, and lumping it into the same category as tickertape applets just because they're both java is annoying and ignorant. Should we lump all C stuff together just because it's done in the same language?

    The primary advantage of doing all this in java is not platform independence as much as extremely rapid (thus less costly) development.

    All this is not to say that any of this will run across linux -- based on Gosling's comments here last week, java will run with these legos and on Palm Pilots better than any linux port for the foreseeable future.

    1. Re:Cellphone printing to Bangkok by Anonymous Coward · · Score: 2

      You are seeing this very very neat application that gets you drooling, and you ask the salesperson "i want one! what is it written in?". The salesperson then say, "well, it's java, sir!" and you automatically assume that java is the greatest thing in the world.

      I think you've read to far into his post. No where did he say that just because the software is done in Java that it's the greatest thing. All he was saying is that Java -can- do some really cool stuff.

      I know that there is no such jini-like API in C/C++/etc (at least that I know of).

      And wanna know what? You don't need one in C++! The great thing about Jini is that it doesn't require Java. You can use other languages and still enable your device for Jini by using proxies. In fact, if I'm not mistaken, you can even write the lookup and other services in another language such as C++!

      One more thing, as a end user I REALLY do NOT care about how fast you wrote the application!

      Then don't complain when software's release is delayed or due to insufficient amount of time the feature you really wanted was kept out. Those are just the tip of the iceberg - Development time does matter.

      I care about speed and reliability. Maybe java has that (I have seen otherwise, but I love to be proved wrong)

      The problem with all you Java nay-sayers is that your main exposure to Java is through the dinky applets spewn across the Web. Most of you are not seeing what is actually being done inside the Fortune 500 companies or some of the various academic / research projects. Nor in many cases have people who discount Java tried it themselves.. and I don't mean a little applet.

      Most "real" Java users have learned that Java can be quite reliable while cutting development costs and time spent. As for the speed issue, yeah, it's not as fast C or C++ (or asm for that matter), but it's not dog slow as people make out to be. Furthermore, Java has actually exceeded C/C++ speeds in some cases using Hot Spot.

      Hotspot vaporware? Nope!

      JavaTM 2 Software Development Kit, Standard Edition, v.1.3 Beta

      (Obviously, only available for Windows and Solaris at the moment..)

  2. Lego Haiku by sidesh0w · · Score: 2





    Palm Pilot powered
    Tiny plastic bricks of joy
    The song of Lego





    .................

  3. Re:PalmPilot infra-red control by Ribo99 · · Score: 2
    Why didn't they control the tanks directly from the PalmPilot infra-red ports?

    Because they needed a place to put the Jini Look-Up Service. Mindstorms don't have a JVM (Java Virtual Machine) on them and the Palm Pilot only has the KJVM on it which only has socket support, and not RMI (Remote Method Invocation) which Jini Requires. They were using Jini so that a single Palm could connect to a singe tank with no problems and no hassle; no worries that two people are trying to use the same tank at the same time.

    Were these PalmPilots the ones w/o infra-red ports, or did the infra-red ports not have enough range for the tanks to pick up?

    They were just regular Palm Vs (I think). The range on the Palm Pilots IR *is* really pitiful (something under 2 feet) but that wasn't the point of the demonstration.

    Actually, what was the point of having the Palmpilots in there in the first place, if the workstations were there anyway?

    This was the JavaOne conference! They wanted to show of as much cool tech as they could. The KJVM was the BIG this this year, after all, they were selling Palm Vs for $199 with the KJVM already on it for people to play with. Jini was also a hot item and a really good idea for this particular problem. I believe people used their own Palm Vs to control the Tanks. WAY TOO COOL... :) I get giddy every time I think about it.

    --
    I wear pants.
  4. The most useful java application you've seen? by Anonymous Coward · · Score: 2

    Obviously not all the slashdot writers are up on the technology they report about.

  5. Give me a BREAK... by Moe+Yerca · · Score: 2
    "The scary thing is that this is one of the more useful applications of Java I've seen..."

    That's really pathetic. We've written a robust distributed monitoring system completely in Java and integrated it into our website with Servlets. Creating a distributed system and controlling it via a servlet through RMI is insanely simple and performs suprising quickly...

    I'll grant you that this is one of coolest applications of Java... but useful? You people must not get out much... heck... I don't get out much either so that's not really an excuse. If someone would just get a stable, reliable, and fast Java 2 VM running on Linux some of you people will see what Java is capable of. It's really a shame. Sun's released HotSpot on NT and Solaris, mix the two together and you have x86 on UNIX, what's the problem here?

    Moe

  6. Re:PalmPilot infra-red control by JavaNPerl · · Score: 2

    This was a contrived example to showcase the Jini technology of Sun.

    IR was irrelevant to the example. You could have Palm VIIs controlling the tanks over the web through a wireless connection w/ out much more code.

    Also, the IR port on the Palm doesn't have a lot of range and is very directional, so you don't beam your app or business card to everyone with a Palm in the room, only the intended receiver.

    In a real world app you would want a small/cheap client, like a Palm V as opposed to buying a bunch of workstations.

    The idea of Jini is to put intelligence in smaller devices like a VCR, you would just plug it into a net and it would automatically be able to communicate with your camcorder, TV, satellite receiver, etc. Noble idea for the future but right now all I really just want is to be able to set one damn clock in my house and have them all sync.

  7. Re:Marketing by Moe+Yerca · · Score: 2
    You left out a step... it's my understanding that any code needed for the device to communicate (ie printer drivers) can be moved over the network and executed on the local VM. No more printer drivers. No more "wow that's a nice peripheral, when can I get drivers for BSD running on my fridge's StrongARM?"

    Discovery, connection, and mobile code that runs on any device.

    What's there not to see?

  8. A rigged demo is indistinguishable from magic by Anonymous Coward · · Score: 2

    OK, so this is a cool demo. But look under the covers, and you see problems with Sun's Java and JINI implementations. Palms have IR transceievers, so do the tanks - why do I need some workstation to mediate simple communication - wouldn't it be cooler to have the Palms speak directly to the tanks? The Palms are running KVM, which is nifty at first glance, but then you realize that it isn't really running Java(tm) - JINI is too big to fit in the multi-megabyte Palms. So, given that we have three computer systems in the demo (Palms, Tanks & workstations), and JINI is only running on one of them, how is this a good demo of JINI's networking prowess?

  9. Re:Marketing by mistabobdobalina · · Score: 2

    the other thing about jini that's cool that no one seems to realize is that it's a free distributed object platform. its not like it ONLY is useful for mobile devices, pretty much it implements the LINDA principles using java code and provide a nice starting point for people who want to use a nice simple distributed object framework for any number of applications.

    --
    -- your knees hurt, don't they?
  10. Re:Versatility of the Palm by MidKnight · · Score: 2

    I think you're underestimating the usefulness of Java network programming. I'd be interested in seeing someone get this same application up & running (with Jini-like useability) coded in C/C++.

    As someone who writes networked code in both, I can testify to the ease of Java's networking API. Also, the advantage of the Jini network (i.e. just plug the damn thing in to start it, unplug it to stop it -- no configuration on either side) is a huge plus....

    I'm not disagreeing with you though; my Palm V is one of the most useful things I own -- I just think you're missing the overall usefulness of Jini and Java.

    --Mid

  11. Other small, mobile objects controllable via Jini by bgarrett · · Score: 2

    Somebody mentioned the X-10 system, but I didn't see anyone mention another relatively small, mobile device: AIBO. While undoubtedly pricier than the Mindstorm kits ^_^;;, this would be an interesting thing to see.

    I could see a lot of potential in an X-10/Jini/Palm crossover. Forget about a universal/learning remote, how about a context-sensitive remote? You just point your Palm at the TV and it automatically changes its controls to those of the television remote; point at the lamp and you get a switch, which sends a signal to your X-10 unit via the Jini proxy.

    --
    Nothing worth doing is worth doing today.
  12. Et tu Taco?? by jabber · · Score: 2

    The scary thing is that this is one of the more useful applications of Java I've seen...

    Man, that one stung! Really.

    I don't know how much exposure there has been to Java applications that are actually useful, but damn!

    I'm currently working in a small group, in a large company, that is developing (the group) a DB (Oracle 8) centered, distributed (web) application for designing industrial and utility-scale boilers for electricity production. We're talking 1.21 GigaWatts here, Marty! It's my first project with this new group, and it's slick as snot.

    Some other notable Java apps: NetBeans and FreeBuilder (granted, they're devtools themselves, but they're java and they nifty), Lotus domino is available as a Java app.

    And then there's always Applixware Office Anywhere that is written purely in Java.

    Really, I'm surprised at the off-the-cuff derission against Java, Rob (old bean). :)

    --

    -- What you do today will cost you a day of your life.
  13. Useful Java Applications by zipwow · · Score: 2

    Funny, the online registration system that I used Java servlets to write seems pretty darn useful.
    And because I wrote it in Java and used the Servlets specification, we'll one day be able to move it (not port it) to Linux.

    Yeah, we could do it in C++, but why? Speed? Hm, working fine, says we can scale to thousands more folks. Development time? Nope, came together quite quickly.

    Yeah, yeah, you can do OO in Perl if you try really hard. And you can write objects in Visual Basic too (or so they claim). Java makes it easy for you, and makes it harder (though not impossible) to do it the wrong way.

    Or was Rob bashing java servlets? What exactly do you want people to do? HTML "applications" aren't the way to do things. We want thin clients that run across many platforms, don't we? So to break up the MS stranglehold? But we bash people experimenting with the fledgling version of this technology? What is it that we want, anyway?

    I see servlets on webpages for data retrieval, traffic views, heck, even clothes shopping. It seems to work very, very well.

    Zipwow

    --
    I don't know which is more depressing, that 2/3 didn't care enough to vote, or that 1/2 of those that did are crazy.
  14. Actually... by luge · · Score: 2

    I know this sounds pathetic, but there is a page in the www.lego.com domain where Lego specifically explains that it is company policy to refer to them only as Lego bricks. They specifically condemn the use of the phrase "legos" and, IIRC, directly exhort parents to correct their children when the kids use the plural and not the "proper" phrasing. That was one of the sicker examples of management-speak I've ever seen...
    ~luge

    --

    IAAL,BIANLY

  15. Re:Versatility of the Palm by Xthlc · · Score: 2
    In NEITHER area am I ANYTHING close to expert - so please feel free to correct me about any of the details that follow.

    Not a prob. :)

    [kersnip]
    On the other hand - any AWT stuff that I've tried to do is almost pathetically slow, especially compared to the X-Windows stuff that I've tried to do. I also suspect (but aren't sure) that the Swing components are add-ons to the whole AWT idea, and not a fundamental re-organisation of the AWT event model (am I right???).

    Essentially, yes.
    The main difference between Swing and AWT is that every AWT widget has a native peer -- basically a hook into the windowing toolkit of the console's graphic environment. In Swing, every widget is "lightweight" -- it's drawn entirely through Java's neato rendering context APIs. This gives you a lot of flexibility and lets you do cool things like insta-double-buffering and translucent UI components with a minimum of effort. However, it is definitely slower.

    The event model is the same for both Swing and AWT.

    The reason that I say this is because there's lots of things about the AWT event model that suck - for instance, only one thread for the entire AWT system (how do you implement sprites easily? You can't - you have to manually write code that updates each one in turn. With new AWT threads being spawned at will, you could just "spawn" a new sprite with internal timing signals, and everything would be fine and dandy).

    Ummm... there's only one *event* thread in AWT. You can have as many threads as you like merrily drawing away to the Graphics object of your choice. The single-event-thread system only screws you if you're doing something like multi-modal input (which I am :().

    Look - XWindows was ALREADY a platform-independant and fast windowing toolkit (with networking capabilities too :-). Why didn't the Java guys just provide a set of wrappers for that???

    Ever use X over a modem? Or any connection that wasn't a LAN? It is VERY high bandwidth, and therefore not a good thing to tie your windowing toolkit into when you are a networking-oriented language. And if you can't use X in that manner, why use X at all?

    Wrapping X in a properly object-oriented fashion was probably more work than JS was willing to commit to.

    Or at least provide a set of methods to interface with it?

    We're using just such a toolkit in our next project to drive a wall-size display. No URL off the top of my head, unfortunately, but such things are out there.

    Also - C++ (ANSI) is extremely fast and fairly standard. Java is basically a subset of the C++ methods, along with a whole bunch of new code ("libraries") and some kewl new ideas about method/class organisation, all organised in such a fashion as to make it platform independant.

    OK, here's where I get pissed. :)
    C++ is a bastard hack. It is a crufty, inelegant glomming of some OOPy-sounding keywords onto a language that was NEVER designed to be used in an object-oriented fashion. The concept of OOP was around for a looong time before C++; Java is the first mainstream P/L to be architected from the ground-up with OOP in mind. THAT is why it has greatest programming language design in the history of computing (note my omission of the word "implementation" ;). The fact that Sun is harping this silly cross-platform angle is incidental.

    [kersnip] So my opinion is that Java is an extremely good idea that was moderately badly implemented.

    I think every real java programmer in the world would agree with you on that one. The fact that the Creator permits a virtual-platform networking-centric elegantly OOP language to be wholly owned by a traditional "big iron" computer corporation has contributed greatly to my cynicism and festering sense of misanthropy.

  16. Re:and i called him HAL by luge · · Score: 2

    If you want a real programming language for the legos, check out legOS. Full C and C++ support for your legos.
    ~luge

    --

    IAAL,BIANLY

  17. Re:Marketing by jilles · · Score: 2

    You are right but technically that is an RMI feature, not a Jini feature. Jini does not require the presence of an actual VM on all the devices but if one is present, it can be used for this.

    --

    Jilles
  18. Mindstorms via palm? by technos · · Score: 2

    Mindstorms are great! I no longer need a degree in electronics or mechanical engineering! Now not only can I built a Mindstorms case that will dissassemble itself whenever I need to swap out hardware, I can built my next garage door with them, too. Perhaps a Mindstorms controlled tractor-mower? Sit in the shade and steer the mower around like a video game! An army of Mindstorm-enhanced appliances, from the ashtray that empties itself to the 'Fridge-buddy' that retrieves me another cool Guinness on demand; All controlled from the comfort of the Mindstorm chair.( complete with 21 inch monitor, self adjusting keyboard and autovariable cushion firmness!! )


    --
    .sig: Now legally binding!
  19. Saw these at JavaONE by Anonymous Coward · · Score: 2
    Hardly a new toy, they had this up and running months ago. I even got to drive one. The coolest bit was when I was watching the monitor, and somebody placed a new tank into the battlefield and it was auto-recognized. Highly cool.

    Miko gave his "courage under fire" award to the Lego team because, before their demo, they found out that the overhead lights screwed up the IR towers, and they figured out how to splice two towers together to get redundant coverage. Or sometihng like that. Pretty neat.

    And apparently it's not pure Java (I didn't read the entire article) - the mindstorms are merely running a jini proxy, which is presumably written in NQC. At least, when I asked the guy at JavaONE, that's what he said they used.

  20. Already There by Sixty4Bit · · Score: 2

    There is already a technology that does just that. It is called X-10. I have a friend that has it installed in his house and can control his entire house from a computer. The technology speaks to different items through power cables in the house. You can find the FAQ Here.

    --
    This is not the sig you are looking for...
  21. Versatility of the Palm by drachen · · Score: 2

    Even though the software was in Java, it's really the fact that the Palms can be used in such varying ways that is the coolest fact. I mean here we can control our TV's, print to IR printers, transfer files through air, unlock cars that use IR remotes, etc. This little device can do it all. The fact that the software was written in Java, IMO is of no consequence. The program to control the legos I'm sure could have just been written in another language. You've got to love how these companies tout their software by making is seem like something so revolutionary when it's not. C was revolutionary. Java is not.

    I sure love my PalmIIIx. Never leave home without it.

    ---------
    James Crawford
    drachen@thepcmaster.com

  22. What I want to see... by Cironian · · Score: 2

    Cant wait for the first Java-controlled coffee machine. *rips the pun-alert siren off the wall*

  23. Re:java by Ender_the_Xenocide · · Score: 2

    >But I have yet to use a single java application or applet that wasn't desperately sluggish - even on the fastest CPUs, even just a "hello world" type of application.

    On my dual-Celeron, running the latest Blackdown JDK, HotJava and Netscape seem to be about even. Mind you, Netscape is pretty sluggish itself. (Stability's about the same too, which is pretty sad.)

  24. Regarding AIBO & Mindstorms... by cr0sh · · Score: 2

    Look on the LEGO Mindstorms page, one of the recent new contributors is this one Japanese guy who created his own AIBO from a few Mindstorms kits - called it MIBO. Uses a couple of RCX units, and is pretty complex. He goes by (may even be his name) Jinsato.

    Here is a link to his page:

    http://www.mi-ra-i.com/JinSato/MindStorms/index. html

    There is also stuff on the LEGO site...

    --
    Reason is the Path to God - Anon
  25. The Tower of Babylon by Kingpin · · Score: 3

    What's up with the Java bashing?? I'd say one is ignorant if he cannot recognize the benefits of having more than one language. Perhaps some people think they're losing ground to 'this upstart OOP language!' - pfft. Try it, you might even understand and like it.

    I use both Perl, C and Java - your choice of language should depend on what you'd like to make. Not on the degree of your stubbornness. The must go as fast as possible all the time servers - well - code them in C, optimize it in your assembler, but why not make the clients in Java? Seems logical enough to me.

    Imagine all code being uncommented Perl - now wouldn't that be a riot! A true Tower of Babylon ;)

    Kingpin

    --
    Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
    Geocrawler error message.
  26. Steal Cars by GnrcMan · · Score: 2

    Hmmm, if you combine this with the palm's ability to steal auto security codes, maybe you could make a robot that goes around stealing cars! >:>

    Generic Man

  27. Re:java by jilles · · Score: 2

    Sure it would be faster but it would have taken three times as long to develop it, four times as long to debug it. It would randomly crash for no reason at all and you could forget about reusing any of the code.

    I'm exagerating a little (but only a little). I think the whole thing would be pretty limited if written in C.

    I'm glad you recognize perl is evil because it is. It's syntax is a nightmare and I have feeling all these nerdy scripts currently running many websites will cause a lot of maintenance problems in the future.

    Java may not be the most optimal language performance wise but Java code is highly maintainable. If you want performance, hack away in C. If you want to cut your development cost in half go for Java.

    --

    Jilles
  28. PalmPilot infra-red control by mOdQuArK! · · Score: 2

    Why did they have to go through the cradle/workstation/infrared-tower setup?

    Why didn't they control the tanks directly from the PalmPilot infra-red ports?

    Were these PalmPilots the ones w/o infra-red ports, or did the infra-red ports not have enough range for the tanks to pick up?

    Actually, what was the point of having the Palmpilots in there in the first place, if the workstations were there anyway?

  29. Re:Marketing by jilles · · Score: 2

    You have to look through the propaganda (basic skill of a software engineer these days, if you can't your lost).

    Jini is something really simple. The concept goes like this you have a lot of devices all able to their particular thing. In order to do so they need other devices to their particular thing. Jini is all about providing a dynamic way to let these devices help each other.
    The process is really simple:
    - device registers itself at the lookup service upon connection
    - device asks for services it needs
    - the lookup service gives back a ref to a suitable device
    - two devices previously unknown to each other are now communicating

    There are plenty applications for this really simple technology (I'm abit tired so I won't bother listing them, I suppose you know the way to SUN's propaganda pages).

    So this is what you can do with Jini now to why should want to do it at all:

    Computers are becoming smarter smaller and cheaper. Computing power and networking is becoming dirtcheap. So cheap it can be put in any device. If it can be done it will be done. So there is a need for these devices to communicate. What would normally happen is that companies start making incompatible propietary protocols for the devices communication.
    But industry has learned that propietary protocols have their limitations so they want something more standard. So they sit together and try to come up with a protocol. At this point Jini comes in as an easy to use solution.

    It is now only a bit more than a year rumours about Jini started spreading (I recall an article on JavaSoft June/July '98) so it has come a long way in only a year. Of course there are not many products around at this time but a lot of companies are really interested in this stuff so I expect to see some products the coming years.

    --

    Jilles