Software > Software

java programming for microcontroller.

<< < (2/3) > >>

Hi, When i was at high school there was an informatic class about "javarobot" i think they use lego NXT with java. I'm not sure about that but, I'f you're interested, I can get more information. Let me know

Hello Vendra, this is exactly what HaikuVM is all about: bringing JAVA skill and leJOS down to AVR based robots. Where leJOS is a JAVA runtime and a toolset for lego NXT which allows Lego Mindstorms robots to be programmed in JAVA. HaikuVM is a toolset to build your AVR based "javarobot".

All those nice libraries in Java use way too much resources to fit on a microcontroller. They are designed for full-size processors.

If you already know C/C++ and need libraries for general programming, and for robots in particular, try looking at some of the available libraries:
C++ Standard Template Library (part of the language)
OpenCV (vision)
ROS (Robot OS)

For me it's more fun to use JAVA especially when it comes to multithreading or when it comes to code size. Because JAVA bytecode tends to be 4 times shorter than compiled C code for an AVR (@jwatte so it's C which 'use way too much resources'). In other words, if you write a C program which needs 8k flash (which is a complete ATmega8) an equivalent JAVA program only consumes 2k flash (leaving more than enough space for the (Haiku-)VM). I think this small code size comes from the fact that JAVA was originally designed for micro-controllers of the 90th.

@jwatte: BTW this thread is about ATMega-32 micro-controller (and JAVA). I never have heard, that ROS (Robot OS) runs on ATMega-32.


--- Quote --- I never have heard, that ROS (Robot OS) runs on ATMega-32.

--- End quote ---

Well, there are ROS slave devices that run on Atmega. But the actual suggestion was that, if you're going to run on a machine where the "nice Java libraries" are available, then you might as well run with C++, because it, too, has "nice libraries."
The specific quote from the original poster was this:

--- Quote ---java has got a rich classes for such purpose and an ease in mathematical calculations

--- End quote ---

Which I translated to "nice libraries."

Doing computer vision on an Atmega? Not gonna work, no matter what the library and language!

--- Quote ---it's C which 'use way too much resources

--- End quote ---

I was actually talking about the libraries, not the language. If you want a really compact language, try tokenized Forth :-)
If a VM or interpreted language of some sort hits your performance goals, but all means, use it as code compression!


[0] Message Index

[#] Next page

[*] Previous page

Go to full version