MATLAB Answers

How to resolve error "The ROS master is already running on port 11311"?

10 views (last 30 days)
The following error is thrown
The ROS master is already running on port 11311. Try connecting to this master or creating a new ROS master
that uses a different port.
when running
core = ros.Core;
How can I resolve this error?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Apr 2021
One reason for this error might be an external process, which is already using this port. If you can determine which process exactly is causing this issue, you may be able to change its settings to use a different port. If not, or if it does not have settings, any computer-wide setting to block programs from using 11311 would also block ROS.
Port 11311 is the default port for ROS, but you can use any other port, as long as your other ROS machines target it, as shown in the example below
core = ros.Core(11312);
rosinit(core.MasterURI) ;

More Answers (0)





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by