Ask Your Question

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(
    at org.ros.internal.message.Md5Generator.generate(
    at org.ros.internal.message.topic.TopicDescriptionFactory.newFromType(
    at org.ros.internal.node.DefaultNode.newSubscriber(
    at org.ros.internal.node.DefaultNode.newSubscriber(
Caused by: java.lang.ClassNotFoundException: tf.tfMessage
    at$ Source)
    at Method)
    at 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(
    ... 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


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

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: 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


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

Your Answer

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

Add Answer

Question Tools


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

Seen: 372 times

Last updated: Feb 26 '15