How to setup ROS with 'custom' messages in current 2019b

4 Ansichten (letzte 30 Tage)
Mark Tappe
Mark Tappe am 20 Nov. 2019
Beantwortet: Mark Tappe am 21 Nov. 2019
Hey
I've got some questions about setting up ROS correctly... I had everything running two months ago on my laptop but now with a new computer the set-up it is not working.
My main question is about the
rosgenmsg(folderpath)
command which is offered by the ROS Toolbox interface for ROS Custom MessagesROS Toolbox interface for ROS Custom Messages. I downloaded the add-on and started to run the command on my new Ubuntu 16.04 Matlab 2019b computer but ran into errors. (Just to mention on my old Windows 10 Matlab R2018a this package can be converted)
>> rosgenmsg('/home/brain/Matlab/ROS_Messages/include_mavros/')
Checking subfolder "mavros_msgs" for custom messages.
Building custom message files for the following packages:
mavros_msgs
:rosjava_messages is spawning subprojects: [mavros_msgs]
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@6a44619", value: "".
:mavros_msgs:bugfixtask
:mavros_msgs:generateSources
:mavros_msgs:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
/home/brain/Matlab/ROS_Messages/include_mavros/matlab_gen/build/rosjava_build/mavros_msgs/build/generated-src/mavros_msgs/ADSBVehicle.java:37: error: package std_msgs does not exist
std_msgs.Header getHeader();
^
The last error about the std_msgs.Header can not be resolved, appears multiple times for all geometry_msgs and std_msgs.
Both are known messages for matlab -> verified this by
rosmsg list
I even build the std_msgs and geoemetry_msgs via the same command but this did not solve the problem...
The other cause might be:
:mavros_msgs:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
I sadly don't know what I can fix here - just for reference my Java-Version is:
'Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode'
Do I now need to downgrade? And to which version.... Compared to my Laptop where everything is running (Java 1.8_144-b01).
And yeah I referred a few time to my Laptop where I can do all of this, so I thought about why not use the rosgenmsg-comamnd on the laptop and copy/paste the resulting matlab_gen folder to my new system... I tried but it didn't work. I don't know whether windows <--> linux is the problem there or why it failed.
I followed all steps mentioned by the official documentation ( https://de.mathworks.com/help/ros/ug/ros-custom-message-support.html ):
After the rosgenmsg function creates these files, you must add the files to the Java class path and the MATLAB path before you can use the custom messages. These steps are given as prompts in the MATLAB Command Window:
  1. Add location of files to javaclasspath.txt: Add the specified paths as new lines of text in the javaclasspath.txt file. If this file does not exist, a message in the command window prompts you to create it. This text file defines the static class path for Java classes. For more information on the Java class path, see Java Class Path (MATLAB).
  2. Add location of class files to MATLAB path: Use addpath to add new locations of files with the .m extension to the MATLAB path and use savepath to save these changes.
  3. Restart MATLAB and verify messages are available: After restarting MATLAB, call rosmsg list or rosmessage to check that you can use the messages as expected.
Checking my javaclasspath --> /home/brain/Matlab/ROS_Messages/Matlab_messages/matlab_gen/jar/mavros_msgs-0.29.2.jar
Checking via path --> /home/brain/Matlab/ROS_Messages/Matlab_messages/matlab_gen/msggen
(this folderpath varies a little bit from the one mentioned at the beginning I created multiple folders for testing this - but nothing worked out)
I appreciate your help...
Kind regards Mark

Akzeptierte Antwort

Mark Tappe
Mark Tappe am 21 Nov. 2019
I made all new today and it worked out... It seems to be just an problem with the dependencies.
The solution was to add both dependencies
<depend>std_msgs</depend>
<build_depend>std_msgs</build_depend>
and then it was fine.
Still don't know why the folders which worked on Windows didn't run on Linux Matlab or why the precompiled .jars and the pathes didn't work out but as long it is running now - I'm happy.

Weitere Antworten (0)

Kategorien

Mehr zu Custom Message Support finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by