ros2
Retrieve information about ROS 2 network
Syntax
Description
ros2 msg list
returns a list of all available ROS 2 message types
that can be used in MATLAB.
ros2 node list
lists nodes on the ROS 2 network.
ros2 topic list
lists topic names with registered publishers or
subscribers on the ROS 2 network.
ros2 service list
lists service names that are registered on the
ROS 2 network through either servers or clients.
ros2 service type
lists service types
that are registered on the ROS 2 network for the provided
svcname
svcname
.
ros2 action list
lists action names that are registered on the ROS
2 network through either servers or clients.
ros2 action type
lists action types
that are registered on the ROS 2 network for the provided
actionname
actionname
.
ros2 bag info
displays the
information about the contents of the ros2bag at folderpath
folderpath
in the
MATLAB® Command Window. The information include the contents of the
bag2info
structure.
Note
If the ROS 2 bag log file contains custom messages, generate MATLAB interfaces to ROS 2 custom messages using ros2genmsg
function before using this command.
returns a list of
all available ROS 2 message types that can be used in MATLAB.msgList
= ros2("msg","list")
lists topic
names with registered publishers or subscribers on the ROS 2 network.topicList
= ros2("topic","list")
lists
service names that are registered on the ROS 2 network through either servers or
clients.serviceList
= ros2("service","list")
lists service types that are registered on the ROS 2 network for the provided
serviceTypes
= ros2("service","type",svcname
)svcname
.
lists
action names that are registered on the ROS 2 network through either servers or
clients.actionList
= ros2("action","list")
lists action types that are registered on the ROS 2 network for the provided
actionTypes
= ros2("action","type",actionname
)actionname
.
lists topic names with registered publishers or subscribers on the ROS 2 network for the
specified network domain ID.topicList
= ros2("topic","list","DomainID",ID
)
Note
The "DomainID"
name-value pair applies only to information
gathered from the active network, such as the node and topic list, and not to static ROS
2 data such as message information.
The first time ros2
is called for a specific domain ID not all
information on the network may be immediately available. If incomplete network
information is returned from ros2
, wait for a short time before
trying again.
returns information about the contents of the ros2bag as a structure,
bag2info
= ros2("bag","info",folderpath
)bag2info
at folderpath
.
Note
If the ROS 2 bag log file contains custom messages, generate MATLAB interfaces to ROS 2 custom messages using ros2genmsg
function before using this function.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2019b