Contenido principal

runCore

Start ROS core

Description

runCore(device) starts the ROS core on the connected device. The ROS master uses a default port number of 11311.

example

Examples

collapse all

Connect to a remote ROS device and start a ROS core. The ROS core is needed to run ROS nodes to communicate via a ROS network. You can run and stop a ROS core or node and check their status using a rosdevice object.

To create a connection to your ROS device, specify its IP address, user name, and password. By default, the rosdevice object establishes an SSH connection on port 22.

ipaddress = '192.168.203.131';
d = rosdevice(ipaddress,'user','password')
d = 
  rosdevice with properties:

      DeviceAddress: '192.168.203.131'
           Username: 'user'
          ROSFolder: '/opt/ros/indigo'
    CatkinWorkspace: '~/catkin_ws'
     AvailableNodes: {'voxel_grid_filter_sl'}

The rosdevice object stores information about the ROS device, including the list of available ROS nodes that you can launch using the runNode function.

To connect using an SSH port other than the default, such as port 34, specify the port number as an additional input argument when creating the rosdevice object:

d = rosdevice(ipaddress,'user','password', 34)

Run a ROS core and check if it is running.

runCore(d)
Another roscore / ROS master is already running on the ROS device. Use the 'stopCore' function to stop it.
running = isCoreRunning(d)
running = logical
   1

Stop the ROS core and confirm that it is no longer running.

stopCore(d)
pause(2)
running = isCoreRunning(d)
running = logical
   0

Input Arguments

collapse all

ROS device, specified as a rosdevice object.

Version History

Introduced in R2019b