Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   "Java, Sun SPOT and the FIRST Robotics Competition" (http://www.chiefdelphi.com/forums/showthread.php?t=76849)

pogenwurst 18-04-2009 12:50

"Java, Sun SPOT and the FIRST Robotics Competition"
 
This just came up in Google Reader; after a quick search I couldn't find it posted anywhere here and thought it might be interesting to many CD'ers:

http://blogs.sun.com/roger/entry/java_sun_spot_and_the

Branden Ghena 18-04-2009 15:37

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
That's very interesting. Java on FIRST robots... not bad. Its really good to get options out there to students, and the more programming languages able to run on FIRST robots the better it is for students.

Let the C++ vs Java rivalry begin. :D

keehun 18-04-2009 16:09

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
This is not related to SUN but it's so welcoming to see some familiar pits in the article pictures!

bobwrit 18-04-2009 18:18

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Note to self: Review Java....

virtuald 18-04-2009 18:56

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I hate Java (its a religious thing though, no actual reason), but this is pretty cool. Now if they would just get rid of vxWorks and let us use Linux on there we'd be really set...

lingomaniac88 18-04-2009 19:17

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I think this move will attract a lot of people, especially in schools that offer computer science courses in Java. There are probably quite a number of them, too, since AP Computer Science works in Java.

I'm going to speak with my school's computer science teacher. Maybe she can get her students involved with the team also!

Maybe we can also get the College Board to work with FIRST to make a new case study revolved around the new library. Who's with me? :p

pyr0b0y 18-04-2009 20:38

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I think that Java working with devices is a great step...I personally do not like Java at all but it's nice to see how popular FIRST has become that you can even program in Java now. It might bring an increase to the amount of students that join robotics teams.

davidalln 19-04-2009 12:03

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I'm excited to dive into Java as an alternative after a subpar experience with LabVIEW this year. I do have a few questions about how much of the more advanced/third party Java solutions we can use that will still be executable on the cRIO. Unfortunately, I didn't get a chance to drop in and say hi to the people from Sun at the competition over the weekend.

For example, can we use Java-based wrappers and implementations for other languages such as JRuby (my guess is yes, because Java is compiled into bytecode anyways, so whatever third-party libraries used should be compiled with it)? And will there be the ability to use a testing framework such as JUnit (with the emulator, it might be possible. I'd just rather not have to build and load every time I need to test out a small tweak or new feature, especially in the process of developing said feature)?

lynca 19-04-2009 14:25

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by lingomaniac88 (Post 851269)
I think this move will attract a lot of people, especially in schools that offer computer science courses in Java. There are probably quite a number of them, too, since AP Computer Science works in Java.

I concur, the majority of AP and IB schools teach computer science in Java.

gblake 19-04-2009 15:48

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Wow - This dovetails very nicely with the Java client I have been developing for the 5th Gear FRC robotics simulator - That Java client replaces human players with computer control of one or more of the simulation's virtual robots - Blake

rogerlsmith 19-04-2009 16:42

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I think it's great to offer alternative platforms for development. With that said, I think Sun and or WPI will need to offer some good examples in Java before it will really catch on in our community.

davidalln 19-04-2009 16:47

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I also hope that they release it before fall like their website says. Or at least release it in beta stages (they obviously have somewhat of an alpha product as they had a robot running on Java at CMP).

It was reasonable for NI and WPI/WindRiver to release their programs and languages in the fall because nobody had the cRIO until then. But now that teams have a cRIO, they can beta and submit patches or feedback during practice in the summer.

mathking 19-04-2009 20:24

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
As a teacher of AP and IB computer science and an FRC advisor, I like this opportunity a lot. It will make the learning curve for new programmers much less steep on the average, since the overwhelming majority of high school CS classes are Java based. While there are things I don't like about it, the way Java handles events and exceptions will make robot programming much easier for students to pick up. In particular this should be a good avenue for making sensors more easily used.

j_johnson 19-04-2009 21:13

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by davidalln (Post 851441)
I'm excited to dive into Java as an alternative after a subpar experience with LabVIEW this year. I do have a few questions about how much of the more advanced/third party Java solutions we can use that will still be executable on the cRIO. Unfortunately, I didn't get a chance to drop in and say hi to the people from Sun at the competition over the weekend.

For example, can we use Java-based wrappers and implementations for other languages such as JRuby (my guess is yes, because Java is compiled into bytecode anyways, so whatever third-party libraries used should be compiled with it)? And will there be the ability to use a testing framework such as JUnit (with the emulator, it might be possible. I'd just rather not have to build and load every time I need to test out a small tweak or new feature, especially in the process of developing said feature)?

I got a chance to talk to several of the people at the Java booth at Atlanta and learned quite a bit about the setup. It will use the Squawk JVM running on top of the vxWorks OS. The WPILib should be ported over to Java. (It looked like they had most if not all of it ported already) This VM is Java Eicro Edition (Java ME), which is what runs on phones, smart cards, etc. Any third party libraries would need to be compiled down to the Java ME byte code, limiting them to using only the Java ME API, rather than the Java Standard Edition API.

The build system uses nant, and they will have plugins for the NetBeans IDE and maybe the Eclipse IDE as well. (As a side note, it was probably not a good idea to ask the father of the Java language why they are using a Sun IDE rather than one developed by IBM.)

The cRio will basically be formatted for c++ with the initial program being a bootstrapper to start the JVM. It sounded like this initial JVM will then listen for communication with the development PC and start a second VM with the robot code in it. Hopefully this means that it will be much easier to reprogram and test without the 30 second start up time.

All of this, of course, was in pre beta and could very easily change before it is released.

Greg McKaskle 20-04-2009 09:10

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by j_johnson (Post 851686)
I it will be much easier to reprogram and test without the 30 second start up time.

This has been mentioned a few times. Can you elaborate on what the 30 second sequence is, and when it becomes a big part of the development cycle?

One mentor came by the booth and wasn't aware of the three button reboot, so they were power cycling the entire robot each time they deployed. Is this a similar situation? Or are you unable to simply reboot the controller? Or is your controller taking 30 seconds to reboot?

Greg McKaskle

Bomberofdoom 20-04-2009 09:31

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Hang on, let me get this straight....

Is Labview still available to teams to program the robot?

Is it that Java is replacing Labview or we're just gonna' have a 3rd programming language available?

davidalln 20-04-2009 10:10

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by Bomberofdoom (Post 851959)
Hang on, let me get this straight....

Is Labview still available to teams to program the robot?

Is it that Java is replacing Labview or we're just gonna' have a 3rd programming language available?

I believe Java is another option for teams, along with LabVIEW and C++.

EricVanWyk 20-04-2009 10:23

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by davidalln (Post 851987)
I believe Java is another option for teams, along with LabVIEW and C++.

Correct. They are adding an option, not replacing them.

However, at one of the feedback sessions they did mention considering dropping C (not C++, just C) support: Only one team reported using it, and they were planning to move away from it any way.

Dave Flowerday 20-04-2009 10:35

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
It'll be interesting to see what happens here since Sun is now being bought out:
http://www.pcworld.com/article/16340...n_for_74b.html

Whenever a new owner comes in, a lot of old projects within a company being bought out can get axed rather suddenly. Hopefully this isn't one of them.

JesseK 20-04-2009 10:49

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Heh, the cRIO is getting complicated :ahh:. So long as the other two languages aren't glitched by adding another one in, I see this as an opportunity for other teams. We'll stick with the C++ core with a Java display on the front-end. That hits all of the strong points on our team. :cool:

I can't wait to have the "But there are no memory leaks in Java!" discussion...just wait, it will happen.

Boydean 20-04-2009 11:12

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
What I want to know, is whether this is going to open the door a little be more for other platforms to program on.(aka mac os, linux, ??solaris??).

None the less, this looks like an exciting thing to come out to the world of FRC.

Dave Flowerday 20-04-2009 11:21

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by Boydean (Post 852048)
What I want to know, is whether this is going to open the door a little be more for other platforms to program on.(aka mac os, linux, ??solaris??).

Sun was demoing the new tools on all 3 of those platforms at the Championship, so it appears the answer is Yes.
{edit} Sorry, I meant these 3 platforms: Windows, OS X, and Linux. I assume they figured that very few robot people would be interested in using it on Solaris, but I'm sure they could make that work too. {/edit}

Alan Anderson 20-04-2009 12:19

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by Greg McKaskle (Post 851950)
This has been mentioned a few times. Can you elaborate on what the 30 second sequence is, and when it becomes a big part of the development cycle?...Or is your controller taking 30 seconds to reboot?

It takes longer than 30 seconds, sometimes as long as 45 seconds, between clicking the "click here to reboot" button after setting the code to run at startup and having the battery voltage display on the DS screen. It was consistently 27 seconds from "three-button reboot" to responsive robot. That's a huge increase from the two to five seconds it takes to start up and begin controlling last year's system after loading a new program.

Don't even get me started on the ridiculous amount of time it takes to build a LabVIEW program this year.

byteit101 20-04-2009 17:09

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
you can reboot by pressing the reset button on the crio. the programmers on our team have a rebooting tool, a small philips screwdriver that fits perfectly in the button. it's faster than the complete power cycle, and as fast (if not faster) as Reset target server (or whatever it is called, using WR)

Kingofl337 20-04-2009 17:18

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
After speaking with a number of teams, many do not know about the 3 finger reboot. Also, some of those that did know didn't know that if it doesn't display "Robot Rebooting" on the driver station screen that robot didn't reboot.

AustinSchuh 20-04-2009 19:42

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by virtuald (Post 851252)
Now if they would just get rid of vxWorks and let us use Linux on there we'd be really set...

I run linux every day on my laptop and every other computer I own and use, but I wouldn't want to use it on a robot if I had the choice to use VxWorks or some other real realtime OS. The robot needs to be realtime to be guaranteed to respond quickly to user and sensor input, and Linux is not designed to do that. It's designed to run on servers and desktops where a bit of latency isn't an issue. There are patches that have been made to make the linux kernel more real time, but they aren't nearly as good as running an actual realtime OS.

Adam Y. 20-04-2009 21:58

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by Alan Anderson (Post 852121)
Don't even get me started on the ridiculous amount of time it takes to build a LabVIEW program this year.

Just wait until you get acess to the FPGA. Whatever definition of ridiculous you are using pales in comparison to hardware synthesis.

virtuald 20-04-2009 22:35

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by AustinSchuh (Post 852490)
The robot needs to be realtime to be guaranteed to respond quickly to user and sensor input, and Linux is not designed to do that.

So I don't know if you've noticed this or not, but how much realtime stuff did most people's code actually do this year? Answer: most probably did almost nothing. What about interrupts? Nothing again.

Thats what the FPGA is for, it takes care of the nasty latency dependent stuff for us (among other things).

Quote:

It's designed to run on servers and desktops where a bit of latency isn't an issue. There are patches that have been made to make the linux kernel more real time, but they aren't nearly as good as running an actual realtime OS.
I won't disagree, but I don't think the realtime stuff is a huge issue for what most people are doing. If there were no FPGA, then I'd definitely agree. Otherwise... hard to say.

From the experience I've had so far, porting software to vxWorks is really annoying (even nix-like software) because it has random oddities in its networking library (and other libraries too). The biggest advantage I see for linux would be that theres a *ton* of software that would pretty much *just work* without too much modification. Not so with vxWorks.

Then we wouldn't be just talking about java bots, we could have python bots or ruby bots... :p

AustinSchuh 20-04-2009 23:27

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by virtuald (Post 852675)
So I don't know if you've noticed this or not, but how much realtime stuff did most people's code actually do this year?

Correct me if I'm wrong, but I believe that updating the speeds of the motors on the robot 50 times a second while processing images using the rest of the CPU time would qualify. When I've tried to get code I've written under Linux to execute a loop 50 times a second without the timing being off by a fairly large percentage while using all of the available CPU resources, I've had trouble and found the best way to get the loop to execute every 20 ms is to use less CPU resources. Maybe I was doing it wrong, but that's been my experience.

virtuald 21-04-2009 00:05

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by AustinSchuh (Post 852718)
Correct me if I'm wrong, but I believe that updating the speeds of the motors on the robot 50 times a second while processing images using the rest of the CPU time would qualify. When I've tried to get code I've written under Linux to execute a loop 50 times a second without the timing being off by a fairly large percentage while using all of the available CPU resources, I've had trouble and found the best way to get the loop to execute every 20 ms is to use less CPU resources. Maybe I was doing it wrong, but that's been my experience.

You're right, obviously linux and vxWorks have different design goals. Probably would be a bit better if you were running in the kernel like we do on the cRio or if it were a realtime patched kernel, but hard to say -- I've no experience with realtime Linux.

In any case, I value the flexibility quite a bit more than I value the realtimeness. Cmon, a robot controlled by a shell script... would be pretty amusing.

bobwrit 22-04-2009 21:51

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by virtuald (Post 852742)
You're right, obviously linux and vxWorks have different design goals. Probably would be a bit better if you were running in the kernel like we do on the cRio or if it were a realtime patched kernel, but hard to say -- I've no experience with realtime Linux.

In any case, I value the flexibility quite a bit more than I value the realtimeness. Cmon, a robot controlled by a shell script... would be pretty amusing.

A)Programming a robot with a shell script is on the same level as programming it with a perl script, in my mind.:eek: :eek: :eek:
B) We were half hoping that someone, somewhere would port lolcode to vxWorks...

virtuald 22-04-2009 22:05

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by bobwrit (Post 853960)
A)Programming a robot with a shell script is on the same level as programming it with a perl script, in my mind.:eek: :eek: :eek:

Hmm. If you could tolerate a small bit of latency, using my embedded webserver for the bot you could program it using javascript.

bobwrit 22-04-2009 22:12

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by virtuald (Post 853970)
Hmm. If you could tolerate a small bit of latency, using my embedded webserver for the bot you could program it using javascript.

In all honesty, I prefer to program in JavaScript than Perl... Also, if I wasn't programming a bot for competition, I wouldn't care about a small to medium latency.

davidalln 23-04-2009 08:53

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I'm still holding out for Ruby on the cRIO. Although our codin' mentor respectfully disagrees (sorry, Ian :D)

EricVanWyk 23-04-2009 09:21

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by davidalln (Post 854129)
I'm still holding out for Ruby on the cRIO. Although our codin' mentor respectfully disagrees (sorry, Ian :D)

For those of us completely ignorant to the ways of Ruby: Why?

I'm interested in a "Ruby is good at A, B and C but it is bad at X, Y and Z", not in starting a flame war.

gblake 23-04-2009 13:40

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by EricVanWyk (Post 854142)
I'm interested in a "Ruby is good at A, B and C but it is bad at X, Y and Z", not in starting a flame war.

Ruby is good at starting flame wars. ;)

gwytheyrn 23-04-2009 13:53

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
It's also good for making certain teams' website people cringe.
(If you want an amusing read about ruby, go for who's poignant guide to ruby. It has pictures ^^)


(I has a var?)

davidalln 23-04-2009 16:54

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by EricVanWyk (Post 854142)
For those of us completely ignorant to the ways of Ruby: Why?

I'm interested in a "Ruby is good at A, B and C but it is bad at X, Y and Z", not in starting a flame war.

I was kidding :)

Ruby is equivalent to Python in terms that it is great at small programs, algorithms, and the such (and I like Rails), but I would never use it for a full application, let alone a robot.

Foster 23-04-2009 19:37

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Ruby is like Cobol, just with a different syntax. It's yet another programming language. The difference is in the libraries that you can use without writing them.

In a robot context there isn't a big advantage between Basic, C, Cobol, C, C++, Fortran, Java, Javascript, Perl or Ruby. You are doing basic math / geometry calcs, basic data in (joysticks) and data out (motors).

The problem you face in a Ruby (Java, Perl, etc) world is to get the programmers to use existing library code and to not reinvent the world.

Shinigami2057 23-04-2009 20:47

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
With a vxWorks JVM implementation, you could run Armed Bear Common Lisp on the compactRIO, which would be incredible. I'd love to port WPILib or something similar to Common Lisp.

bobwrit 23-04-2009 22:07

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by Foster (Post 854367)
Ruby is like Cobol, just with a different syntax. It's yet another programming language. The difference is in the libraries that you can use without writing them.

In a robot context there isn't a big advantage between Basic, C, Cobol, C, C++, Fortran, Java, Javascript, Perl or Ruby. You are doing basic math / geometry calcs, basic data in (joysticks) and data out (motors).

The problem you face in a Ruby (Java, Perl, etc) world is to get the programmers to use existing library code and to not reinvent the world.


It's not only geometry/basic math calculations, But I agree with the fact that for most robot's that's fine.

pogenwurst 24-04-2009 07:30

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Remember that there will be a Java VM on the cRIO (the Squawk VM), so in theory any language that compiles down to JVM bytecode should run on the cRIO. Think JRuby (Ruby), Jython (Python), Scala, Clojure, Groovy, etc.

That said, Squawk implements Java ME, not Java SE, which could cause some problems, as some of those language implementations may be geared towards Java SE.

virtuald 24-04-2009 08:50

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by pogenwurst (Post 854502)
Remember that there will be a Java VM on the cRIO (the Squawk VM), so in theory any language that compiles down to JVM bytecode should run on the cRIO. Think JRuby (Ruby), Jython (Python), Scala, Clojure, Groovy, etc.

Remember that there is a C/C++ compiler in the development environment, so in theory any language that has a compiler/interpreter written in C/C++ should run on the cRio. Think... well, just about everything.

Quote:

That said, Squawk implements Java ME, not Java SE, which could cause some problems, as some of those language implementations may be geared towards Java SE.
That said, vxWorks only implements POSIX and the standard libraries in a semi-standard way, and Wind River doesn't come with autotools or binutils, which could cause some problems, as some of those implementations may be dependent on that.

:D

Ice Berg 25-04-2009 00:26

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Can someone who knows more about this me give a few reasons why Java would be better or worse than c++. I know that it is simpler to learn, and that many students know it from taking AP compsci (myself included), but because I don't know c++ I don't really know what negative effects switching to Java would have. Each programmer will have his or her preference, but I want to know what the major benefits and drawbacks will be using Java in place of c++.

Greg McKaskle 25-04-2009 07:58

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Java is a safe language, with references, but not pointers. Java does garbage collection so that you don't leak memory in the same way. Java has a simpler and more consistent syntax. Java, being a teaching language, presumably has material aimed at teaching to HS students.

On the down side, Java will run quite a bit slower. The garbage collection causes hiccups where the OS is doing something besides running your code. C++ probably has more robotics usage, so more code to borrow from.

While doing the comparisons, LV is a safe language with no pointers. LV does garbage collection upon completion, but not during execution. LV has the simplest syntax of the bunch. I expect that LV is faster than Java and slower than C++. Oh, and there is that graphics and dataflow thing.

This is my input from a thousand foot perspective. I can't say much more until it is in my hands and we can do side-by-side-by-side comparisons. Perhaps if you learn all three you can update my comparison.

Greg McKaskle

jtdowney 25-04-2009 08:28

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by Ice Berg (Post 854866)
Can someone who knows more about this me give a few reasons why Java would be better or worse than c++.

In addition to what Greg mentioned I would add checked exceptions which would make it safe to use exceptions in WPILibJ because you can have the compiler force you to handle every exception. I know a lot of Java developers dislike checked exceptions but I believe this is one place where it is useful.

gblake 25-04-2009 09:31

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

On the down side, Java will run quite a bit slower.
This might be a distinction without a difference - Depending on the Java Virtual Machine you are using, Java Byte Code can run plenty fast for plenty of applications - This only becomes important if you are running out of clock cycles - And, for my 2 cents, if I start doing any work likely to exhaust the clock cycles of a microcontroller, I'm going to want to offload the microcontroller (attach a fast General Purpose computer (a co-processor) to do the intense math or other heavy lifting).

Find out what speed you (really) REQUIRE before using speed as a selection criterion.

Quote:

The garbage collection causes hiccups where the OS is doing something besides running your code.
In full fledged Java implementations, you can invoke garbage collection as often as you want. This doesn't explicitly prevent the VM from deciding to run it; but it does give you a chance minimize how often the VM will surprise you by cleaning up after yourself.

Quote:

C++ probably has more robotics usage, so more code to borrow from.
Yes and no - I suspect that if you look at the robot code as the core of a large collection of general purpose development and debug code, and environments, you might find that there are plenty of Java infrastructure tools that make it worth your while to use Java. It is that infrastructure that
chews up most of my time when developing robot-ish software; not the robot software itself.

Or you might not :)

Blake

ttldomination 25-04-2009 21:05

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
hm...I really like this idea. Now whether the programming team, mainly one guy, chooses to accept this idea, I'm pretty sure that all of a sudden, our programming base will expand simply because we have so many kids who are, or can be, good with Java. The school offers many classes not to mention I know for a fact that we have a couple of Java wizes in our school.


I like this. :D.

mathking 25-04-2009 21:59

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
I teach high computer science, and we have used the RidgeSoft IntelliBrain robots in class, which are programmed in Java.

Aside from the exception handling which has been mentioned, I would absolutely add event handling. Programming multiple sensors with the IntelliBrain (which has a MUCH more limited processor than the cRIO) is easy because of the way Java handles events. When I first learned Java (when the AP CS course moved from C++ to Java) the event and exception handling were among the first really cool things I noticed about Java.

As for speed, I agree with gblake. It really depends on how you compile the code Running robots in the standard JVM would be slow. But I have written plenty of programs for OS X using XCode to compile Cocoa native applications for the Macintosh, and they run just as fast as Objective-C programs.

As for tools, there may be a relative lack of robot specific libraries for Java, but there are some. Mindstorms and the aforementioned IntelliBrain robots can be programmed in Java. There are other platforms that use Java as well.

The biggest thing to remember is that this is an addition. You don't have to use Java if you don't want to. But it will open up programming to more students, because Java is the language most will have learned in their HS computer science classes.

nathanww 25-04-2009 22:10

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
On one hand, this is cool. I use Java, I like Java, I think Java is a great language.

On the other hand: ANOTHER PROGRAMMING SYSTEM???!!!! :eek: :eek: :eek: :eek: :eek: That means that I get to go through the whole C++/C/labVIEW decision process again, and if we decide to use it help bring the programming team up to speed on a new IDE, language, etc.

ttldomination 25-04-2009 22:12

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
nathanww has a certain point and for teams who are still jumping around with programming have yet another option.

But for us, bringing kids up to par with the programming won't be so hard considering that the school has a curriculum in place for this already.

virtuald 25-04-2009 22:49

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Actually, I believe the java stuff could use eclipse also, so no changing IDE's. :)

EricVanWyk 25-04-2009 22:58

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by nathanww (Post 855039)
On one hand, this is cool. I use Java, I like Java, I think Java is a great language.

On the other hand: ANOTHER PROGRAMMING SYSTEM???!!!! :eek: :eek: :eek: :eek: :eek: That means that I get to go through the whole C++/C/labVIEW decision process again, and if we decide to use it help bring the programming team up to speed on a new IDE, language, etc.

Get used to it - we have enough tricks up enough sleeves to power an innovation revolution, and we ain't stopping until each of your sleeves are full!

byteit101 26-04-2009 09:39

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Quote:

Originally Posted by virtuald (Post 855053)
Actually, I believe the java stuff could use eclipse also, so no changing IDE's. :)

even if it does use eclipse (the base of Windriver), there will definably be some differences, (like a cRIO connection thing) so you will have to learn some more stuff (though generally the same)

daneelshof 02-05-2009 23:37

Re: "Java, Sun SPOT and the FIRST Robotics Competition"
 
Java is what they use mainly where I go to college for CS, and I think this is partly because it is a more homogenous system for teaching than C or C++, where there could be many compilers and oddities between OSes (BTW, there is about an even mix of Linux, Windows, and OS X amongst the CS students there.)

Sun SPOTS are really interesting looking devices, but I think they have been poorly marketed. Anyway, they seem to handle Java in real-time pretty well, they are being used in a couple of cases as sensor networks. From what I can deduce from the press releases and the Java on FIRST website (http://sunspotworld.com/frc/Welcome.html) they will implement Java similarly. The Sun SPOTS have an ARM processor (the cRIO, a Freescale PPC) and they use the Squawk VM, which is specifically designed for embedded apps. This VM is running right on top of the hardware, so the user code isn't that far from the hardware. It certainly isn't farther from the hardware than VxWorks or LabVIEW, so Java code might be quicker than these methods, but that remains to be seen.

As for Garbage Collection, each virtual machine has to implement that, thus Squawk's is almost certainly different than the 'typical' Java VM. From their site, they say they have three methods for GC which are user selectable (although they may not be in our case.)

One successful example of using Java in robots is Basil (Google Jim and Louise Gunderson.) They've got a few Javelin stamps wired to a *ton* of sensors and outputs. There are countless other examples too. I believe there are a couple of hardware Java VMs too.

A few students have shown interest in learning Java on my team, and I'm planning on holding class sessions during the summer. We transitioned directly from C to LabVIEW, so a major part of the class will be OO concepts.

Sorry for the dissertation, but hopefully this is useful.


All times are GMT -5. The time now is 07:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi