Navigator

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

Moderators: roger, gloomyandy, skoehler

Re: Navigator

Postby gloomyandy » Mon Jul 07, 2014 8:31 pm

Hi Roger,
you need to do a pull (and fix any problems) before you do the push.

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

Re: Navigator

Postby epascual » Mon Jul 07, 2014 8:56 pm

I wrote a fix for the problem of rotations being not optimized when using turn-and-go moves. It's quite simple and is located near the end of Nav.run() :
Code: Select all
if (_destination.isHeadingRequired()) {
    _pose = poseProvider.getPose();
    double angle = _destination.getHeading() - _pose.getHeading();
    if (angle > 180)
        angle = angle - 360;
    else if (angle < -180)
        angle = angle + 360;
    ((RotateMoveController) _pilot).rotate(angle);
}

I first tried to edit the sources after doing a git clone, so that I could propose a real patch, but the problem is that I can't rebuild ev3classes and dbusjava. Here is the message when running Ant build :
BUILD FAILED
/home/eric/EV3/java/lejos/git/ev3classes/build.xml:21: java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 51.0

At a time, there has been a complaint related to JNA, so I tried to rebuild it too, but it failed with this output :
Buildfile: /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/build.xml
-dynamic-properties:
[echo] Java version 1.7.0_25, compatibility: 1.4
[echo] JNA version 3.2.7, native 3.2.2
[echo] OpenJDK 64-Bit Server VM (Oracle Corporation, 23.7-b01)
[echo] java.home=/usr/lib/jvm/java-7-openjdk-amd64/jre
[echo] java.library.path=/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib:/home/eric/EV3/java/eclipse-luna/configuration/org.eclipse.osgi/332/0/.cp
-setup:
compile:
[javac] /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/build.xml:190: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
javah:
-native-api-check:
[echo] Invalidating native code, new checksum is a7ab385d4333805e72fc2ae274973086
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist
[copy] Copying 1 file to /home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/dist

BUILD FAILED
/home/eric/EV3/java/lejos/git/jna-3.2.7/jnalib/build.xml:329: API for native code has changed. Re-run this build after updating jni.version and jni.md5 in build.xml

Total time: 1 second

What am I doing wrong ? I have no idea of what to put in jni.version and jni.md5 as it is suggested in the final message.

Eric
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Navigator

Postby gloomyandy » Mon Jul 07, 2014 9:15 pm

Are you building things via eclipse or from the command line?

Your first problem looks like you are trying to use an old JRE with a new JDK. What does java --version report?

What is the selected target for the jna build?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby gloomyandy » Mon Jul 07, 2014 9:24 pm

Also, if you are trying to build the jna code then that sounds like you are trying to build the git master version. Note that you will not be able to run that code unless you have updated to the associated git master sd card. If none of this makes sense then you may be better of checking out the source for the version that matches your sd card setup.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby epascual » Mon Jul 07, 2014 10:23 pm

gloomyandy wrote:Are you building things via eclipse or from the command line?
Ant build from Eclipse. After having found your post, I tried from CLI and it works fine. These IDEs are sometimes a source of problems, since they do a lot of stuff under the hood to ease your life, but it sometimes happens that they make it more complicated at the end of the day ;)

gloomyandy wrote:Your first problem looks like you are trying to use an old JRE with a new JDK. What does java --version report?
Was my guess too, and I checked the Java and JDK versions. They are coherent. Anyway, it works from the CLI

gloomyandy wrote:What is the selected target for the jna build?
ant jar
Also, if you are trying to build the jna code then that sounds like you are trying to build the git master version. Note that you will not be able to run that code unless you have updated to the associated git master sd card.
If this means replacing ev3classes.jar, dbusjava.jar and jnalib.jar, I already did this when experimenting with the previous versions of leJos, except for jnalib.jar which I have never replaced at that time (do I have to or did I misunderstand some error message I got about it when trying the first compilations ?)

Eric
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Navigator

Postby gloomyandy » Mon Jul 07, 2014 10:30 pm

As I said before if you are trying to use git master you must use the associated sd card image, there are changes to the binary interface to the kernel modules and to the kernel for things, like sound and i2c. You can not simply update the .jar files and still have things work.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby gloomyandy » Mon Jul 07, 2014 10:40 pm

Eclipse probably comes with its own version of the JRE, this may need to be updated.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby epascual » Mon Jul 07, 2014 10:47 pm

gloomyandy wrote:As I said before if you are trying to use git master you must use the associated sd card image, there are changes to the binary interface to the kernel modules and to the kernel for things, like sound and i2c. You can not simply update the .jar files and still have things work.
OK, I understand.

What would you suggest me ? Working with the master or with the version I installed on the SD card ? I guess that the master has more chances to include fixes.

Eclipse probably comes with its own version of the JRE, this may need to be updated.
It does, but it is possible to select other ones that are installed and make them be used by the toolchain (what I did). Anyway, this is not that important, now that the CLI build works for ev3classes and dbusjava. I just need to solve the jna problem. There's still something not completely clear for me here : I understand the problem of SD content mismatch which can lead to execution problem. But how does it interfere at compile time ?
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Navigator

Postby gloomyandy » Tue Jul 08, 2014 2:16 am

I didn't say it did cause a problem at compile time. But there is little point in you fixing the jna issues if you do not have an SD card setup that can run the code you are compiling. Also you do not need to compile jna in versions earlier than the current git master.

You really should fix your eclipse setup. All of the leJOS developers build using eclipse (including via ant scripts) and not doing so just makes it harder for us to offer help, the eclipse config files also contain setup for ant builds that configure the ant targets, it may be that you are trying to build the wrong jna ant target. Look at the snapshot build files for details of the correct ant target to use. The snapshot build will build all of the various sub-components, needed for a release.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby epascual » Tue Jul 08, 2014 8:41 pm

With respect to Eclipse, I don't know what can be wrong since it is a fresh install reserved for leJOS, and there is nothing else in the middle.

As you suggested before, I'll replace the current repo I've cloned by the 0.8.1-beta one instead of master. I'll keep you informed.

Thanks for your support.

Eric
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Navigator

Postby gloomyandy » Tue Jul 08, 2014 9:14 pm

What OS and what version of Eclipse?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby epascual » Tue Jul 08, 2014 9:49 pm

OS: Linux Ubuntu 12.04
Eclipse: Luna

I finally succeed in having it up and running : current repo zapped, cloned again and finally branch 0.0.1-beta checkout-ed.

There was just a small glitch with the build.xml of ev3classes project insisting and using Java 6, although the one of dbusjava uses the right one (i.e. Java 7). I finally found were this is specified and fixed it (some run configuration for Ant, which seemed to be project specific). This is this kind of behaviors which makes me dislike IDEs like Eclipse even after having used them for a while : there are tons of check-boxes and choices buried in tons of dialog boxes and hierarchical menus and you sometimes waste your time hunting for them. Just like with MS Office programs (which I don't use neither !!!)

When running the same tasks directly from the CLI with the good old "ant xxx" command, I never have such troubles, and re-doing the action is just a matter of 2 keystokes : "up-arrow" to recall the last ant command and "return" to start it. No dozens of clicks and double-clicks here and there. Anyway, this is a matter or taste.

A final question : when working with a cloned leJos repo, how are you supposed to setup the EV3_HOME environment variable used by the leJOS EV3 project nature ? Since the path to jars is not the same as with the packaged version, build path does not find them. The solution seems to be referencing the ev3classes project in your app project. Is this the right way ?
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Navigator

Postby gloomyandy » Tue Jul 08, 2014 10:53 pm

I think most developers will build the snapshot project and them make eclipse reference that.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Navigator

Postby epascual » Tue Jul 08, 2014 11:12 pm

OK I understand. I didn't pay attention to this project before.

For iterating on modifications of ev3classes for instance, adding ev3classes as a referenced project seems to make the round trip faster.
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Previous

Return to EV3 Software

Who is online

Users browsing this forum: Google [Bot] and 27 guests

more stuff