Main Content

Blank Message

Create blank ROS 2 message using specified message type

Since R2019b

  • Blank Message ROS 2 block

ROS Toolbox / ROS 2


The Blank Message block creates a Simulink® nonvirtual bus corresponding to the selected ROS message type. The block creates ROS message buses that work with Publish, Subscribe and Call Service blocks.



expand all

Blank ROS 2 message, returned as a non-virtual bus. To specify the type of ROS message, use the Type parameter. All elements of the bus are initialized to 0. The lengths of the variable-length arrays are also initialized to 0.

Data Types: bus


expand all

Class of ROS 2 message, specified as Message, Service Request, or Service Response. For basic publishing and subscribing, use the Message class. To create a service request message for Call Service input, use the Service Request class.

ROS 2 message type, specified as a character vector or a dialog box selection. Use Select to select from a list of supported ROS messages. The list of messages given depends on the Class of message you select.

Interval between outputs, specified as a numeric scalar. The default value indicates that the block output never changes. Using this value speeds simulation by eliminating the need to recompute the block output. Otherwise, the block outputs a new blank message at each interval of Sample time.

For more information, see Specify Sample Time (Simulink).

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2019b