Can leJOS run on ev3dev?

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

Moderators: roger, gloomyandy, skoehler

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Mon Oct 26, 2015 5:33 pm

If anyone is really serious about doing a port to ev3dev (or any other system on EV3 hardware) I think that the first step would be to evaluate the two systems. Key things for me would be:
* Basic CPU based performance (how fast does Java run). Would expect them to be pretty much the same but you never know.
* USB master performance (impacts things like WiFi and video capture speed).
* WiFi performance
* Bluetooth performance
* OpenCV video capture rates
* Motor control quality and capability (things like accelerating two motors from stop to different speeds, do they both reach the new speed at the same time, same for slowing motors, position holding and accuracy, overshoot etc.).
* I2C performance and compatibility.
* Features what would be lost/gained, what work would be needed to fix any losses.
Don't assume that a newer version will be faster. In my own tests with openCV the newer capture driver for V4L (that uses libv4l) produced about half the capture rate. One problem is that recent hardware tends to be faster and newer software may have traded ease of implementation or other things for performance assuming that the faster hardware will make up for it.

I would hate to see a lot of work done to port things and then we discover that the new system is substantially slower or less capable than the old. On the other hand if these tests showed that the new system offered better performance in some of these key areas I'd be much more inclined to want to work on it!

Then I'd look at things like packaging and user experience:
* What would an install look like for an average user (Windows/Mac/Linux).
* How would a new user compile/run/debug a program.
* Support, what happens when things go wrong, who will fix a problem, how will users get support.
* Development environment. How easy is it for leJOS developers (new and old) to add new features, create new releases, test new versions etc.
Advanced users can take care of themselves. But how for instance will a problem in say a sensor driver that only shows up for a leJOS user, but which needs a fix in a kernel driver be resolved? What if this fix would change the way the driver works for say users of a Python API?


Most of the above can be done without having to any porting work or anything else. I'd be very interested to see the results of such an evaluation. Doing the above evaluation would also provide a great way of becoming familiar with any new platform (which is pretty much essential for anyone taking on a port), any takers?
leJOS news https://lejosnews.wordpress.com/

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Tue Oct 27, 2015 8:26 am

@skoehler

Hi, I agree with you that Busybox is compact and lightweight application to emulate a Linux OS and they include the most general application. The main reason to try to explore the scenario to replace Busybox is to offer to a LeJOS developer the opportunity to use an OS not an emulation.

Besides, using a Busybox we lost the advantage of using a package manager.

@gloomyandy Comment 1

Hi, I wanted to say packages in general.

This idea is fantastic:
"To see how you can add extra packages look at how we create the sdcard, you just download a package from the Debian Squeeze repo (select the armel architecture), expand it and copy the files to the EV3 it really is not that hard. We use this to things like additional Bluetooth tools, etc."

But imagine if you use apt-get install xxx

Currently, some tools interesting to explore new features could be:

+ Module and Command line tool to manage BLE devices as Sbrick for example:
https://www.youtube.com/watch?v=o2ZaOaBXcwQ
https://www.youtube.com/watch?v=xc2LMRMaQl8
https://www.youtube.com/watch?v=RLAgWa1HqQ8
http://ofalcao.pt/blog/2014/sbrick-beta-testing

gatttool -b 00:07:80:7F:28:E1 -i hci0 --char-write --handle=0x0025 --value=010000FF

+ Usage of ROS with EV3
http://www.ev3dev.org/projects/2014/11/17/ROS-on-EV3/
https://github.com/moriarty/ros-ev3
https://github.com/moriarty/ros-ev3/blo ... ncies.debs

+ Optical Devices as Kinect, Zed, etc...
http://openkinect.org/wiki/Getting_Started
https://www.stereolabs.com/

+ Git
to checkout, build and run

In general, the idea is to be an Open system and I am going to explain the idea:
Package manager where developed to help users to install/update/remove packages and modules.
Currently with Busybox the experience is a bit frustrated and tools are not the same that you have with Linux. This is the main reason, if you are trying to test something and a module that you have in linux is not available in busybox, you throw the idea... Using a package manager, it is easier to install packages and hide details... When I say that the system is not open is about the complexity to add new modules and packages. I not sure if 5% of users has the skills but in the other hand, EV3Dev users has this features.

EV3 is the generation for Linux and Internet.

Anyway, I think that current environment is perfect to develop Robots with Java, but we are losing users who they would like to experiment with Linux. LeJOS API is brillant and advanced, everyone know it, but we should try to explore in a development branch, not in the stable branch.

Some months ago, I was thinking to create an example to do Cyber War between 2 robots but, I wanted to implement a robust defense with IpTables because I didn't have the tool..
https://github.com/jabrena/livingrobots ... pter15/ev3

@gloomyandy Comment 2

I would like to explore this idea to answer this questions:

* Basic CPU based performance (how fast does Java run). Would expect them to be pretty much the same but you never know.
* USB master performance (impacts things like WiFi and video capture speed).
* WiFi performance
* Bluetooth performance
* OpenCV video capture rates
* Motor control quality and capability (things like accelerating two motors from stop to different speeds, do they both reach the new speed at the same time, same for slowing motors, position holding and accuracy, overshoot etc.).
* I2C performance and compatibility.
* Features what would be lost/gained, what work would be needed to fix any losses.
Don't assume that a newer version will be faster. In my own tests with openCV the newer capture driver for V4L (that uses libv4l) produced about half the capture rate. One problem is that recent hardware tends to be faster and newer software may have traded ease of implementation or other things for performance assuming that the faster hardware will make up for it.

I am totally agree with you. If after testing, we discovered that the performance is significative low, we could discard this way, but I only say: "We could try it" :D

In my case, I have some Raspberry Pi (1b & 2), some EV3 Bricks and some SDs. I am waiting for a BLE Dongle and I have some Arduino boards to test I2C. I will try to the following features in EV3 and PiStorm with Raspberry PI2:

+ Install EV3Dev for Raspberry Pi
+ Install Java 8 for Embedded environments
+ Try to communicate some sensors using EV3Dev way: sysfs <- I notice that motor system uses other techniques.
+ USB master performance
+ WiFi performance
+ Bluetooth performance
+ OpenCV video capture rates
+ I2C performance and compatibility.
+ Motor control quality and capability. <- Last tests.

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Tue Oct 27, 2015 10:41 am

It would be much more useful to concentrate on comparing ev3dev on the EV3 with leJOS rather than involving the rPi in all of this. But please don't ignore the other elements of my post like how will this be supported, how easy is it for a new leJOS user to get started etc. For me an important part of leJOS is that it allows users to move on from the easy to use programming environment provided by LEGO to a more sophisticated one using Java, Eclipse etc. This for many users is a big jump, many already struggle to make that move I don't want to make things any harder for them. The more general you make the platform the more confusing it tends to become for the user that wants to do the simple things.

So let me ask you a few questions...
* Are you a user of ev3dev on the EV3?
* Have you tried to run Java on it?
* Why not just go ahead and try to do a port of leJOS to eve3dev to see how well things work?
leJOS news https://lejosnews.wordpress.com/

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Wed Oct 28, 2015 5:10 pm

Those are general questions by the way, directed at anyone that is interested in leJOS on ev3dev....
leJOS news https://lejosnews.wordpress.com/

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Wed Oct 28, 2015 10:36 pm

Hi Andy,

Sorry by the delay, I was a busy day in the office.

I think that exist so much work for both sides:

EV3 Brick
Raspberry Pi 2 with BrickPi & PiStorms hats

But the great thing is that EV3Dev has unified way to use sensors and actuators with independency of the board. Yes, I have in mind that you say about reducing the learning curve, but I think that in next months, we will have to work in the integration process and later we will try to do an educative documentation.

This weekend, I will create a list of issues.

In relation to your questions:

1. Yes, In General I am a Mindstorm Developer and I have tried EV3Dev. It is nice to explore new developments to learn. In LeJOS side, we have some advanced features inside of LeJOS Menu but others, Brickman does a nice work.
The documentation to begin to use EV3Dev has some iterations and it is very complete.
http://www.ev3dev.org/docs/getting-started/
For example with EV3Dev, I am exploring Golang with a EV3 Brick and the performance is interesting.
https://github.com/jabrena/skymapper
Node.js for EV3 Brick doesn't have so much future due to V8 engine doesn't have a binary for ARM5 so many packages will not install. Current Node.js support is for version v0.10.29 and that version is old (Current version is v4.2.1 and it includes LTS support, https://nodejs.org/en/).
In my tests, I had several problems when I used npm to install some packages.
https://github.com/ev3dev/ev3dev-lang/issues/103
2. Not Yet. I will install the Debian Package and I will try to execute the classic Hello World. The next step could be the integration with a sensor using this documentation:
http://www.ev3dev.org/docs/sensors/
After, I will study LeJOS base classes to identify the easiest way to integrate. Anyway I think that more LeJOS users will collaborate or other guys from the community.
3. This is the idea that I trying to communicate.
Stable work: http://sourceforge.net/p/lejos/ev3/code/ci/master/tree/
Experimental Dev: This idea from this thread. I wish all goes well. With more CPU and a Full-featured OS, Java users will use Maven to build and deploy robots for example and we will experiment integrating different technologies.
Many times, the solution not use a unique recipe.

Good nights

Cheers

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Mon Nov 30, 2015 9:55 am

Hi Andy,

Do you have some code for this part?

* Basic CPU based performance (how fast does Java run). Would expect them to be pretty much the same but you never know.
* OpenCV video capture rates

I have OpenCV running on EV3Dev with this Debian package:
https://packages.debian.org/jessie/libopencv2.4-java

Code: Select all

sudo apt-get install libopencv2.4-java


If you have some benchmark test for jvm running on busybox, I could reuse on EV3Dev too.
Another alternative could be the usage of some opensource library. In the case of OpenCV, what is your idea to test?

Cheers
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Tue Dec 01, 2015 5:39 pm

There is a basic cpu benchmark in the nxt repo that could probably be cleaned up and used:
https://sourceforge.net/p/lejos/nxt/cod ... benchmark/

As to openCV something like:

Code: Select all

public class OpenCVTest {
    static final int READ_IMAGE_CNT = 1000;
    static final int ENCODE_IMAGE_CNT = 1000;
    VideoCapture vid;
    Mat camImage = new Mat();

  void init()
  {
      vid = new VideoCapture(0);
      //vid.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, 160);
      //vid.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, 120);
      //vid.open(0);
      vid.read(camImage);
      System.out.println("Image size is: " + camImage.cols() + "x" + camImage.rows());
  }
   
  void captureTest()
  {
      System.out.println("capture test read " + READ_IMAGE_CNT + " images");
      long start = System.currentTimeMillis();
      for(int i = 0; i < READ_IMAGE_CNT; i++)
          vid.read(camImage);
      double time = (double)(System.currentTimeMillis() - start)/1000;
      System.out.println("Time is " + time + " = " + (READ_IMAGE_CNT/time) + "fps");
  }
 
  void encodeTest()
  {
      System.out.println("Encoding image as jpeg " + ENCODE_IMAGE_CNT + " images");
      MatOfByte buf = new MatOfByte();
      long start = System.currentTimeMillis();
      for(int i = 0; i < READ_IMAGE_CNT; i++)
          Highgui.imencode(".jpg", camImage, buf);
      double time = (double)(System.currentTimeMillis() - start)/1000;
      System.out.println("Time is " + time + " = " + (READ_IMAGE_CNT/time) + "fps");
  }
 
 
  public static void main(String[] args) {
    // Load the native library.
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    OpenCVTest test = new OpenCVTest();
    test.init();
    test.captureTest();
    test.encodeTest();
  }
}





Note that when testing openCV you must make sure that exactly the same image is being captured/processed. If not then things like varying amounts of compression of the image performed by the camera will impact the results. Obviously you also need to be using the same camera (and USB hub if you are using one).

Out of interest how long has it taken you to setup ev3dev with openCV. I just installed ev3dev, followed the recommended update process and then installed openCV it took a long time to go through all of the package installs (probably 2 hours or more).
leJOS news https://lejosnews.wordpress.com/

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Wed Dec 02, 2015 7:47 pm

Hi Andy,

I did both tests in local and remote with EV3 running with EV3Dev + OpenCV + OpenJDK7.

I checked the code for jvm benchmarking and migrated to Maven:
https://github.com/jabrena/ev3dev-lang- ... /benchmark

Results:

Test 1: JVM:

Code: Select all

root@ev3dev:/home# java -cp ./benchmark-1.0-SNAPSHOT.jar org.lejos.nxt.benchmark.GeneralBench
GeneralBench 1.2
       6 byte[16384] manual copies:       117 ms     840205 bytes/sec
    1220 byte[16384] arraycopies:         259 ms   77175598 bytes/sec
      24 int[4096] manual copies:         133 ms    2956511 bytes/sec
    1220 int[4096] arraycopies:           256 ms   78080000 bytes/sec
  200000 byte add:                         73 ms    2739726 ops/sec
  200000 byte sub:                         72 ms    2777777 ops/sec
  200000 byte mul:                         68 ms    2941176 ops/sec
  200000 byte div:                        155 ms    1290322 ops/sec
  200000 short add:                        71 ms    2816901 ops/sec
  200000 short sub:                        70 ms    2857142 ops/sec
  200000 short mul:                        65 ms    3076923 ops/sec
  200000 short div:                        84 ms    2380952 ops/sec
  200000 char add:                         71 ms    2816901 ops/sec
  200000 char sub:                         72 ms    2777777 ops/sec
  200000 char mul:                         67 ms    2985074 ops/sec
  200000 char div:                        104 ms    1923076 ops/sec
  200000 int add:                          56 ms    3571428 ops/sec
  200000 int sub:                          53 ms    3773584 ops/sec
  200000 int mul:                          54 ms    3703703 ops/sec
  200000 int div:                          73 ms    2739726 ops/sec
  200000 long add:                         57 ms    3508771 ops/sec
  200000 long sub:                         56 ms    3571428 ops/sec
  200000 long mul:                         62 ms    3225806 ops/sec
  200000 long div:                        167 ms    1197604 ops/sec
  200000 float add:                       101 ms    1980198 ops/sec
  200000 float sub:                       101 ms    1980198 ops/sec
  200000 float mul:                        80 ms    2500000 ops/sec
  200000 float div:                       154 ms    1298701 ops/sec
  200000 double add:                       99 ms    2020202 ops/sec
  200000 double sub:                      101 ms    1980198 ops/sec
  200000 double mul:                      121 ms    1652892 ops/sec
  200000 double div:                      505 ms     396039 ops/sec
  200000 method calls:                    200 ms    1000000 ops/sec
  200000 static method calls:             155 ms    1290322 ops/sec
  200000 native static method calls:    14002 ms      14283 ops/sec
    2000 string concats:                 1014 ms       1972 ops/sec
   20000 string compares (easy):          171 ms     116959 ops/sec
    1000 string compares (hard):            2 ms     500000 ops/sec
   20000 object creations:                210 ms      95238 ops/sec
 6442048 Total Loop Executions:         26855 ms     239882 loops/sec
Note: each Loop Execution includes multiple Java operations
root@ev3dev:/home#


Test 2:

Code: Select all

root@ev3dev:/home# java -cp ./benchmark-1.0-SNAPSHOT.jar org.lejos.nxt.benchmark.MathBench
MathBench 1.2
     800 sqrt (historic, simple, subnormal):        176 ms   4545 ops/sec
    4000 sqrt (historic, simple, normal):           118 ms  33898 ops/sec
    4000 sqrt (historic, linear, subnormal):        202 ms  19801 ops/sec
    4000 sqrt (historic, linear, normal):           140 ms  28571 ops/sec
    4000 sqrt (current, subnormal):                 134 ms  29850 ops/sec
    4000 sqrt (current, normal):                    103 ms  38834 ops/sec
    8000 sqrt (new, float, subnormal):              160 ms  50000 ops/sec
    8000 sqrt (new, float, normal):                 121 ms  66115 ops/sec
    8000 sin (historic1, 1):                        136 ms  58823 ops/sec
    8000 sin (historic1, 2):                        125 ms  64000 ops/sec
    8000 sin (historic1, 3):                        127 ms  62992 ops/sec
    8000 sin (historic1, 4):                        128 ms  62500 ops/sec
    8000 sin (historic1, 5):                        133 ms  60150 ops/sec
    8000 sin (historic1, 6):                        138 ms  57971 ops/sec
    8000 sin (historic1, 7):                        125 ms  64000 ops/sec
    4000 sin (current, 1):                           79 ms  50632 ops/sec
    4000 sin (current, 2):                           81 ms  49382 ops/sec
    4000 sin (current, 3):                           85 ms  47058 ops/sec
    4000 sin (current, 4):                           90 ms  44444 ops/sec
    4000 sin (current, 5):                           85 ms  47058 ops/sec
    4000 sin (current, 6):                           84 ms  47619 ops/sec
    4000 sin (current, 7):                           85 ms  47058 ops/sec
    8000 cos (historic1, 1):                        137 ms  58394 ops/sec
    8000 cos (historic1, 2):                        138 ms  57971 ops/sec
    8000 cos (historic1, 3):                        234 ms  34188 ops/sec
    8000 cos (historic1, 4):                        144 ms  55555 ops/sec
    8000 cos (historic1, 5):                        149 ms  53691 ops/sec
    8000 cos (historic1, 6):                        157 ms  50955 ops/sec
    8000 cos (historic1, 7):                        139 ms  57553 ops/sec
    4000 cos (current, 1):                           84 ms  47619 ops/sec
    4000 cos (current, 2):                           85 ms  47058 ops/sec
    4000 cos (current, 3):                           92 ms  43478 ops/sec
    4000 cos (current, 4):                           90 ms  44444 ops/sec
    4000 cos (current, 5):                           93 ms  43010 ops/sec
    4000 cos (current, 6):                           92 ms  43478 ops/sec
    4000 cos (current, 7):                           97 ms  41237 ops/sec
    4000 tan (historic1, 1):                        136 ms  29411 ops/sec
    4000 tan (historic1, 2):                        142 ms  28169 ops/sec
    4000 tan (historic1, 3):                        145 ms  27586 ops/sec
    4000 tan (historic1, 4):                        169 ms  23668 ops/sec
    4000 tan (historic1, 5):                        150 ms  26666 ops/sec
    4000 tan (historic1, 6):                        155 ms  25806 ops/sec
    4000 tan (historic1, 7):                        136 ms  29411 ops/sec
    4000 tan (current, 1):                          135 ms  29629 ops/sec
    4000 tan (current, 2):                          137 ms  29197 ops/sec
    4000 tan (current, 3):                          121 ms  33057 ops/sec
    4000 tan (current, 4):                          151 ms  26490 ops/sec
    4000 tan (current, 5):                          148 ms  27027 ops/sec
    4000 tan (current, 6):                          122 ms  32786 ops/sec
    4000 tan (current, 7):                          151 ms  26490 ops/sec
      20 exp (historic1, -700):                     100 ms    200 ops/sec
     400 exp (historic1, -10):                       96 ms   4166 ops/sec
    4000 exp (historic1, 0):                         20 ms 200000 ops/sec
     400 exp (historic1, +10):                       96 ms   4166 ops/sec
      20 exp (historic1, +700):                     100 ms    200 ops/sec
    4000 exp (historic2, -700):                     341 ms  11730 ops/sec
    4000 exp (historic2, -0.5):                     314 ms  12738 ops/sec
    4000 exp (historic2, -0.1):                     399 ms  10025 ops/sec
    4000 exp (historic2, 0.0):                       81 ms  49382 ops/sec
    4000 exp (historic2, +0.1):                     264 ms  15151 ops/sec
    4000 exp (historic2, +0.5):                     377 ms  10610 ops/sec
    4000 exp (historic2, +0.69):                    390 ms  10256 ops/sec
    4000 exp (historic2, +700):                     402 ms   9950 ops/sec
    4000 exp (current, -700):                        87 ms  45977 ops/sec
    4000 exp (current, -0.5):                        79 ms  50632 ops/sec
    4000 exp (current, -0.1):                        73 ms  54794 ops/sec
    4000 exp (current, 0.0):                         84 ms  47619 ops/sec
    4000 exp (current, +0.062):                      73 ms  54794 ops/sec
    4000 exp (current, +0.1):                        75 ms  53333 ops/sec
    4000 exp (current, +0.5):                        84 ms  47619 ops/sec
    4000 exp (current, +700):                        87 ms  45977 ops/sec
      40 log (historic1, small):                     76 ms    526 ops/sec
    2000 log (historic1, medium):                   124 ms  16129 ops/sec
      40 log (historic1, large):                     78 ms    512 ops/sec
    2000 log (historic2, subnormal):                176 ms  11363 ops/sec
    2000 log (historic2, normal):                   171 ms  11695 ops/sec
    8000 log (historic2, 1.0):                      185 ms  43243 ops/sec
    4000 log (historic2, 1.0001):                   183 ms  21857 ops/sec
    4000 log (historic2, 1.001):                    184 ms  21739 ops/sec
    4000 log (historic2, 1.01):                     183 ms  21857 ops/sec
    4000 log (historic2, 1.3):                      229 ms  17467 ops/sec
    2000 log (historic2, 1.9):                      206 ms   9708 ops/sec
    2000 log (current, subnormal):                   51 ms  39215 ops/sec
    2000 log (current, normal):                      48 ms  41666 ops/sec
    8000 log (current, 1.0):                         93 ms  86021 ops/sec
    4000 log (current, 1.0001):                      85 ms  47058 ops/sec
    4000 log (current, 1.001):                       86 ms  46511 ops/sec
    4000 log (current, 1.01):                        86 ms  46511 ops/sec
    4000 log (current, 1.3):                         86 ms  46511 ops/sec
    2000 log (current, 1.9):                         49 ms  40816 ops/sec
      20 D2STR (current, PI*1E+300):                268 ms     74 ops/sec
      40 D2STR (current, PI*1E+100):                248 ms    161 ops/sec
     400 D2STR (current, PI*1E0):                   302 ms   1324 ops/sec
      40 D2STR (current, PI*1E-100):                271 ms    147 ops/sec
      20 D2STR (current, PI*1E-300):                206 ms     97 ops/sec
  392240 Total Loop Executions:                   32390 ms  12109 loops/sec
Note: each Loop Execution includes multiple Java operations


OpenCV test:

The benchmark was stored in the following repository:
https://github.com/jabrena/ev3dev-lang- ... benchmark1

Code: Select all

root@ev3dev:/home# java -Djava.library.path=/usr/lib/jni/ -cp benchmark1-1.0-SNAPSHOT.jar:/usr/share/OpenCV/java/opencv-249.jar ev3dev.opencv.benchmark.OpenCVTest
Image size is: 640x480
capture test read 1000 images
Time is 223.362 = 4.477037275812359fps
Encoding image as jpeg 1000 images
Time is 331.448 = 3.0170645169076296fps


Currrently, I have a basic support for regulated motors. This week I will try to add the sensor & filter support to release the v0.2.0 version.
I think that we could add some RMI support to communicate bricks with both systems.

What is the usage of dbus in the LeJOS architecture for busybox?
This week, I will try to connect visualvm to jvm running on ev3dev.

Cheers
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Wed Dec 02, 2015 8:45 pm

Firstly please stop referring to busybox. There is virtually no connection between busybox and leJOS. The only usage of the busybox project in a leJOS image is to provide a more compact version of some of the commonly used Linux commands (as Sven explained earlier in this thread). All of the major subsystems like the kernel, WiFi, system libraries, Bluetooth, device modules, dbus and everything else use standard Linux components just like other Linux distributions, if you take a look at how we build the leJOS sd card you will see that we add a number of packages taken directly from the Debian distributions.

As to dbus well leJOS on the EV3 runs on a Linux system and just like other Linux systems (including ev3dev) it uses dbus as a mechanism to allow various sub systems to communicate. In this particular case we use dbus to talk to the Linux Bluetooth and WiFi systems. Pretty much the only use for this is to support various functions in the leJOS menu system.

For the benchmarks, you really need to also run the same tests using leJOS for us to be able to compare the two. It is not really sensible to try and compare things like openCV performance without using both exactly the same hardware and as I noted earlier ensuring that the camera is pointing at exactly the same image. It would also be useful for you to provide details of the hardware you have used for the tests (what webcam, what USB hub, what other devices were connected to the hub etc.). Oh and when converting the simple benchmark, you really need to run the tests in a loop so that they all get executed multiple times, if you don't do this then you will not get a true picture of the performance due to the JIT compiler.
leJOS news https://lejosnews.wordpress.com/

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Wed Dec 02, 2015 10:01 pm

Hi Andy,

Sorry by the mention about Busybox.

In relation to the benchmarking, this weekend I will try to do again. Besides I will install in LeJOS distro and EV3Dev, Oracle Java 8.

Well, I will continue with some basic aspects about unregulated motors and a set of sensors using sensor framework.

Cheers

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Wed Dec 02, 2015 10:16 pm

If you can it would also be interesting to run the tests with and without the leJOS menu running (and also the ev3dev brickman if it is possible to stop it). I suspect that the current leJOS menu consumes a fair bit of cpu (something that I hope Aswin will be able to address). You can easily kill the leJOS menu by using killall java from a ssh session.
leJOS news https://lejosnews.wordpress.com/

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

Re: Can leJOS run on ev3dev?

Postby gloomyandy » Wed Dec 02, 2015 10:24 pm

Oh and it would also be good to see what the available formats are from your webcam. You can list these using the command

Code: Select all

v4l2-ctl --list-formats-ext


I suspect looking at the frame rate you are getting that your camera is capable of producing mjpeg output, which probably makes it even more important to ensure you point the camera at exactly the same scene for all of the tests. Will be interesting to see the results!

EDIT changed command to give more details
leJOS news https://lejosnews.wordpress.com/

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Mon Feb 20, 2017 12:08 am

Ev3dev-lang-java v0.4.0 is out.
http://ev3dev-lang-java.github.io/#/

    Java 9 support (Raspberry Pi 3)
    EV3 Brick, PiStorms v1/v2 & BrickPi+ support
    OpenCV support
    Logging support
    Regulated Motor Support
    Unregulated Motor Support
    Sensor Support
    Sounds
    LeJOS Sensor filter Support
    eSpeak TTS (Text to speech) Support

Next iteration:
https://github.com/ev3dev-lang-java/ev3 ... ilestone/5

Cheers

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Mon Apr 03, 2017 8:02 pm

Ev3dev-lang-java v0.5.0 is out.
http://ev3dev-lang-java.github.io/#/

v0.5.0 includes:

- Support for LIDAR RPLidar A1
- Install Java 9 JDK for Brickpi+/PiStorms + Raspberry Pi 3 in an easy way
- Enabling sound support for Brickpi+/PiStorms + Raspberry Pi 3
- [POC] Install ROS Kinetic on Brickpi+/PiStorms + Raspberry Pi 3
- [POC] ROSJava node creation

Libraries and Maven artifacts:
https://github.com/ev3dev-lang-java/ev3dev-lang-java
https://github.com/ev3dev-lang-java/lejos-commons
https://github.com/ev3dev-lang-java/RPLidar4J

Javadocs:
http://ev3dev-lang-java.github.io/docs/ ... index.html

Demo:
https://www.youtube.com/watch?v=SIwG848ODI8

Cheers

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots

User avatar
esmetaman
Advanced Member
Posts: 358
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: Can leJOS run on ev3dev?

Postby esmetaman » Sun May 14, 2017 7:13 pm

If you have the curiosity to test Java with EV3Dev, this installer could help you in the process.
https://github.com/ev3dev-lang-java/installer

For EV3 Brick, at the moment, the unique way to install Java 8, is the Oracle JRE.
http://www.oracle.com/technetwork/java/ ... 82511.html

If you have any doubt or problem:
https://github.com/ev3dev-lang-java/ev3 ... ava/issues

Cheers

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest