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

Unable to access some topics in Matlab

asked 2017-03-13 12:59:34 -0500

fadiak gravatar image

I am completely new to ROSbag. I have a bag file and would like to work with it in MATLAB.

I canview the messages for one of my topics using:

>> bag = rosbag('HMB_1.bag');
>> bagselect_c = select(bag, 'Topic', '/center_camera/image_color/compressed');
>> msgs_c = readMessages(bagselect_c);

when I try to do the same for another topic, I get an error:

>> bagselect= select(bag, 'Topic', '/vehicle/steering_report');
>> msgstemp = readMessages(bagselect);
Error using robotics.ros.BagSelection/deserializeMessages (line 445)
Java exception occurred:
org.ros.exception.RosMessageRuntimeException: java.lang.ClassNotFoundException: dbw_mkz_msgs.SteeringReport

    at org.ros.internal.message.definition.MessageDefinitionReflectionProvider.get(

    at org.ros.internal.message.DefaultMessageFactory.newFromType(

    at org.ros.internal.message.DefaultMessageDeserializer.deserialize(

Caused by: java.lang.ClassNotFoundException: dbw_mkz_msgs.SteeringReport

    at$ Source)

    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(

    ... 2 more

Error in robotics.ros.BagSelection/readMessages (line 195)
            msgs = obj.deserializeMessages(obj.MessageList, rows);

I'm not sure how to troubleshoot

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-07-25 18:40:12 -0500

snehesh gravatar image

You need to use custom ros message support. You have to use rosgenmsg.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-03-13 12:59:34 -0500

Seen: 751 times

Last updated: Jul 25 '17