ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to set relative paths in the node <rosjava-pathelement> included in a manifest.xml for ROSJava

asked 2012-01-17 08:49:15 -0500

Currently, I have a package running a solution which uses external java libraries. The solution use external libraries, but I would like to use relative path to the package. With this idea, all libraries would be included in lib folder.

Current solution is this one:

<export>
    <rosjava-src location="src" /> 
    <rosjava-pathelement location="target/" groupId="org.lejos.ros" artifactId="org.lejos.ros.nodes.NXTLoader" version="0.0.1" built="true" />
    <rosjava-pathelement location="/usr/local/lejos/lib/pc/pccomm.jar" />
    <rosjava-pathelement location="/usr/local/lejos/lib/pc/3rdparty/bluecove-gpl.jar" />
    <rosjava-pathelement location="/usr/local/lejos/lib/pc/3rdparty/bluecove.jar" />
    <rosjava-pathelement location="/home/jabrena/ros3/workspace/nxt_lejos_ros/NXTLoader/lib/yamlbeans-1.06.jar" />
</export>

My idea is to describe something similar to this one:

        <rosjava-pathelement location="./lib/pc/pccomm.jar" />
        <rosjava-pathelement location="./lib/bluecove-gpl.jar" />
        <rosjava-pathelement location="./lib/bluecove.jar" />
        <rosjava-pathelement location="./lib/yamlbeans-1.06.jar" />

Is it possible in a alternative way?

Juan Antonio

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2012-01-20 07:03:37 -0500

damonkohler gravatar image

updated 2012-01-20 07:04:15 -0500

If the path is relative, it will be evaluated as relative to the root of the package.

edit flag offensive delete link more

Comments

Hi Damon, I didn't understand your answer. Using the syntax: "<rosjava-pathelement location="${prefix}/lib/pc/pccomm.jar" />" I didn't use relative paths. Does exist another way? Cheers
Juan Antonio Breña Moral gravatar image Juan Antonio Breña Moral  ( 2012-01-20 19:40:52 -0500 )edit
If the path doesn't start with a "/" then it is relative to the root of the ROS package where the manifest.xml lives. For example, if you have /foo/bar/manifest.xml and a location "lib/baz.jar" it will resolve to /foo/bar/lib/baz.jar.
damonkohler gravatar image damonkohler  ( 2012-01-23 01:11:24 -0500 )edit
0

answered 2012-01-17 19:32:06 -0500

Lorenz gravatar image

updated 2012-01-17 19:32:21 -0500

Using ${prefix} should work. It is substituted by the absolute path to your package. Example:

<rosjava-pathelement location="${prefix}/lib/pc/pccomm.jar" />
edit flag offensive delete link more

Comments

I'm having the same issue and using ${prefix} results in /my/path/${prefix}/myjar.jar being appended to my ros.properties instead of /my/path/myjar.jar. Why wouldn't ${prefix} be parsed properly like it is with cpp exports?
JeffRousseau gravatar image JeffRousseau  ( 2012-01-18 05:12:51 -0500 )edit
Hi Lorenz, I tested your lidea, but I have the same problem than Jeff. The expression ${prefix} doesn't run. Any alternative?
Juan Antonio Breña Moral gravatar image Juan Antonio Breña Moral  ( 2012-01-18 10:06:39 -0500 )edit
I see the problem. The reason why this doesn't work is that rosjava doesn't use rospack but another script that doesn't understand ${prefix} path elements. But as I understand it, the path element locations should always be relative to the package, at least according to the other rosjava packages.
Lorenz gravatar image Lorenz  ( 2012-01-18 19:25:47 -0500 )edit

Question Tools

Stats

Asked: 2012-01-17 08:49:15 -0500

Seen: 610 times

Last updated: Jan 20 '12