MATLAB Examples

Get and Set ROS Parameters

This model gets and sets ROS parameters using Simulink®. This example illustrates how to use ROS parameters in Simulink and to share data over the ROS network. An integer value is set as a parameter on the ROS network. This integer is retrieved from the parameter server and compared to a constant. The output Boolean from the comparison is also set on the network. Change the constant block in the top left (blue) when you run the model to set network parameters based on user input conditions.

You must be connected to a ROS network. Call rosinit in the MATLAB® command line.