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

rosjava tutorial 4.2 failed

asked 2017-12-06 07:29:16 -0500

ramekabi gravatar image

updated 2017-12-06 12:04:04 -0500

http://wiki.ros.org/rosjava_build_too... I tried [4.2 Library Project (Jar)]. error by catkin_make

ubuntu@ubuntu:~$ cd src/rosjava_catkin_package_a
ubuntu@ubuntu:~/src/rosjava_catkin_package_a$ catkin_create_rosjava_library_project rosjava_gradle_subproject_a
ubuntu@ubuntu:~/src/rosjava_catkin_package_a$ cd ../..
ubuntu@ubuntu:~$ catkin_make
Base path: /home/ubuntu
Source space: /home/ubuntu/src
Build space: /home/ubuntu/build
Devel space: /home/ubuntu/devel
Install space: /home/ubuntu/install
####
#### Running command: "make cmake_check_build_system" in "/home/ubuntu/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/devel
-- Using CMAKE_PREFIX_PATH: /home/ubuntu/rosjava/devel;/opt/ros/kinetic
-- This workspace overlays: /home/ubuntu/rosjava/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - rosjava_catkin_package_a
-- ~~ - rosjava_catkin_package_b
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'rosjava_catkin_package_a'
-- ==> add_subdirectory(rosjava_catkin_package_a)
-- +++ processing catkin package: 'rosjava_catkin_package_b'
-- ==> add_subdirectory(rosjava_catkin_package_b)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/build
####
#### Running command: "make -j4 -l4" in "/home/ubuntu/build"
####
[100%] Gradling tasks for rosjava_catkin_package_a
warning: [options] bootstrap class path not set in conjunction with -source 1.7
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:19: error: package org.ros.concurrent does not exist
import org.ros.concurrent.CancellableLoop;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:20: error: package org.ros.namespace does not exist
import org.ros.namespace.GraphName;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:21: error: package org.ros.node does not exist
import org.ros.node.AbstractNodeMain;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:22: error: package org.ros.node does not exist
import org.ros.node.ConnectedNode;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:23: error: package org.ros.node does not exist
import org.ros.node.NodeMain;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:24: error: package org.ros.node.topic does not exist
import org.ros.node.topic.Publisher;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:29: error: cannot find symbol
public class Talker extends AbstractNodeMain {
^
symbol: class AbstractNodeMain
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:32: error: cannot find symbol
public GraphName getDefaultNodeName() {
^
symbol: class GraphName
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:37: error: cannot find symbol
public void onStart(final ConnectedNode connectedNode) {
^
symbol: class ConnectedNode
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:19: error: package org.apache.commons.logging does not exist
import org.apache.commons.logging.Log;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener ...
(more)
edit retag flag offensive close merge delete

Comments

Did you do step 4.1 before 4.2, or did you go straight to 4.2? I can't reproduce that on my side, but the error seems to be that catkin didn't find the core dependencies. That shouldn't happen after sourcing ~/rosjava/devel/setup.bash (or wherever you installed rosjava)

jubeira gravatar image jubeira  ( 2017-12-06 09:57:23 -0500 )edit

I did 4.1 before 4.2 .
And I did [source ~/rosjava/devel/setup.bash].

ramekabi gravatar image ramekabi  ( 2017-12-06 12:03:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-12-06 12:25:56 -0500

jubeira gravatar image

You are using your home folder as workspace; that doesn't sound right. In the tutorial it's implicit, but in ROS you usually place the src inside a workspace folder.

So create a workspace folder where you place everything before proceeding. You should create the packages inside something like ~/my_rosjava_ws/src, and not just ~/src.

Let me know if it works that way; maybe that tutorial needs this clarification.

edit flag offensive delete link more

Comments

I tried tutorial that created a workspace. But, same error occurred. By the way, I use ROS on the RaspberryPi3. Is this the cause?

ramekabi gravatar image ramekabi  ( 2017-12-06 13:39:11 -0500 )edit

when you source your rosjava workspace, all those classes should be available for you. Go to ~/rosjava/devel/share/maven. Do you see folders with JAR files with the artifacts for rosjava_core?

jubeira gravatar image jubeira  ( 2017-12-07 06:11:19 -0500 )edit

Sorry, I cannot understand what you say. Please tell me a command that I should do.
ubuntu@ubuntu:~/rosjava/devel/share/maven/org/ros$ ls
rosjava_bootstrap rosjava_core rosjava_messages

ramekabi gravatar image ramekabi  ( 2017-12-09 17:45:16 -0500 )edit

Sorry, I cannot understand what you say. Please tell me a command that I should do.

ubuntu@ubuntu:~/rosjava/devel/share/maven/org/ros$ ls
rosjava_bootstrap rosjava_core rosjava_messages

ramekabi gravatar image ramekabi  ( 2017-12-09 17:45:17 -0500 )edit

It's a bit hard to tell what your problem is exactly. Does this tutorial http://wiki.ros.org/rosjava_build_too... (creating publisher/ subscriber) work for you?

jubeira gravatar image jubeira  ( 2017-12-11 07:16:01 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-12-06 07:29:16 -0500

Seen: 548 times

Last updated: Dec 06 '17