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

Running rosjava node from launchfile

asked 2012-05-22 04:07:13 -0500

Markus Eich gravatar image

Dear all,

I try to run my rosjava node from within a launchfile. My launchfile looks like this

 <launch>
 <master auto="start"/>
 <node pkg="rosjava_cylinder_reasoner" type="rosjava_cylinder_reasoner"  name="cylinder_reasoner" args="de.dfki.reasoner.Service" 
 respawn="false" output="screen"/>

The problem is that there are two generated wrapper scripts (generated from gradle) which execute the node, one is in build/install/... one is in build/scripts/. Per default roslaunch wants to execute the script in /scripts/ which results in an error because the relative path to lib (the classpath) is not set. The only solution I found so far is to delete the wrapper script from the /build/scripts/ directory. Is there any other solution to point roslaunch to the right wrapper script?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-07-27 11:03:36 -0500

updated 2012-07-27 12:42:29 -0500

I am using the following Makefile in my rosjava package.

SOURCES=$(shell find src/main -name *.java)
PACKAGE=<PACKAGE-NAME>

all: installed

installed: $(SOURCES)
    `rosstack find rosjava_core`/gradlew installApp
    mkdir -p bin
    ln -sf ../build/install/$(PACKAGE)/bin/$(PACKAGE) bin/execute
    chmod a+x bin/$(PACKAGE)
    touch installed rospack_nosubdirs

clean:
    `rosstack find rosjava_core`/gradlew clean
    rm -rf bin installed rospack_nosubdirs

To use this Makefile, you'll have to manually replace PACKAGE-NAME once. You can then use "execute" as the node type.

This solution isn't exactly pretty, but works effectively well. It also allows for rosmake/make to build the package as well. I am also interested if there are any other better solutions around.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-05-22 04:07:13 -0500

Seen: 454 times

Last updated: Jul 27 '12