Main Content

ROS Network Connection and Exploration

Set up and interact with ROS networks

Connect to ROS to prototype robotics applications and access robotics hardware or simulators over a ROS network. You can create your own ROS network using MATLAB® or connect to an existing ROS network. To set up a ROS network, start by calling rosinit.

You can access transformations between coordinate systems as ROS topics and use them to transform data in MATLAB. For more information, see Access the tf Transformation Tree in ROS.

The rosrate object helps control the timing of code execution.


expand all

rosinitConnect to ROS network (Since R2019b)
rostopicRetrieve information about ROS topics (Since R2019b)
rosmsgRetrieve information about ROS messages and message types (Since R2019b)
rosnodeRetrieve information about ROS network nodes (Since R2019b)
rosparamAccess ROS parameter server values (Since R2019b)
rosshutdownShut down ROS system (Since R2019b)
getGet ROS parameter value (Since R2019b)
hasCheck if ROS parameter name exists (Since R2019b)
searchSearch ROS network for parameter names (Since R2019b)
setSet value of ROS parameter or add new parameter (Since R2019b)
delDelete a ROS parameter (Since R2019b)
rostfReceive, send, and apply ROS transformations (Since R2019b)
rosApplyTransformTransform ROS and ROS 2 message entities into target frame (Since R2021a)
rosReadTransformReturn transformation from ROS or ROS 2 TransformStamped message structure (Since R2023b)
canTransformVerify if transformation is available (Since R2019b)
transformTransform message entities into target coordinate frame (Since R2019b)
waitForTransformWait until a transformation is available (Since R2019b)
getTransformRetrieve transformation between two coordinate frames (Since R2019b)
sendTransformSend transformation to ROS network (Since R2019b)
rostimeAccess ROS time functionality (Since R2019b)
rosrateExecute loop at fixed frequency (Since R2019b)
rosdurationCreate a ROS duration object (Since R2019b)
secondsReturns seconds of a time or duration (Since R2019b)
rosdeviceConnect to remote ROS device (Since R2019b)
runNodeStart ROS or ROS 2 node (Since R2019b)
stopNodeStop ROS or ROS 2 node (Since R2019b)
runCoreStart ROS core (Since R2019b)
stopCoreStop ROS core (Since R2019b)
isNodeRunningDetermine if ROS or ROS 2 node is running (Since R2019b)
isCoreRunningDetermine if ROS core is running (Since R2019b)


expand all

CoreCreate ROS Core (Since R2019b)
NodeStart ROS node and connect to ROS master (Since R2019b)
ParameterTreeAccess ROS parameter server (Since R2019b)
TransformStampedCreate transformation message (Since R2019b)


Blank MessageCreate blank message using specified message type (Since R2019b)
Current TimeRetrieve current ROS time or system time (Since R2019b)
Set ParameterSet values on ROS parameter server (Since R2019b)
Coordinate Transformation ConversionConvert to a specified coordinate transformation representation