ROS Toolbox System Requirements
ROS or ROS 2 Node Deployment and Custom Messages
To generate custom messages for ROS or ROS 2, or deploy ROS or ROS 2 nodes from MATLAB® or Simulink® software, you must build the necessary ROS or ROS 2 packages. To build these packages, you must have Python® software, CMake software, and a C++ compiler for your platform. To generate and deploy ROS or ROS 2 nodes from MATLAB or Simulink, you must also have a MATLAB Coder™ or Simulink Coder license respectively. To generate and deploy CUDA® optimized ROS or ROS 2, you must have a GPU Coder™ license.
The nodes in MATLAB and Simulink software can communicate with ROS or ROS 2 nodes in ROS or ROS 2 distributions that are not supported in MATLAB and Simulink, only if the message definitions are the same.
Configure Python Environment
To connect to ROS networks with the
rosinit function, you must install and set up the required version of
Python. After you install and setup the required version of Python, follow these steps to configure it for use with ROS Toolbox.
Starting in R2022b
On the Home tab in the Environment section of the MATLAB toolstrip, click Preferences.
Select ROS Toolbox, click the Open ROS Toolbox Preferences button, and specify the path to the Python executable that you installed in the previous step.
Click Recreate Python Environment.
Prior to R2022b
To check your Python version, use the
pyenvfunction. For example,
ans = PythonEnvironment with properties: Version: "3.9" Executable: "C:\Python39\python.exe" Library: "C:\Python39\python39.dll" Home: "C:\Python39" Status: NotLoaded ExecutionMode: InProcess
If your Python interpreter is set to a different version, restart MATLAB and set the version with
Starting in MATLAB R2022a
ROS and ROS 2 System Requirements
|Platform||Platform Versions||Python Version||C++ Compilers||CMake|
|Windows®||Windows 10 (recommended)||3.9||Visual Studio 2019 and 2022 (recommended)|
For R2022b, manual installation of CMake is not required.
For R2022a, download and install CMake 3.16.3+.
Ubuntu® 20.04 Focal Fossa (recommended)
Debian® 11 Bullseye
|GNU Compiler Collection (GCC) 6.3+|
Big Sur 11
Monterey 12.0.1 (recommended)
MATLAB R2020b to R2021b
From R2020b to R2021b, ROS Toolbox supports the Melodic Morenia distribution for ROS.
ROS System Requirements
From R2020b to R2021b, the ROS Toolbox supports the Dashing Diademata distribution for ROS 2.