Main Content

Connect to ROS Network

Set the MATLAB® and ROS IP addresses in the environment variable. For more information on environment variables, see Connect to a ROS Network. Execute these commands in the MATLAB sequentially to connect to the existing ROS network.

matlabIP = '192.168.0.103'; % IP address of MATLAB host PC
rosIP = '192.168.0.103';    % IP address of ROS enabled machine
setenv('ROS_IP',matlabIP); 
setenv('ROS_MASTER_URI',['http://' rosIP ':11311']); 

Initialize MATLAB global node and connect to the existing ROS network.

rosinit;