Ask Your Question
0

Rosjava import defaultnodefactory fails

asked 2012-01-16 05:37:19 -0500

KoenBuys gravatar image

Hi all, I've checked out rosjava from mercurial in my ros package path. It complains with the import statement of DefaultNodeFactory:

compile:
      [javac] /home/u0062536/ros/raw/kb-home-pkg/HA_android_GUI/build.xml:26: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
      [javac] Compiling 2 source files to /home/u0062536/ros/raw/kb-home-pkg/HA_android_GUI/build
      [javac] /home/u0062536/ros/raw/kb-home-pkg/HA_android_GUI/src/rostest.java:6: cannot find symbol
      [javac] symbol  : class DefaultNodeFactory
      [javac] location: package org.ros.node
      [javac] import org.ros.node.DefaultNodeFactory;
      [javac]                    ^
      [javac] 1 error

  BUILD FAILED

This on a easy java code example:

import java.net.URI;
import java.net.URISyntaxException;
import org.ros.address.InetAddressFactory;
import org.ros.node.Node;
import org.ros.node.NodeConfiguration;
import org.ros.node.DefaultNodeFactory;

/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class RosTestApp {
    public static void main(String[] args) {
        System.out.println("Hello World, trying to get ROS to work, with NF!"); // Display the string.
    }
}

If the DefaultNodeFactory is commented out the code does work perfect. Rosjava compiles fine and is added in the manifest of this package. The goal of the package is to build a android app that uses rosjava to connect to a roscore.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-01-16 19:35:48 -0500

damonkohler gravatar image

The wiki documentation is for the released version of rosjava. If you're using rosjava from head, then you should start with the rosjava_tutorial_pubsub package or the android_tutorial_pubsub package.

edit flag offensive delete link more

Comments

I've tried the http://www.ros.org/wiki/rosjava/Tutorials code which works. As my goal is to write a publisher on android tablet I've tried to check out the http://www.ros.org/wiki/android_core code, however this one doesn't compile. When I do rosmake --rosdep-install --pre-clean I get an error.
KoenBuys gravatar image KoenBuys  ( 2012-01-21 21:27:27 -0500 )edit
roslib.packages.InvalidROSPkgException: Cannot locate installation of package parsec_msgs: [rospack] couldn't find package [parsec_msgs]. ROS_ROOT[/opt/ros/electric/ros] ROS_PACKAGE_PATH[/home/u0062536/ros:/opt/ros/electric/stacks] However on the ros website this package is unknown.
KoenBuys gravatar image KoenBuys  ( 2012-01-21 21:28:56 -0500 )edit
That's a bug. Instead of trying to build the whole stack, build the packages individually. The parsec_msgs package is only a dependency of android_rosserial
damonkohler gravatar image damonkohler  ( 2012-01-23 01:20:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-01-16 05:37:19 -0500

Seen: 270 times

Last updated: Jan 16 '12