How can I create standalone application while using Robotics System Toolbox's rosgenmsg function?

3 vues (au cours des 30 derniers jours)
Hi all!
I've written a script that uses Robotics Systems Toolbox, I've created custom ROS messages evertything works fine. I want to create an executable from this script in order to call it from command line but Matlab Compiler does not support rosgenmsg function. So my question is, is there a possible work around this, or is there an alternative to rosgenmsg to create custom ros messages?
Thanks for your answers!
EDİT: I'm using ubuntu 16.04 LTS and matlab 2017b

Réponse acceptée

Josh Chen
Josh Chen le 26 Oct 2020
Hello Dandanakan,
It is possible to use custom ROS messages in MATLAB Compiler with the following workaround. Since "rosgenmsg" is not supported for MATLAB Compiler, you can manually add the generated "jar" and "msggen" folder to the "Files required for your application to run" section when generating MATLAB Runtime application.
Taking this shipped document as an example. After running "rosgenmsg", you will have the following folder layout:
custom_msgs
-A
-...
matlab_gen
|- build
|- jar
|- msggen
When you run the "Application Compiler" app for the example_fun.m function, you need to add the "jar" and "msggen" folders under 'Files requried for your application to run". The "jar" folder contains the Java files for the custom message package and the "msggen" folder contains the necessary MATLAB files.
I have the following MATLAB code in the "example_fun.m" file as an example:
which('B.Standalone')
rosmessage('B/Standalone')
Hope this helps,
-Josh

Plus de réponses (0)

Catégories

En savoir plus sur Publishers and Subscribers dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by