|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Programming with Java?
Hi,
Our computer science department teaches Java to students. We're trying to integrate some robotics with the Object-oriented curriculum. I'm curious to know if there is any way to have the students play with Microchip's microcontrollers and Java language, in order to program the robot...? What are the limitations? |
|
#2
|
|||
|
|||
|
Re: Programming with Java?
Quote:
|
|
#3
|
|||
|
|||
|
Re: Programming with Java?
Try looking at this site:
https://jvex-robotics.dev.java.net/VEXController.html I believe the Vex controller and the FRC PIC are the same. Perhaps for project programming purposes the Vex would be the way to go. Anyone have any experience with this? EDIT: Actually the JCX is the part you should look at. I think the idea is if you want to use a Microchip controller, bet it Vex or FRC and you want to use Java, then you need to have a seperate processor to program Java to, and that feeds back to the microchip controller. http://www.jcx.systronix.com/ Last edited by TubaMorg : 23-02-2007 at 01:12. Reason: Update |
|
#4
|
||||
|
||||
|
Re: Programming with Java?
Quote:
Quote:
|
|
#5
|
||||
|
||||
|
Re: Programming with Java?
I actually think that at the level we do programming for FIRST, Java could be a good language. It handles events and exceptions very cleanly from the programmer's standpoint, so you can focus on making a good algorithm. Event and exception handling is a critical part of programming any autonomous robot.
Java is a slow language, but the speed of decision making for FIRST robots isn't really that fast. You shouldn't use Java if you absolutely have to make the decision about how to position control surfaces in less than 2 milliseconds in order to keep the plane from flipping over. But if you don't care whether it takes 3 milliseconds or 15 milliseconds to compute a series of angles, Java is fine in terms of speed. But the microcontrollers we have are just too slow to be able to effectively program them in Java unless you created an environment to compile Java into object code rather than into Java byte codes. Something like the xCode tools on the Mac, in which you can use Java to create OS X native Cocoa applications. If you are just looking for an environment to do robotics in Java, try looking the Intelli-Brain robots by RidgeSoft. (www.ridgesoft.com) They are nice little programmable (in Java) robots which can be extensively configured. You can even run the CMU cam on them. |
|
#6
|
|||
|
|||
|
Re: Programming with Java?
I don't agree about the size of Java. I have used a JVM in the past that runs on the LEGO RIS controller (which has WAY less horsepower and memory than the FIRST controller) and it was quite usable. Of course it was a minimized system without a lot of the bells and whistles of regular Java (which you don't need for this application anyway). It also showed me that the OO paradigm is very applicable to robotics. The ability to abstract common attributes of, for instance, sensors and then derive from them can be very useful.
The issues in this case are: 1. I don't think there is a JVM available for the PIC processors used, and 2. Many of the great features of Java like multi-threading just aren't possible in this environment because we have to turn control over to the master processor, then wait for it to call our routines again. But things like event and exception handling, as mentioned before, would be very useful. Great discussion! Keep it coming. |
|
#7
|
|||||
|
|||||
|
Re: Programming with Java?
Having a different language to use on the controllers would be great. (Python would be my choice.
) But again, capabilities limit what can be run natively.Some parts (eg, interrupts) still need to be written in C. And there's enough intricacies in the architecture that you have to be cautious everywhere else, too. (Get a value from a structure out of an array: ~30 words of instructions.) Personally, I'd say start with lowering the bar on C. Maybe I'll work on a set of tools to handle a laptop on the robot. EDIT: I wouldn't worry much about advanced features. How many students use them on PCs? |
|
#8
|
|||
|
|||
|
Re: Programming with Java?
You might have better luck using something like a mini-itx board, a dc-dc power supply, and an interface board of some sort. (parallel port?) Of course, most of the work in a system like that is with the electronics itself, which is what makes the VEX systems so great for education.
|
|
#9
|
|||
|
|||
|
Re: Programming with Java?
Of course, I think a computer science class wouldn't be hurt by learning a bit of C. Most of the syntax is the same as Java, and if the teacher is really worried about it, he could write default code to start from, so that students put their algorithms into one function.
|
|
#10
|
||||
|
||||
|
Re: Programming with Java?
The bottom line is that you aren't going to get any "real" interpreted language support until the IFI Robot Controllers use a 32-bit ARM core. This would open the door to Microsoft's .NET Micro Framework or Java, along with a lot of other languages.
|
|
#11
|
|||
|
|||
|
Re: Programming with Java?
Quote:
I also believe that the object-oriented paradigm really doesn't fit into robotics very well - it's a very functional kind of work, where flow control is far more important than encapsulation and abstraction. Your students would benefit more from learning C and lower-level constructs to give them a more well-rounded approach to programming in general. |
|
#12
|
|||
|
|||
|
Re: Programming with Java?
The most effective way to use Java with the IFI equipment would be to build a framework that runs on a PC with a serial interface to the robot controller. The framework would have to handle the IO.
The PC can send motor commands directly to the RC and the RC can send telemetry back to the PC. There will be some latency but it would be an interesting project. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot "Grab frame" with java CMUcam2 GUI | TOECUTTER | Programming | 0 | 20-01-2007 12:50 |
| CMU Cam2 Java app (Help with Labview GUI) | Team 1649 | Programming | 3 | 26-12-2006 14:25 |
| Learn C, C++, and Java with new board game. | Elgin Clock | Programming | 8 | 04-11-2005 13:28 |
| programming motors with programming kit | BorisTheBlade | FIRST Tech Challenge | 4 | 01-11-2005 19:03 |
| Robocode: Learning JAVA the fun way. While fighting with robots. | Denalin Fusion | Chit-Chat | 2 | 26-09-2005 23:22 |