ROS Toolbox provides an interface connecting MATLAB® and Simulink® with the Robot Operating System (ROS and ROS 2), enabling you to create a network of ROS nodes. The toolbox includes MATLAB functions and Simulink blocks to import, analyze, and play back ROS data recorded in rosbag files. You can also connect to a live ROS network to access ROS messages.
The toolbox lets you verify ROS nodes via desktop simulation and by connecting to external robot simulators such as Gazebo. ROS Toolbox supports C++ code generation (with Simulink Coder™), enabling you to automatically generate ROS nodes from a Simulink model and deploy to simulated or physical hardware. Support for Simulink external mode lets you view messages and change parameters while your model is running on hardware.
Robot Operating System (ROS) is a communication interface that enables different parts of a robot system to discover each other, and send and receive data between them.
Get Started with ROS in Simulink®
This example shows how to use Simulink blocks for ROS to send and receive messages from a local ROS network.
Messages are the primary container for exchanging data in ROS.
Exchange Data with ROS Publishers and Subscribers
The primary mechanism for ROS nodes to exchange data is sending and receiving messages.
Get Started with Gazebo and a Simulated TurtleBot
This example shows how to set up the Gazebo® simulator engine.
Robot Operating System 2 (ROS 2) is the second version of ROS, which is a communication interface that enables different parts of a robot system to discover, send, and receive data.
Get Started with ROS 2 in Simulink®
This example shows how to use Simulink blocks for ROS 2 to send and receive messages from a local ROS 2 network.
Work with Basic ROS 2 Messages
ROS messages are the primary container for exchanging data in ROS 2.
Exchange Data with ROS 2 Publishers and Subscribers
The primary mechanism for ROS 2 nodes to exchange data is to send and receive messages.
Details about the ROS framework and links to relevant examples to get started.
Summary of ROS and ROS 2 system requirements and MATLAB support for different platforms and versions.
List of supported ROS message types in MATLAB.
The ROS Toolbox does not support the following ROS features in Simulink: