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.

Functions

expand all

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

Objects

expand all

CoreCreate ROS Core
NodeStart ROS node and connect to ROS master
ParameterTreeAccess ROS parameter server
TransformStampedCreate transformation message

Blocks

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

Topics

Featured Examples