Main Content

ROS 2 Network Connection and Exploration

Set up and interact with ROS 2 Networks

Connect to ROS 2 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 2 network. To set up a ROS 2 network, create a ROS 2 node using ros2node object.

You can access ROS 2 parameters using ros2param object and its object functions.

The ros2rate object helps control the timing of code execution.

Functions

expand all

ros2Retrieve information about ROS 2 network
ros2messageCreate ROS 2 message structures
ros2tfReceive, send, verify and apply ROS 2 transformations
rosApplyTransformTransform message entities into target frame
canTransformVerify if transformation is available
transformTransform message entities into target coordinate frame
getTransformReturn the transformation between two coordinate frames
sendTransformSend a transformation to the ROS 2 network
ros2timeAccess ROS 2 time functionality
ros2rateExecute loop at fixed frequency
ros2durationCreate a ROS 2 duration message
ros2deviceConnect to remote ROS 2 device
runNodeStart ROS or ROS 2 node
stopNodeStop ROS or ROS 2 node
isNodeRunningDetermine if ROS or ROS 2 node is running

Objects

expand all

ros2nodeCreate a ROS 2 node on the specified network
ros2paramCreate object to access parameters from ROS 2 nodes

Blocks

Blank MessageCreate blank ROS 2 message using specified message type
Current TimeRetrieve current ROS 2 time or system time
Get ParameterGet ROS 2 parameter value