I want Matlab to subscribe to a ros custom message, called Position_EE.msg and defined in a msg folder simply as
string convergencegeometry_msgs/Point p
The package.xml (on the same level of msg folder) contains the following lines
<build_depend>message_generation</build_depend> <build_export_depend>message_generation</build_export_depend> <exec_depend>message_runtime</exec_depend> <buildtool_depend>catkin</buildtool_depend> <build_depend>rospy</build_depend> <build_export_depend>rospy</build_export_depend> <exec_depend>rospy</exec_depend> <build_depend>message_generation</build_depend> <depend>geometry_msgs</depend> <depend>std_msgs</depend>
When subscribing to a standard msg (such as sensor_msgs::JointState) I find no problem. I think it is because Matlab has first to convert the message with rosgenmsg, but when I run it the following error occurs:
rosgenmsg('~/Scrivania/catkin_ws/src/') Checking subfolder "gcode_pkg" for custom messages. Checking subfolder "joint_pkg" for custom messages. Building custom message files for the following packages: gcode_pkg joint_pkg :rosjava_messages is spawning subprojects: [gcode_pkg, joint_pkg]Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties.Deprecated dynamic property: "mavenRepository" on "org.ros.gradle_plugins.RosPluginExtension_Decorated@31edeac", value: "".Deprecated dynamic property "mavenRepository" created in multiple locations.:gcode_pkg:bugfixtask:gcode_pkg:generateSources:gcode_pkg:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6/home/matteo/Scrivania/catkin_ws/src/matlab_gen/build/rosjava_build/gcode_pkg/build/generated-src/gcode_pkg/Position_EE.java:8: error: package std_msgs does not exist std_msgs.String getConvergence(); ^/home/matteo/Scrivania/catkin_ws/src/matlab_gen/build/rosjava_build/gcode_pkg/build/generated-src/gcode_pkg/Position_EE.java:9: error: package std_msgs does not exist void setConvergence(std_msgs.String value); ^/home/matteo/Scrivania/catkin_ws/src/matlab_gen/build/rosjava_build/gcode_pkg/build/generated-src/gcode_pkg/Position_EE.java:10: error: package geometry_msgs does not exist geometry_msgs.Point getP(); ^/home/matteo/Scrivania/catkin_ws/src/matlab_gen/build/rosjava_build/gcode_pkg/build/generated-src/gcode_pkg/Position_EE.java:11: error: package geometry_msgs does not exist void setP(geometry_msgs.Point value); ^4 errors1 warning FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':gcode_pkg:compileJava'.> Compilation failed; see the compiler error output for details.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILEDTotal time: 15.309 secsAn error occurred while building custom messages. See the full error message above.Possible reasons for the error:1. The msg or srv files may have syntax errors.2. The dependencies on other message packages may not be declared correctly in the build_depends tags in thepackage.xml.3. Messages packages declared as dependencies may not be available.4. The custom message packages may be missing a build dependency on "message_generation".
I've been reading some similar question, but no answer would fix my problem. Any suggestions?
Thanks in advance
Best Answer