This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

rosgenmsg

Generate custom messages from ROS definitions

Syntax

rosgenmsg(folderpath)

Description

example

rosgenmsg(folderpath) generates ROS custom messages in MATLAB® by reading ROS custom message and service definitions in the specified folder path. The function expects ROS package folders inside the folder path. These packages contain the message definitions in .msg files and the service definitions in .srv files. Also, the packages require a package.xml file to define its contents.

After calling this function, you can send and receive your custom messages in MATLAB like all other supported messages. You can create these messages using rosmessage or view the list of messages by calling rosmsg list.

Note

You must install the Robotics System Toolbox Interface for ROS Custom Messages add-on using roboticsAddons to use this function.

Examples

collapse all

After you install the support package and prepare your custom message package folder, specify the folder path and call rosgenmsg.

folderpath = "C:/Users/user1/Documents/robot_custom_msg/";
rosgenmsg(folderpath)

Input Arguments

collapse all

Path to package folders, specified as a string scalar or character vector. These folders contain message definitions in .msg files and the service definitions in .srv files. Also, the packages require a package.xml file to define its contents.

Limitations

  • You must install the Robotics System Toolbox Interface for ROS Custom Messages add-on using roboticsAddons to use this function.

Introduced in R2015a