This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

ROS Access with Simulink

Access ROS networks and messages using Simulink®

Robotics System Toolbox™ enables you to connect to ROS in Simulink and send messages over the network. See Get Started with ROS in Simulink®.

You can also generate and deploy code to a target system. For an advanced example on creating a standalone ROS node, see Generate a Standalone ROS Node from Simulink®.

To run, stop, or check the status of deployed ROS nodes available on a ROS device, use the MATLAB® functions listed. Create a connection to a ROS device using rosdevice.

Functions

rosdeviceConnect to remote ROS device
runNodeStart ROS node
stopNodeStop ROS node
runCoreStart ROS core
stopCoreStop ROS core
isNodeRunningDetermine if ROS node is running
isCoreRunningDetermine if ROS core is running

Blocks

expand all

Blank MessageCreate blank message using specified message type
Call ServiceCall service in ROS network
Current TimeRetrieve current ROS time or system time
Get ParameterGet values from ROS parameter server
PublishSend messages to ROS network
Read DataPlay back data from log file
Read ImageExtract image from ROS Image message
Read Point CloudExtract point cloud from ROS PointCloud2 message
Set ParameterSet values on ROS parameter server
SubscribeReceive messages from ROS network

Topics

ROS Network

ROS Simulink Support and Limitations

Robotics System Toolbox does not support the following ROS features in Simulink:

Get Started with ROS in Simulink®

This example shows you how to use Simulink blocks for ROS to send and receive messages from a local ROS network.

Connect to a ROS-enabled Robot from Simulink®

This example shows you how to configure a Simulink model to send and receive information from a separate ROS-based simulator such as Gazebo®.

ROS Parameters in Simulink

Simulink model showing how to get and set ROS parameters

ROS String Parameters

Details for setting ROS string parameters in Simulink

Connect to ROS Device

Parameters for connecting to a ROS device

ROS Messages

Publish and Subscribe to ROS Messages in Simulink

Use the Publish and Subscribe Blocks in Simulink

Simulink and ROS Interaction

Simulink and ROS Interaction Overview

Configure ROS Network Addresses

Configure ROS Network Addresses Dialog

Selecting ROS Topics, Messages, and Parameters

Dialog box descriptions for selection ROS topics and messages

Managing Array Sizes in Simulink ROS

Description of dialog box for managing array sizes in Simulink ROS

Managing Array Sizes in Simulink ROS

Description of dialog box for managing array sizes in Simulink ROS

Robot Applications

Feedback Control of a ROS-enabled Robot

This example shows you how to use Simulink® to control a simulated robot running in a separate ROS-based simulator.

Generate a Standalone ROS Node from Simulink®

This example shows you how to generate and build a standalone ROS node from a Simulink model.

Enable ROS Time Model Stepping for Deployed ROS Nodes

You can enable a deployed ROS node to execute based on the time published on the /clock topic on a ROS network.

Overrun Detection with Deployed ROS Nodes

You can enable overrun detection for a deployed ROS node.

Generate Code to Manually Deploy a ROS Node from Simulink

This example shows you how to generate C++ code from a Simulink model to deploy as a standalone ROS node.