ros2
R2026bRetrieve information about ROS 2 network
Syntax
Description
Message
ros2 msg list returns a list of all available ROS 2 message types
that you can use in MATLAB®.
ros2 msg show provides the
definition of the ROS 2 message specified in msgTypemsgType.
returns a list
of all available ROS 2 message types that you can use in MATLAB.msgList = ros2("msg","list")
Topic
ros2 topic list lists topic names with registered publishers or
subscribers on the ROS 2 network.
ros2 topic list -show-types additionally displays the message
type for each topic.
ros2 topic list -verbose lists full details about each topic,
including the message type, publisher count, and subscriber count.
ros2 topic list -all lists all topics on the ROS 2 network,
including hidden topics.
ros2 topic type returns the
message type of the topic on the ROS 2 network specified in
topicNametopicName.
ros2 topic echo displays live
message data published on the topic specified in topicNametopicName directly in
the MATLAB Command Window. You must click Ctrl+C to
stop echoing.
ros2 topic echo
displays live message data published on the topic specified in
topicName -truncate-length NtopicName, truncating arrays, bytes, and strings to the number of
elements specified in N.
ros2 topic echo
displays live message data published on the topic specified in
topicName -full-lengthtopicName, showing all elements for arrays, bytes, and strings
without truncation.
ros2 topic info displays detailed
information about the topic specified in topicNametopicName, including its
message type, publishers, and subscribers.
ros2 topic info displays
detailed information about the topic specified in topicName -verbosetopicName, including
QoS profiles for each publisher and subscriber.
ros2 topic find returns a list of
topics on the ROS 2 network that use the message type specified in
topicTypetopicType.
lists topic
names with registered publishers or subscribers on the ROS 2 network.topicList = ros2("topic","list")
lists topic names with registered publishers or subscribers on the ROS 2 network,
additionally showing the message type for each topic.topicList = ros2("topic","list","-show-types")
lists full details about each topic on the ROS 2 network, including the message type,
publisher count, and subscriber count.topicList = ros2("topic","list","-verbose")
lists all topics on the ROS 2 network, including hidden topics.topicList = ros2("topic","list","-all")
returns a list of topics on the ROS 2 network that use the message type specified in
topicNames = ros2("topic","find",topicType)topicType.
Node
ros2 node list lists nodes on the ROS 2 network.
ros2 node list -all lists all nodes on the ROS 2 network,
including hidden nodes.
ros2 node info displays detailed
information about the node specified in nodeNamenodeName, including its
publishers, subscribers, services, and actions.
ros2 node info displays
detailed information about the node specified in nodeName -allnodeName, including
hidden topics and services.
lists nodes
on the ROS 2 network.nodeList = ros2("node","list")
lists
all nodes on the ROS 2 network, including hidden nodes.nodeList = ros2("node","list","-all")
Service
ros2 service list lists service names that are registered on the
ROS 2 network through either servers or clients.
ros2 service list -show-types additionally displays the service
type for each service.
ros2 service list -all lists all services on the ROS 2 network,
including hidden services.
ros2 service type lists service
types that are registered on the ROS 2 network for the service name specified in
svcNamesvcName.
ros2 service find returns a list of
services on the ROS 2 network that use the service type specified in
svcTypesvcType.
ros2 service info displays detailed
information about the service specified in svcNamesvcName, including its
service type, server node, and client nodes.
lists
service names that are registered on the ROS 2 network through either servers or
clients.svcList = ros2("service","list")
lists service names that are registered on the ROS 2 network, additionally showing the
service type for each service.svcList = ros2("service","list","-show-types")
lists all services on the ROS 2 network, including hidden services.svcList = ros2("service","list","-all")
Action
ros2 action list lists action names that are registered on the
ROS 2 network through either servers or clients.
ros2 action list -show-types additionally displays the action
type for each action.
ros2 action type lists action
types that are registered on the ROS 2 network for the action name specified in
actionNameactionName.
ros2 action info displays
detailed information about the action specified in actionNameactionName, including
its action type, action server node, and action client nodes.
lists
action names that are registered on the ROS 2 network through either servers or
clients.actionList = ros2("action","list")
lists action names that are registered on the ROS 2 network, additionally showing the
action type for each action.actionList = ros2("action","list","-show-types")
lists action types that are registered on the ROS 2 network for the action name specified in
actionTypes = ros2("action","type",actionName)actionName.
returns detailed information about the action specified in actionInfo = ros2("action","info",actionName)actionName,
including its action type, action server node, and action client nodes.
lists actions on the ROS 2 network for the specified network domain ID.actionList = ros2("action","list",DomainID=ID)
Parameter
ros2 param list lists all parameters available on the nodes in
the ROS 2 network.
ros2 param list lists parameters
available on the node specified in nodeNamenodeName in the ROS 2 network.
returns a
list of all parameters available on the nodes in the ROS 2 network.paramList = ros2("param","list")
Bag
ros2 bag info displays the
information about the contents of the ROS 2 bag at folderpathfolderpath in the
MATLAB Command Window. The information corresponds to fields from the
bag2info structure.
returns information about the contents of the ROS 2 bag file specified in
bag2info = ros2("bag","info",folderpath)folderpath in the structure bag2info.
Note
If the ROS 2 bag log file contains custom messages, generate MATLAB interfaces to ROS 2 custom messages using ros2genmsg
function before using the bag querying command or function.