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

13 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Josh Chen
Josh Chen il 26 Ott 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

Più risposte (0)

Categorie

Scopri di più su Network Connection and Exploration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by