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

Ros Matlab i/o and /tf

asked 2015-02-13 10:38:52 -0500

kpax77 gravatar image

updated 2015-02-13 11:50:39 -0500

gvdhoorn gravatar image

Hello everybody, I try to use the topic /tf in order to obtain the pose of the end-effector of the PR2. Unfortunately I can't subscribe to the topic, I have this error:

>SubTf = rosmatlab.subscriber('/tf', 'tf/tfMessage',100,node);

Error using rosmatlab.node/addSubscriber (line 661)
Java exception occurred:
org.ros.exception.RosMessageRuntimeException: java.lang.ClassNotFoundException: tf.tfMessage
    at org.ros.internal.message.definition.MessageDefinitionReflectionProvider.get(MessageDefinitionReflectionProvider.java:58)
    at org.ros.internal.message.Md5Generator.generate(Md5Generator.java:44)
    at org.ros.internal.message.topic.TopicDescriptionFactory.newFromType(TopicDescriptionFactory.java:36)
    at org.ros.internal.node.DefaultNode.newSubscriber(DefaultNode.java:286)
    at org.ros.internal.node.DefaultNode.newSubscriber(DefaultNode.java:297)
Caused by: java.lang.ClassNotFoundException: tf.tfMessage
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.ros.internal.message.definition.MessageDefinitionReflectionProvider.get(MessageDefinitionReflectionProvider.java:54)
    ... 4 more

Error in rosmatlab.subscriber (line 38)
                sub = node.addSubscriber(topicName,topicMessageType,bufferLimit);

If you have any idea to resolve it, it would be great.

edit retag flag offensive close merge delete

Comments

did you solve this problem?

Andromeda gravatar image Andromeda  ( 2015-02-18 03:52:48 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-02-26 05:29:14 -0500

kpax77 gravatar image

updated 2015-02-26 05:50:44 -0500

I answer my own question. Finally the problem is that tfMessage is not part of the standard roscore distribution. So you have to add it in the ROSMatlab path.

The procedure is the following: * Download the tf.jar here: https://github.com/rosjava/rosjava_mv... Don't forget to download it in 'raw'. * Add the jar files to \toolbox\psp\rosmatlab\jars * Edit <\MATLAB>\toolbox\local\classpath.txt by adding the full path to the jar file above the line “# ROS-MATLAB-END” * Restart MATLAB.

And it should work.

edit flag offensive delete link more

Comments

And now if you know on an example how to use /tf in order to obtain the position of a joint, don't hesitate.

kpax77 gravatar image kpax77  ( 2015-02-27 05:13:40 -0500 )edit

Question Tools

Stats

Asked: 2015-02-13 10:38:52 -0500

Seen: 455 times

Last updated: Feb 26 '15