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 CenterFile Exchange 中查找有关 Custom Message Support 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by