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

Current ROSJAVA message types

asked 2011-10-25 07:32:25 -0600

morrowsend gravatar image

I am attempting to run the LIstener/Talker example with a Range sensor_msg instead of the string message, but I get the following error:

Oct 25, 2011 2:44:09 PM org.ros.internal.node.RosoutLogger fatal
SEVERE: org.ros.exception.RosRuntimeException: org.ros.exception.RosRuntimeException: org.ros.exception.RosRuntimeException: java.lang.ClassNotFoundException: org.ros.message.sensor_msg.Range

I assume this is because range Sensor_msgs are not yet implemented? Is there a webpage that shows which message types are curently implemented?

I've also changed the talker code to be more like the code on the rosJava msg page which uses a messageFactory, but that gives me the same error. Any ideas?

--I've also downloaded an hg clone of the project, but I can't find Range sensors in the source their anywhere.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2011-10-25 09:48:33 -0600

Lorenz gravatar image

Rosjava message code is auto-generated the same way it is for C++, Python and Lisp. You need to depend on sensor_msgs in your package's manifest.xml file and execute rosmake to get the messages built.

edit flag offensive delete link more

Comments

I already had <depend package="sensor_msgs" /> in my manifest before I ran rosmake, but I ran it again just in case. I still get the same exception.
morrowsend gravatar image morrowsend  ( 2011-10-25 15:35:18 -0600 )edit
Which version of rosjava are you using? That one from deb packages or the dev version from the mercurial repo?
Lorenz gravatar image Lorenz  ( 2011-10-25 18:56:01 -0600 )edit
I'm using the deb pkg. I downloaded the hg version and attempted rosinstall, but no joy. When I am in the rosjava_core dir, and type "rosinstall ." It says "no source install file". I also have the hg version in Eclipse, but can't figure out how to add it to my current project.
morrowsend gravatar image morrowsend  ( 2011-10-26 04:28:47 -0600 )edit
I just d/l the hg version, ran rosmake on it, changed the build path of my project to point to the new jars from hg version, changed the version number on my project so I can tell the difference between changes, ran rosmake on my project again, rebuilt my jar, and reran the file. Same error.
morrowsend gravatar image morrowsend  ( 2011-10-26 05:31:19 -0600 )edit
The message class files and jars should be somewhere in ~/.ros/rosjava. Can you check if you can find them there?
Lorenz gravatar image Lorenz  ( 2011-10-26 20:04:55 -0600 )edit
Yes, all the files are there in ~/.ros/rosjava/build/sensor_msgs/org/ros/message/sensor_msgs. I also attempted installing ros_java in my ~/ros_workspace folder from the HG version, then adding those jars to my package's build path. Still getting the same result.
morrowsend gravatar image morrowsend  ( 2011-10-27 08:07:23 -0600 )edit
0

answered 2012-01-01 03:03:38 -0600

Hi Lorentz, I read your answer and I tryed to update an example.

In manifest file, I added the following line after the line about std_msgs

<depend package="std_msgs" />
<depend package="sensor_msgs" />

Later, I executed rosmake because I thought that rosjava could generate package for sensor_msgs but when I tried to update a Publisher object, I didn't use any object from the package about sensor_msgs.

            Publisher<org.ros.message.std_msgs.String> publisher =
                node.newPublisher("battery", "std_msgs/String");

How to use sensor_msgs with lateset ROSjava? what is the difference between std_msgs and sensor_msgs?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-10-25 07:32:25 -0600

Seen: 1,009 times

Last updated: Jan 01 '12