ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

That's correct. MATLAB is single-threaded to the user because it has a lot of internal functions that use multithreading.

So you have 2 options:

  1. Open up multiple MATLAB instances and run separate scripts/functions. Obviously really heavy on the processing, so opening MATLAB without the desktop can help: https://blogs.mathworks.com/community/2010/02/22/launching-matlab-without-the-desktop/

  2. Generating standalone C++ ROS nodes which requires your code to be placed in a Simulink model (and you also need the Simulink Coder and/or Embedded Coder toolbox). Then you can run these generated nodes from multiple terminals like any other ROS node. See this video for more info: https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-deploying-algorithms-to-ros-1510659362460.html

Sebastian

That's correct. MATLAB is single-threaded to the user because it has a lot of internal functions that use multithreading.

So you have 2 options:

  1. Open up multiple MATLAB instances and run separate scripts/functions. Obviously really heavy on the processing, so opening MATLAB without the desktop can help: https://blogs.mathworks.com/community/2010/02/22/launching-matlab-without-the-desktop/https://www.mathworks.com/help/matlab/ref/matlablinux.html

    matlab -nodesktop -nodisplay -r myNode

  2. Generating standalone C++ ROS nodes which requires your code to be placed in a Simulink model (and you also need the Simulink Coder and/or Embedded Coder toolbox). Then you can run these generated nodes from multiple terminals like any other ROS node. See this video for more info: https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-deploying-algorithms-to-ros-1510659362460.html

Sebastian

That's correct. MATLAB is single-threaded to the user because it has a lot of internal functions that use multithreading.

So you have 2 options:

  1. Open up multiple MATLAB instances and run separate scripts/functions. Obviously really heavy on the processing, so opening MATLAB without the desktop can help: https://www.mathworks.com/help/matlab/ref/matlablinux.html

matlab -nodesktop -nodisplay -r myNode

  1. Generating standalone C++ ROS nodes which requires your code to be placed in a Simulink model (and you also need the Simulink Coder and/or Embedded Coder toolbox). Then you can run these generated nodes from multiple terminals like any other ROS node. See this video for more info: https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-deploying-algorithms-to-ros-1510659362460.html

Sebastian

That's correct. MATLAB is single-threaded to the user because it has a lot of internal functions that use multithreading.

So you have 2 options:

  1. Open up multiple MATLAB instances and run separate scripts/functions. Obviously really heavy on the processing, so opening MATLAB without the desktop and display can help: https://www.mathworks.com/help/matlab/ref/matlablinux.html

matlab -nodesktop -nodisplay -r myNode

  1. Generating standalone C++ ROS nodes which requires your code to be placed in a Simulink model (and you also need the Simulink Coder and/or Embedded Coder toolbox). Then you can run these generated nodes from multiple terminals like any other ROS node. See this video for more info: https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-deploying-algorithms-to-ros-1510659362460.html

Sebastian

That's correct. MATLAB is single-threaded to the user because it has a lot of internal functions that use multithreading.

So you have 2 options:

    • Open up multiple MATLAB instances and run separate scripts/functions. Obviously really heavy on the processing, so opening MATLAB without the desktop and display can help: https://www.mathworks.com/help/matlab/ref/matlablinux.html

matlab -nodesktop -nodisplay -r myNode

    • Generating standalone C++ ROS nodes which requires your code to be placed in a Simulink model (and you also need the Simulink Coder and/or Embedded Coder toolbox). Then you can run these generated nodes from multiple terminals like any other ROS node. See this video for more info: https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-deploying-algorithms-to-ros-1510659362460.html

Sebastian