ROS Toolbox provides an interface connecting MATLAB and Simulink with the Robot Operating System (ROS and ROS 2). With the toolbox, you can design a network of ROS nodes and combine MATLAB or Simulink generated ROS nodes with your existing ROS network.
The toolbox includes MATLAB functions and Simulink blocks to visualize and analyze ROS data by recording, importing, and playing back 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 or to hardware. ROS Toolbox supports C++ and CUDA® code generation (with MATLAB Coder, Simulink Coder, and GPU Coder), enabling you to automatically generate ROS nodes from a MATLAB script or 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.
ROS and ROS 2 Networks
Connect to existing ROS or ROS 2 networks to prototype ROS-based applications. Design a network of ROS nodes for desktop simulation. Communicate with hardware using ROS messaging in MATLAB and Simulink.
ROS: Documentation | Examples
ROS2: Documentation | Examples
Communication and Messaging
Send and receive ROS messages with publish-subscribe semantics. Use a client-server architecture to send requests, perform tasks, and receive feedback. Configure ROS nodes dynamically with ROS parameter servers.
ROS: Documentation | Examples
ROS2: Documentation | Examples
Custom Messages
Create custom message definitions and use them to transmit information. Use your custom messages with publishers, subscribers, actions, and services. View, plot, and log custom message contents directly in MATLAB. Use ROS specialized messages to create and access sensor and data types using specific ROS and ROS 2 message types.
Rosbag Visualization
Use the ROS Bag Viewer app to playback and visualize multiple messages in a rosbag file simultaneously from MATLAB. Use the rosbag command line interface to write logs or to access, filter, visualize, and analyze logged data. Use rosbag files for simulation in MATLAB and Simulink.
Node Deployment
Generate C++ code and deploy it to local or remote device targets as standalone ROS and ROS 2 nodes. Use CUDA-compatible ROS node generation to accelerate ROS-based AI applications. Generate C++ code for real-time ros_control plugins from controllers designed in Simulink.
ROS: Documentation | Examples
ROS2: Documentation | Examples
Application Examples
Use reference application examples for ground robots, robot manipulators, UAVs, and autonomous vehicles to jumpstart the design, simulation, and deployment of your ROS-based systems.