ROS and ROS 2 Simulink Support and Limitations
ROS Features in Simulink
ROS Toolbox does not support these ROS features in Simulink®:
ROS Service Servers
ROS Action Servers
ROS Action Clients
If your application requires the above features, consider using the corresponding ROS features in MATLAB®:
ROS Service Servers:
rosservice
,rossvcserver
ROS Action Servers:
rosaction
,rosactionserver
ROS Action Client:
rosactionclient
To see a full list of ROS features supported in Simulink, see ROS Network Access in Simulink.
ROS 2 Features in Simulink
ROS Toolbox does not support these ROS 2 features in Simulink:
ROS 2 Action Servers
If your application requires the above features, consider using the corresponding ROS 2 features in MATLAB:
ROS 2 Action Servers:
ros2actionserver
To see a full list of ROS 2 features supported in Simulink, see ROS 2 Network Access in Simulink.
Model and Subsystem References
Simulink supports model reference when using ROS or ROS 2 blocks with these limitations:
Multiple references to the same model results in an error due to duplicate buses with the same name being created for ROS messages used by the ROS blocks. You can only reference a model once in a parent model.
Referenced data dictionaries are not supported with variable-size ROS messages.
Simulation Mode only supports
Normal
mode.
ROS or ROS 2 blocks are not supported for usage within subsystem references. This is because ROS Toolbox uses a data dictionary to store model information but subsystem reference does not support portability of data dictionary attached to it. For more information on using subsystem references, see Considerations When Using a Library Dictionary (Simulink).
Remote Desktop
Running ROS networks from remote desktop applications can cause ROS communication to be interrupted. Consider executing your network without a remote connection.
ROS 2 Model Build Failure
A space in the installation path of Python 3.9 causes an error related to the creation of a Python virtual environment when generating code from a ROS 2 Simulink model. e.g. C:\Program Files\Python39\python.exe
Usage of ROS and ROS 2 Blocks
Usage of Simulink blocks of both ROS and ROS 2 variants is not recommended in the same Simulink model. Simulation works differently for ROS and ROS 2 and switching from one to another in the same model shall cause error.