# Building nxt_lejos fails finding rosjava.mk

Hi everybody,

I'm currently trying to connect Lego Mindstorms NXT to ROS via rosjava as described here, but the installation fails at nxt_lejos_lcp_proxy with

I believe this is due to rosjava now using gradle instead of the previous rosmake driven build process, but unfortunately I've got no idea how to fix this. I don't want to revert back to an earlier version of rosjava.

Is it possible to use the current rosjava with nxt_lejos?

Best regards, Andreas

edit retag close merge delete

Sort by » oldest newest most voted

You can get a snapshot build from the SVN snapshot directory which will have getTurnRate in it. However, nxt_lejos_lcp_proxy does not work very well, and I may remove it. getTurnRate was a mistake and I will get rid of it some time. You are better off running nxt_lejos_proxy, which should work with lejos 0.9.1. This requires that you run the ROSResponder sample on the NXT. It works quite well for me. You will need to get ROSResponder from SVN. I need to find a solution to the hard-coded dependencies in the gradle build file. I am currently waiting for a response of my "rosjava message serialization problems" query before I do further work on nxt_lejos as it is stopping odometry and imu messages working properly, which means that parts of the navigation stack do not work.

more

Ignoring nxt_lejos_lcp_proxy in nxt_lejos/settings.gradle did the trick for me :) Thank you very much!

( 2012-08-28 07:41:39 -0600 )edit

The problem were the pathes of the dependencies, e.g.:

dependencies {
compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
compile fileTree (dir: '/home/lejosdev/workspace/snapshot/lib/pc', includes: ['*.jar'])
compile fileTree (dir: '/home/lejosdev/workspace/snapshot/lib/pc/3rdparty', includes: ['*.jar'])
}


should be corrected to match the path you've installed lejos (line 3) into and the path you've checked out nxt_lejos into (line 4).

The build.gradle files in nxt_lejos_proxy and nxt_lejos_map_server have to be updated accordingly.

Maybe this should be noted in the installation instructions.

The remaining problem is, that the DifferentialNavigationSystem references DifferentialPilot.getTurnRate() which isn't supposed to exist, according to 0.9.1beta Javadoc (nor leJOS_NXJ_0.9.1beta-3_source.tar.gz.

user@ubuntu:~/ros_workspace/nxt_lejos$gradle installApp > Building > :nxt_lejos_lcp_proxy:compileJava > Resolving dependencies ':nxt_lej:nxt_lejos_lcp_proxy:compileJava DifferentialNavigationSystem.java:287: cannot find symbol symbol : method getTurnRate() location: class lejos.robotics.navigation.DifferentialPilot od.getTwist().getTwist().getAngular().setZ((moving ? Math.toRadians(df.getTurnRate()): 0)); 1 error FAILURE: Build failed with an exception.  Is there something like a nightly I could try? Thanks in advance! Best regards, Andreas more Unfortunately, this doesn't seem to wokr for me. I've installed leJOS following the tutorial and was able to run the HelloWorld program on the brick. Building nxt_lejos as described here fails at compilation. user@ubuntu:~/ros_workspace/nxt_lejos$ gradle installApp
> Building > :nxt_lejos_lcp_proxy:compileJava > Resolving dependencies ':nxt_lej:nxt_lejos_lcp_proxy:compileJava
LCPProxy.java:13: package lejos.nxt does not exist
import lejos.nxt.Sound;
^
LCPProxy.java:39: package nxt_lejos_msgs does not exist
import nxt_lejos_msgs.DNSCommand;
^
LCPProxy.java:40: package nxt_lejos_msgs does not exist
import nxt_lejos_msgs.JointPosition;

...

LCPProxy.java:55: package com.esotericsoftware.yamlbeans does not exist
^

DifferentialNavigationSystem.java:3: package lejos.nxt does not exist
import lejos.nxt.Motor;
^
DifferentialNavigationSystem.java:4: package lejos.robotics does not exist
import lejos.robotics.RegulatedMotor;
^
DifferentialNavigationSystem.java:5: package lejos.robotics.localization does not exist
import lejos.robotics.localization.OdometryPoseProvider;

...

SoundSensor.java:3: package lejos.nxt does not exist
import lejos.nxt.SensorPort;


etc.

I suppose this is partially because you are missing the message representations in Java. Therefore one needs to reinstall rosjava_messages after checking out nxt_lejos into the ros workspace and the gradle nxt_lejos build should be able to find the nxt_lejos_msgs generated by rosjava.

Plus: There are hard coded pathes in */build.gradle files, e.g. (in nxt_lejos_proxy/build.gradle):

dependencies {
compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
compile fileTree (dir: '/home/lejosdev/workspace/snapshot/lib/pc', includes: ['*.jar'])
compile fileTree (dir: '/home/lejosdev/workspace/snapshot/lib/pc/3rdparty', includes: ['*.jar'])
}


Which doesn't seem proper either.

Did I misconfigure something?

Best regards, Andreas

more

Thank you!

more

more