I completed the getting started examples and also did some publishing/subscribing from matlab to standard ros nodes, but only for std_msgs. Now I want to use a custom message (foo_msg) from one of my package (foo), if I use rosmsg in the shell I can see it.
But if, in matlab I try to create publsiher, for a matlab node already created, typing : publisher = rosmatlab.publisher('TOPIC', 'foo/foo_msg', node); I get :
Error using rosmatlab.node/addPublisher (line 543) Java exception occurred: org.ros.exception.RosMessageRuntimeException: java.lang.ClassNotFoundException: foo.foo_msg 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.newPublisher(DefaultNode.java:270) at org.ros.internal.node.DefaultNode.newPublisher(DefaultNode.java:280) Caused by: java.lang.ClassNotFoundException: foo.foo_msg 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
Therefore the publsiher is not created, the same appends for the subscriber.
Does anyone know how to add customs messages ?
Thanks, Nicolas
Best Answer