leJOS Overview

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

leJOS Overview

Postby celanba » Fri Apr 25, 2014 12:33 pm

Hi,
I've found this url http://www.gloomy-place.com/lejos/lejosatjavaone.pdf and found it to be extremely informative and helpful for newcommers to leJOS.
I was wondering if anything like page 7 (which explains how leJOS works for the NXT) exists for the EV3. If not, could anyone could help med piece together what changes need to be made to the pictogram, to accurately explain the current setup of leJOS for EV3.

Andy, I'm looking at you specifically 8)
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby celanba » Wed Jun 04, 2014 9:25 am

Alright, I've made a version myself. Actually two versions. Could I get somebody to take a look and critique my illustration? (ei. tell me if I misunderstod stuff/things need to be changed arround/something was unintentionally left out)..

I've tried to make it look a bit like the first NXT overview found in lejosatjavaone.pdf, but things have changed a bit...

Looking forward to hearing your suggestions,
Cheers :)

Illustration of how the layers of the leJOS-enpowered brick checks the battery voltage.
Image

Overview image over the layers
Image

Edit: Is it correct to say, that any call to a hardware-related part of leJOS ends up calling one or more of the native methods in lejos.internal.io.NativeFile.Linux_C_lib_DirectMapping ?
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby gloomyandy » Wed Jun 04, 2014 10:28 am

Hi,
that is a pretty fair representation. Things that are missing are the system related stuff like Bluetooth and networking, you would need to include things like dbus (for access/control of the Bluetooth interface), and the other admin functions. It might also be worth showing how leJOS allows the use of USB for things like network dongles and how the slave port can be used to make the EV3 appear as a network device to other systems (including another EV3). Oh and you may also want to add things like the remote API and remote debug capabilities into that picture (or perhaps in another one). The remote capability is implemented as part of the menu, the debug features are part of the JVM.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4239
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Overview

Postby celanba » Wed Jun 04, 2014 11:33 am

Thanks for the reply. Those are some pretty obvious oversights, so I guess I was a bit too focused upon the sensors/motors :).
Just to clarify, what Im going to change:

leJOS Java Framework gets the following added:
-------------------------------------------------------------------------------|
| %%%%%%%%% Remote %%%%%%%%%%%% |
|----------------| %% |-----------------| %% |-----------------|%%%|
|% EV3%%| %% |% NXT %%| %% |% RCX %%|%% |
|----------------| %% |-----------------| %% |-----------------|%%%|
| %%%%%%%%%%%%%%%%%%%%%%%%%%|
-------------------------------------------------------------------------------|

These tre boxes gets added to the Linux layer:
|----------------| %%% |-----------------| %%% |-----------------|
| Bluetooth | %%% |%WiFi %% | %%% |% USB%%|
|----------------| %%% |-----------------| %%% |-----------------|

Bluetooth, WiFi and USB will be connected to a wire that connects to a pc, a EV3-brick and a router.

I only want to depict functionality, so Im unsure how to include the debug-feature. Any suggestions?
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby gloomyandy » Wed Jun 04, 2014 2:18 pm

The debug feature you could depict by having a link from the JVM to a PC, or possibly to an eclipse icon (you could also have a link from the same icon to the menu system to represent the eclipse plugin talking to that for program start etc.).
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4239
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Overview

Postby celanba » Wed Jun 04, 2014 2:27 pm

Hmm. I'm going to try out some things, to see what gets to look good. When I have a new and improved version ready, I'll post it here in this thread, with some sort of explaination of why I've drawn your improvements they way I have. Should be ready this week.

Anyway, thanks a bunch for the precise feedback. It's a huge help in understanding how to piece together these very simplified illustrations of what leJOS actually is, in relation to the hardware and existing LEGO-software (the c-libraries).
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby celanba » Mon Jun 09, 2014 11:48 pm

Alright, so here is the updated version.
I've decided against connecting any physical devices to the leJOS Java Framework layer - this illustration is really all about showing the different layers of the framework as a whole, and most people can look up what specific features are supported through fx. wifi (debugging as mentioned earlier) if they want to use said feature. I also asked my graphical designer to add her name to the image, so she get's the credit she's due. Contact me if you want to get a version without that name appended.

Still, I'd like any and all feedback on how to improve the illustration. Did I miss something, or is something confusing? Let me know!

Thanks :)

Image
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby gloomyandy » Tue Jun 10, 2014 12:00 am

A few things....
* The native code used by leJOS is not really in the form of native methods. It is actually in the form of kernel modules, and communication with this is via Linux read/write/ioctl and shared memory. Native methods will give most Java programmers the impression that jni is being used.
* The kernel modules for motor control, sound, i2c and to some extent uart are now very different in the leJOS version from the original Lego version, the diagram gives the impression these modules are the same as used in the Lego code. This was the case but not any more.
* I'm not really convinced that the diagram captures the role that the menu plays in remote device/command handling.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4239
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Overview

Postby celanba » Tue Jun 10, 2014 9:09 am

gloomyandy wrote:* The native code used by leJOS is not really in the form of native methods. It is actually in the form of kernel modules, and communication with this is via Linux read/write/ioctl and shared memory. Native methods will give most Java programmers the impression that jni is being used.

Nice catch, an obvious oversight on my part. Changing the "Native Methods" part to "Kernel Modules" should make it more clear that JNA is used in relation with kernel modules instead of JNI, right?

gloomyandy wrote:* The kernel modules for motor control, sound, i2c and to some extent uart are now very different in the leJOS version from the original Lego version, the diagram gives the impression these modules are the same as used in the Lego code. This was the case but not any more.

I'll add something like "leJOS-modified" in front of the LMS section, to make it more clear that you've enhanced the code. I take it that you've made at least minor adjustments to ALL the kernel modules, then? (so I can keep them all in the same leJOS-modified box)

gloomyandy wrote:* I'm not really convinced that the diagram captures the role that the menu plays in remote device/command handling.

This diagram is trying to display how the different layers of the leJOS-enhanced EV3 brick is organized. I'm don't understand why the role of the menu should be in this overview. Can you delve a bit more into what is missing and what you'd like me to change and, if possible, how?
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby gloomyandy » Tue Jun 10, 2014 10:02 am

It is the menu that is running the services that allow remote control of EV3 in addition to the "expected" user interface. I suspect that most users do not understand this and I think it is worth pointing it out, no menu, no remote services. So perhaps add a sub-component into the menu box (maybe two one for remote services, one for UI)?

Yes we have modified all of the kernel modules.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4239
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Overview

Postby celanba » Tue Jun 10, 2014 10:23 am

Ah, I think I get where you're going with this. So basicly, I could show this by moving "leJOS System Menu" down below the "User Program", to illustrate that the menu contains services that the user-program might need... I should even move the "Remote" box from "leJOS Java Framework" up into the new "menu" layer?

Would this change, in tandem with the ones suggested in my previous post, make this illustration complete?
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby gloomyandy » Tue Jun 10, 2014 11:32 am

No, the user program does not need the menu, it is remote programs that use these services. So programs using the leJOS remote API (running on other EV3s, NXTs, PCs, Android devices etc), or the programs used by leJOS to start programs from the eclipse plug-in etc. The remote box is sort of correct in that the basic classes live in the leJOS class library. But the actual process is running in the menu and it is the menu that attaches these classes to the various Bluetooth and network endpoints.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4239
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Overview

Postby celanba » Tue Jun 10, 2014 11:43 am

Hmm. So basicly, the first version was more or less correct? What I hear you saying, is that I should add an internal box to "leJOS System Menu" that says something akin to "Remote API Facilitator"? But then again, doesn't the menu system facilitate the startup of the "User Programs" aswell?

I tend to think that the communication API should be described in a different illustration, as it spans multiple layers.

Thank you for explaining your point of view. Unless you have something besides the remote API, you feel is missing, I think Ill make a final version and upload that.

Cheers :)
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Re: leJOS Overview

Postby gloomyandy » Tue Jun 10, 2014 12:01 pm

It is your diagram, you can obviously choose to ignore my comments, but on this I really think you are wrong. The menu plays a key part in the leJOS remote API, not showing it is misleading.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4239
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Overview

Postby celanba » Tue Jun 10, 2014 12:05 pm

Wow, that sounds bad. Can you explain to me how you'd illustrate the leJOS remote API as part of this illustration of the layers that make up the leJOS-enhanced brick? Clearly, I don't quite understand it, and need some help in figuring out how to include in in the figure...
celanba
New User
 
Posts: 16
Joined: Thu Feb 13, 2014 8:55 am

Next

Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff