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

2 ビュー (過去 30 日間)
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

採用された回答

Josh Chen
Josh Chen 2020 年 10 月 26 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCustom Message Support についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by