rosgenmsg
Generate custom messages from ROS definitions
Description
rosgenmsg(
generates ROS
custom messages by reading ROS custom messages, service definitions, and action
definitions in the specified folder path. The function folder must contain one
or more ROS package folders. These packages contain the message definitions in
folderpath
).msg
files, service definitions in
.srv
files, and action definitions in
.action
files.
After you generate the custom messages, you can send and receive them in
MATLAB® like all the other supported messages. You can create these
messages using rosmessage
or view the list of
messages by entering rosmsg list
at the MATLAB Command
Window.
Note
To generate custom messages for ROS, you must build the ROS packages. This process requires you to have access to CMake software and a C++ compiler for your platform. For more information, see ROS Toolbox System Requirements
With every new release of MATLAB, you must regenerate the custom messages from the ROS definitions.
rosgenmsg(
specifies additional options using one or more name-value arguments.folderpath
,Name=Value
)
Examples
Input Arguments
Limitations
MATLAB
Compiler™ software do not support ROS custom messages and the rosgenmsg
function.
Tips
During the Microsoft® Visual Studio® installation, ensure that you select Desktop development with C++ workload. This installs the MSVC compiler and all necessary dependencies required to generate custom messages.
Ensure that the path to the custom message folder does not exceed 64 characters.
Verify that the python environment configuration is correct. For more information, see ROS Toolbox System Requirements.
Version History
Introduced in R2019b