Go to Post Every year I develop new connections and greater friendships with FIRSTers - and every year I am surprised to find just how many amazing people there are here. - MysterE [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-02-2007, 22:16
the_innovator the_innovator is offline
Co-head of Programming
FRC #1241 (Theory 6)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Canada
Posts: 3
the_innovator is an unknown quantity at this point
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   Spotlight this post!  
Unread 23-02-2007, 00:24
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: Programming with Java?

Quote:
Originally Posted by the_innovator View Post
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?
Hmmm, interesting idea. I do quite a lot of Java programming as part of my phd project. The problem is you have to end up with a hex file that Microchip can understand. You definitely couldn't load up a java program directly, since it is interpreted. Just not something the RC can do. C++ might work, but probably not. I will look into it, but I just don't think there is an easy way to do it.
  #3   Spotlight this post!  
Unread 23-02-2007, 01:04
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
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   Spotlight this post!  
Unread 23-02-2007, 01:50
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: Programming with Java?

Quote:
Originally Posted by the_innovator View Post
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?
You have to keep in mind the nature of the user processor that is given to us - it is a PIC18F8722, which is 10MHz and has about 3900 bytes of static RAM. Java is one of the most bloated of all languages, especially in its implementations. You need very large class libraries for Java to run on any platform, and that just can't happen with the amount of program and data memory on the PIC18F. The code is very simple (IMO) as it is, and adding classes and interfaces and whatnot on top of it really defeats the purpose.

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.
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
  #5   Spotlight this post!  
Unread 23-02-2007, 11:29
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
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.
  #6   Spotlight this post!  
Unread 26-02-2007, 12:13
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
Re: Programming with Java?

Quote:
Originally Posted by TubaMorg View Post
Hmmm, interesting idea. I do quite a lot of Java programming as part of my phd project. The problem is you have to end up with a hex file that Microchip can understand. You definitely couldn't load up a java program directly, since it is interpreted. Just not something the RC can do. C++ might work, but probably not. I will look into it, but I just don't think there is an easy way to do it.
If you really want to program a microcontroller using an object oriented language you might have to skip using the PICs all together. I know certain microcontrollers and DSPs do have the capability of being programed in C++.
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.
I have to disagree with you. Certain paradigms can get by with a functional abstraction while others are object oriented from the get go. It all depends on what you want the robot to do.
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill
  #7   Spotlight this post!  
Unread 26-02-2007, 13:04
mathking's Avatar
mathking mathking is offline
Coach/Faculty Advisor
AKA: Greg King
FRC #1014 (Dublin Robotics aka "Bad Robots")
Team Role: Teacher
 
Join Date: Jan 2005
Rookie Year: 1999
Location: Columbus, OH
Posts: 642
mathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond reputemathking has a reputation beyond repute
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.
  #8   Spotlight this post!  
Unread 26-02-2007, 15:42
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
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.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
  #9   Spotlight this post!  
Unread 26-02-2007, 21:20
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
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?
  #10   Spotlight this post!  
Unread 26-02-2007, 21:29
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
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.
__________________
Real programmers use vim.
  #11   Spotlight this post!  
Unread 26-02-2007, 21:36
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
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.
__________________
Real programmers use vim.
  #12   Spotlight this post!  
Unread 27-02-2007, 16:47
fowlerm's Avatar
fowlerm fowlerm is offline
Bringing .NET to Robots
AKA: Matthew Fowler
FRC #0312 (Heatwave); FRC #1369 (Minotaur)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2001
Location: St. Petersburg, FL, USA
Posts: 78
fowlerm has a spectacular aura aboutfowlerm has a spectacular aura aboutfowlerm has a spectacular aura about
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 00:27.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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