Hauptinhalt

ros2

R2026b

Retrieve 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®.

example

ros2 msg show msgType provides the definition of the ROS 2 message specified in msgType.

msgList = ros2("msg","list") returns a list of all available ROS 2 message types that you can use in MATLAB.

msgInfo = ros2("msg","show",msgType) provides the definition of the ROS 2 message specified in msgType.

Topic

ros2 topic list lists topic names with registered publishers or subscribers on the ROS 2 network.

example

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 topicName returns the message type of the topic on the ROS 2 network specified in topicName.

ros2 topic echo topicName displays live message data published on the topic specified in topicName directly in the MATLAB Command Window. You must click Ctrl+C to stop echoing.

ros2 topic echo topicName -truncate-length N displays live message data published on the topic specified in topicName, truncating arrays, bytes, and strings to the number of elements specified in N.

ros2 topic echo topicName -full-length displays live message data published on the topic specified in topicName, showing all elements for arrays, bytes, and strings without truncation.

ros2 topic info topicName displays detailed information about the topic specified in topicName, including its message type, publishers, and subscribers.

ros2 topic info topicName -verbose displays detailed information about the topic specified in topicName, including QoS profiles for each publisher and subscriber.

ros2 topic find topicType returns a list of topics on the ROS 2 network that use the message type specified in topicType.

topicList = ros2("topic","list") lists topic names with registered publishers or subscribers on the ROS 2 network.

topicList = ros2("topic","list","-show-types") 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","-verbose") lists full details about each topic on the ROS 2 network, including the message type, publisher count, and subscriber count.

topicList = ros2("topic","list","-all") lists all topics on the ROS 2 network, including hidden topics.

topicList = ros2("topic","list",DomainID=ID) lists topic names with registered publishers or subscribers on the ROS 2 network for the specified network domain ID.

topicType = ros2("topic","type",topicName) returns the message type of the topic on the ROS 2 network specified in topicName.

topicInfo = ros2("topic","info",topicName) returns detailed information about the topic specified in topicName, including its message type, publishers, and subscribers.

topicInfo = ros2("topic","info",topicName,"-verbose") returns detailed information about the topic specified in topicName, including QoS profiles for each publisher and subscriber.

topicNames = ros2("topic","find",topicType) returns a list of topics on the ROS 2 network that use the message type specified in topicType.

Node

ros2 node list lists nodes on the ROS 2 network.

example

ros2 node list -all lists all nodes on the ROS 2 network, including hidden nodes.

ros2 node info nodeName displays detailed information about the node specified in nodeName, including its publishers, subscribers, services, and actions.

ros2 node info nodeName -all displays detailed information about the node specified in nodeName, including hidden topics and services.

nodeList = ros2("node","list") lists nodes on the ROS 2 network.

nodeList = ros2("node","list","-all") lists all nodes on the ROS 2 network, including hidden nodes.

nodeInfo = ros2("node","info",nodeName) returns detailed information about the node specified in nodeName, including its publishers, subscribers, services, and actions.

nodeInfo = ros2("node","info",nodeName,"-all") returns detailed information about the node specified in nodeName, including hidden topics and services.

nodeList = ros2("node","list",DomainID=ID) lists nodes on the ROS 2 network for the specified network domain ID.

Service

ros2 service list lists service names that are registered on the ROS 2 network through either servers or clients.

example

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 svcName lists service types that are registered on the ROS 2 network for the service name specified in svcName.

ros2 service find svcType returns a list of services on the ROS 2 network that use the service type specified in svcType.

ros2 service info svcName displays detailed information about the service specified in svcName, including its service type, server node, and client nodes.

svcList = ros2("service","list") lists service names that are registered on the ROS 2 network through either servers or clients.

svcList = ros2("service","list","-show-types") lists service names that are registered on the ROS 2 network, additionally showing the service type for each service.

svcList = ros2("service","list","-all") lists all services on the ROS 2 network, including hidden services.

svcTypes = ros2("service","type",svcName) lists service types that are registered on the ROS 2 network for the service name specified in svcName.

svcNames = ros2("service","find",svcType) returns a list of services on the ROS 2 network that use the service type specified in svcType.

svcInfo = ros2("service","info",svcName) returns detailed information about the service specified in svcName, including its service type, server node, and client nodes.

svcList = ros2("service","list",DomainID=ID) lists services on the ROS 2 network for the specified network domain ID.

Action

ros2 action list lists action names that are registered on the ROS 2 network through either servers or clients.

example

ros2 action list -show-types additionally displays the action type for each action.

ros2 action type actionName lists action types that are registered on the ROS 2 network for the action name specified in actionName.

ros2 action info actionName displays detailed information about the action specified in actionName, including its action type, action server node, and action client nodes.

actionList = ros2("action","list") lists action names that are registered on the ROS 2 network through either servers or clients.

actionList = ros2("action","list","-show-types") lists action names that are registered on the ROS 2 network, additionally showing the action type for each action.

actionTypes = ros2("action","type",actionName) lists action types that are registered on the ROS 2 network for the action name specified in actionName.

actionInfo = ros2("action","info",actionName) returns detailed information about the action specified in actionName, including its action type, action server node, and action client nodes.

actionList = ros2("action","list",DomainID=ID) lists actions on the ROS 2 network for the specified network domain ID.

Parameter

ros2 param list lists all parameters available on the nodes in the ROS 2 network.

example

ros2 param list nodeName lists parameters available on the node specified in nodeName in the ROS 2 network.

ros2 param describe nodeName paramName displays metadata about the parameter specified in paramName on the node specified in nodeName, including its type, description, and constraints.

paramList = ros2("param","list") returns a list of all parameters available on the nodes in the ROS 2 network.

paramList = ros2("param","list",nodeName) returns a list of parameters available on the node specified in nodeName in the ROS 2 network.

paramInfo = ros2("param","describe",nodeName,paramName) returns metadata about the parameter specified in paramName on the node specified in nodeName, including its type, description, and constraints.

paramList = ros2("param","list",DomainID=ID) lists parameters on the ROS 2 network for the specified network domain ID.

Bag

ros2 bag info folderpath displays the information about the contents of the ROS 2 bag at folderpath in the MATLAB Command Window. The information corresponds to fields from the bag2info structure.

bag2info = ros2("bag","info",folderpath) returns information about the contents of the ROS 2 bag file specified in 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.

Examples

collapse all

Show the definition of the geometry_msgs/Accel message.

ros2 msg show geometry_msgs/Accel
# This expresses acceleration in free space broken into its linear and angular parts.
Vector3  linear
Vector3  angular

Open ros2NetworkAnalyzer to visualize your live ROS 2 network graph with nodes, topics, services, actions, and their connections.

Run the helper script attached to this example to generate a ROS 2 network with active publishers that simulate LiDAR, camera, and joint state data for a lane driving scenario. This network includes live sensor data streams that you can echo and inspect directly from MATLAB®.

exampleHelperROS2LiveTopicNetwork

Discover All Topics on Network

Start by listing all topics to get an overview of the data channels available in this network. Use -show-types to see what message types each topic uses. The -type information helps identify sensor data streams versus planning outputs.

ros2 topic list -show-types
                   Topic                              MessageType           
    ___________________________________    _________________________________

    {'/joint_states'                  }    {'sensor_msgs/JointState'       }
    {'/parameter_events'              }    {'rcl_interfaces/ParameterEvent'}
    {'/rosout'                        }    {'rcl_interfaces/Log'           }
    {'/sensing/camera/front/image_raw'}    {'sensor_msgs/Image'            }
    {'/sensing/lidar/top/pointcloud'  }    {'sensor_msgs/PointCloud2'      }

You can see sensor topics such as /sensing/lidar/top/pointcloud with type sensor_msgs/PointCloud2, /sensing/camera/front/image_raw with type sensor_msgs/Image, and /joint_states with type sensor_msgs/JointState.

List Topics with Verbose Details

Use -verbose to see publisher and subscriber counts for each topic. The -verbose output helps identify unconnected topics or imbalanced communication patterns.

ros2 topic list -verbose
                   Topic                              MessageType               PublisherCount    SubscriberCount
    ___________________________________    _________________________________    ______________    _______________

    {'/joint_states'                  }    {'sensor_msgs/JointState'       }          1                  1       
    {'/parameter_events'              }    {'rcl_interfaces/ParameterEvent'}          7                  7       
    {'/rosout'                        }    {'rcl_interfaces/Log'           }          7                  0       
    {'/sensing/camera/front/image_raw'}    {'sensor_msgs/Image'            }          1                  1       
    {'/sensing/lidar/top/pointcloud'  }    {'sensor_msgs/PointCloud2'      }          1                  1       

You can see each topic listed with its message type, number of publishers, and number of subscribers. For example, /joint_states shows one publisher (the axle joint state publisher) and one subscriber (the robot state publisher).

Get Topic Message Type

Use topic type to quickly identify the message type used by a specific topic. The -type information is useful when you want to create a subscriber or understand the data format.

ros2 topic type /sensing/lidar/top/pointcloud
sensor_msgs/PointCloud2

You can see that the topic uses the sensor_msgs/PointCloud2 message type, which is a standard ROS 2 format for 3-D point cloud data from LiDAR sensors.

Echo Live Sensor Data

Use topic echo to subscribe to a topic and display incoming messages in real time. The /joint_states topic publishes at 50 Hz, so messages arrive rapidly.

ros2 topic echo /joint_states
Listening to topic "/joint_states" [sensor_msgs/JointState]

You can see incoming sensor_msgs/JointState messages with fields such as header, name (containing front_left_wheel, front_right_wheel, rear_left_wheel, rear_right_wheel), position, velocity, and effort in the Command Window. Click Ctrl+C to stop echoing.

Here is a part of the output:

MessageType :  sensor_msgs/JointState
  header         
    MessageType :  std_msgs/Header
    stamp          
      MessageType :  builtin_interfaces/Time
      sec         :  0
      nanosec     :  0
    frame_id    :  
  name        :  {1}  front_left_wheel   {2}  front_right_wheel   {3}  rear_left_wheel   {4}  rear_right_wheel   
  position    :  [0, 0, 0, 0]
  velocity    :  [1.2, 1.2, 1.2, 1.2]
  effort      :  [0.5, 0.5, 0.5, 0.5]
---

  MessageType :  sensor_msgs/JointState
  header         
    MessageType :  std_msgs/Header
    stamp          
      MessageType :  builtin_interfaces/Time
      sec         :  0
      nanosec     :  0
    frame_id    :  
  name        :  {1}  front_left_wheel   {2}  front_right_wheel   {3}  rear_left_wheel   {4}  rear_right_wheel   
  position    :  [0, 0, 0, 0]
  velocity    :  [1.2, 1.2, 1.2, 1.2]
  effort      :  [0.5, 0.5, 0.5, 0.5]
---
.
.
.

Echo with Truncated Output

Sensor topics such as LiDAR point clouds carry large data arrays. Use -truncate-length to limit array display to a specified number of elements for readability.

ros2 topic echo /sensing/lidar/top/pointcloud -truncate-length 16
Listening to topic "/sensing/lidar/top/pointcloud" [sensor_msgs/PointCloud2]

You can see the sensor_msgs/PointCloud2 message fields with the data array truncated to 16 elements instead of the full 256-byte payload. Truncating the array makes it easier to inspect the message structure without flooding the Command Window. Click Ctrl+C to stop echoing.

Here is a part of the output:

MessageType  :  sensor_msgs/PointCloud2
  header          
    MessageType :  std_msgs/Header
    stamp          
      MessageType :  builtin_interfaces/Time
      sec         :  0
      nanosec     :  0
    frame_id    :  lidar_top
  height       :  1
  width        :  1024
  fields          
    MessageType :  sensor_msgs/PointField
    INT8        :  1
    UINT8       :  2
    INT16       :  3
    UINT16      :  4
    INT32       :  5
    UINT32      :  6
    FLOAT32     :  7
    FLOAT64     :  8
    name        :  
    offset      :  0
    datatype    :  0
    count       :  0
  is_bigendian :  0
  point_step   :  16
  row_step     :  16384
  data         :  [44, 180, 11, 143, 204, 136, 166, 68, 2, 221, 132, 127, 151, 210, 114, 129... (output truncated at 16 array elements)]
  is_dense     :  1
---

  MessageType  :  sensor_msgs/PointCloud2
  header          
    MessageType :  std_msgs/Header
    stamp          
      MessageType :  builtin_interfaces/Time
      sec         :  0
      nanosec     :  0
    frame_id    :  lidar_top
  height       :  1
  width        :  1024
  fields          
    MessageType :  sensor_msgs/PointField
    INT8        :  1
    UINT8       :  2
    INT16       :  3
    UINT16      :  4
    INT32       :  5
    UINT32      :  6
    FLOAT32     :  7
    FLOAT64     :  8
    name        :  
    offset      :  0
    datatype    :  0
    count       :  0
  is_bigendian :  0
  point_step   :  16
  row_step     :  16384
  data         :  [193, 24, 42, 254, 78, 154, 238, 146, 229, 150, 188, 66, 90, 143, 88, 105... (output truncated at 16 array elements)]
  is_dense     :  1
---
.
.
.

Echo with Full-Length Output

When you need to see the complete message data (for example, to verify all bytes in a sensor payload), use -full-length to disable truncation entirely.

ros2 topic echo /sensing/camera/front/image_raw -full-length
Listening to topic "/sensing/camera/front/image_raw" [sensor_msgs/Image]

You can see the full sensor_msgs/Image message including the complete data array. The full output is useful for debugging sensor data integrity. Click Ctrl+C to stop echoing.

Here is a part of the output:

MessageType  :  sensor_msgs/Image
  header          
    MessageType :  std_msgs/Header
    stamp          
      MessageType :  builtin_interfaces/Time
      sec         :  0
      nanosec     :  0
    frame_id    :  camera_front
  height       :  480
  width        :  640
  encoding     :  rgb8
  is_bigendian :  0
  step         :  1920
  data         :  [25, 67, 85, 174, 34, 184, 27, 167, 126, 199, 183, 231, 228, 85, 178, 50, 7, 190, 128, 122, 231, 156, 158, 220, 206, 147, 46, 61, 226, 7, 125, 42, 250, 182, 128, 120, 15, 174, 10, 18, 133, 24, 209, 209, 184, 38, 168, 132, 249, 166, 204, 116, 110, 211, 21, 34, 44, 100, 212, 205, 15, 102, 134, 106, 168, 160, 74, 110, 3, 251, 42, 27, 95, 50, 125, 86, 243, 235, 13, 188, 68, 108, 140, 241, 106, 251, 77, 179, 170, 138, 178, 170, 45, 32, 255, 43, 8, 143, 225, 171, 48, 94, 117, 251, 40, 219, 165, 96, 48, 109, 123, 30, 150, 57, 98, 149, 64, 74, 157, 67, 211, 251, 186, 88, 149, 27, 232, 225, 209, 66, 152, 5, 108, 80, 41, 45, 108, 24, 153, 120, 178, 179, 163, 8, 17, 81, 135, 167, 104, 209, 183, 247, 136, 83, 27, 156, 199, 108, 23, 68, 39, 71, 112, 134, 117, 224, 132, 241, 163, 245, 61, 173, 74, 171, 177, 17, 65, 57, 170, 216, 88, 199, 172, 1, 154, 99, 234, 0, 118, 108, 117, 197, 82, 200, 120, 9, 45, 184, 121, 39, 87, 155, 49, 189, 62, 234, 68, 195, 48, 73, 23, 147, 174, 139, 108, 164, 165, 173, 162, 241, 53, 181, 60, 30, 155, 115, 117, 169, 197, 89, 169, 106, 215, 213, 65, 157, 149, 138, 222, 67, 81, 30, 240, 165, 122, 163, 139, 165, 139, 184, 133, 254, 55, 27, 28, 16, 103, 114, 93, 195, 160, 197, 238, 249, 49, 35, 178, 24, 134, 135, 220, 124, 100, 171, 189, 133, 89, 38, 150, 67, 11, 193, 62, 113, 176, 91, 188, 101, 174, 180, 113, 5, 84, 108, 69, 50, 210, 110, 227, 100, 196, 101, 206, 193, 96, 55, 202, 243, 83, 171, 112, 213, 196, 42, 220, 253, 131, 226, 150, 39, 51, 104, 191, 211, 202, 81, 136, 23, 28, 34, 173, 126, 48, 126, 37, 14, 217, 143, 237, 178, 149, 208, 225, 253, 0, 221, 156, 253, 135, 122, 205, 58, 127, 230, 147, 216, 189, 150, 63, 170, 21, 160, 169, 186, 228, 251, 196, 148, 237, 148, 4, 30, 220, 123, 216, 53, 141, 161, 8, 157, 92, 12, 125, 49, 31, 52, 37, 48, 10, 162, 72, 137, 177, 127, 137, 113, 31, 125, 218, 223, 69, 53, 144, 163, 106, 52, 242, 21, 27, 36, 42, 158, 146, 13, 238, 186, 188, 16, 220, 239, 252, 219, 201, 131, 45, 102, 34, 7, 240, 77, 75, 85, 119, 165, 6, 215, 143, 218, 89, 114, 13, 45, 169, 84, 230, 30, 253, 138, 180, 255, 73, 106, 118, 195, 209, 25, 45, 92, 14, 133, 85, 44, 53, 231, 172, 119, 233, 26, 190, 188, 143, 47, 152, 76, 34, 54, 229, 18, 62, 13, 113, 3, 229, 50, 23, 78, 116, 26, 254, 85, 76, 15, 76, 11, 129, 194, 161, 23, 20, 198, 231, 136, 27, 211, 86, 75, 191, 2, 12, 170, 154, 134]
---

  MessageType  :  sensor_msgs/Image
  header          
    MessageType :  std_msgs/Header
    stamp          
      MessageType :  builtin_interfaces/Time
      sec         :  0
      nanosec     :  0
    frame_id    :  camera_front
  height       :  480
  width        :  640
  encoding     :  rgb8
  is_bigendian :  0
  step         :  1920
  data         :  [25, 67, 85, 174, 34, 184, 27, 167, 126, 199, 183, 231, 228, 85, 178, 50, 7, 190, 128, 122, 231, 156, 158, 220, 206, 147, 46, 61, 226, 7, 125, 42, 250, 182, 128, 120, 15, 174, 10, 18, 133, 24, 209, 209, 184, 38, 168, 132, 249, 166, 204, 116, 110, 211, 21, 34, 44, 100, 212, 205, 15, 102, 134, 106, 168, 160, 74, 110, 3, 251, 42, 27, 95, 50, 125, 86, 243, 235, 13, 188, 68, 108, 140, 241, 106, 251, 77, 179, 170, 138, 178, 170, 45, 32, 255, 43, 8, 143, 225, 171, 48, 94, 117, 251, 40, 219, 165, 96, 48, 109, 123, 30, 150, 57, 98, 149, 64, 74, 157, 67, 211, 251, 186, 88, 149, 27, 232, 225, 209, 66, 152, 5, 108, 80, 41, 45, 108, 24, 153, 120, 178, 179, 163, 8, 17, 81, 135, 167, 104, 209, 183, 247, 136, 83, 27, 156, 199, 108, 23, 68, 39, 71, 112, 134, 117, 224, 132, 241, 163, 245, 61, 173, 74, 171, 177, 17, 65, 57, 170, 216, 88, 199, 172, 1, 154, 99, 234, 0, 118, 108, 117, 197, 82, 200, 120, 9, 45, 184, 121, 39, 87, 155, 49, 189, 62, 234, 68, 195, 48, 73, 23, 147, 174, 139, 108, 164, 165, 173, 162, 241, 53, 181, 60, 30, 155, 115, 117, 169, 197, 89, 169, 106, 215, 213, 65, 157, 149, 138, 222, 67, 81, 30, 240, 165, 122, 163, 139, 165, 139, 184, 133, 254, 55, 27, 28, 16, 103, 114, 93, 195, 160, 197, 238, 249, 49, 35, 178, 24, 134, 135, 220, 124, 100, 171, 189, 133, 89, 38, 150, 67, 11, 193, 62, 113, 176, 91, 188, 101, 174, 180, 113, 5, 84, 108, 69, 50, 210, 110, 227, 100, 196, 101, 206, 193, 96, 55, 202, 243, 83, 171, 112, 213, 196, 42, 220, 253, 131, 226, 150, 39, 51, 104, 191, 211, 202, 81, 136, 23, 28, 34, 173, 126, 48, 126, 37, 14, 217, 143, 237, 178, 149, 208, 225, 253, 0, 221, 156, 253, 135, 122, 205, 58, 127, 230, 147, 216, 189, 150, 63, 170, 21, 160, 169, 186, 228, 251, 196, 148, 237, 148, 4, 30, 220, 123, 216, 53, 141, 161, 8, 157, 92, 12, 125, 49, 31, 52, 37, 48, 10, 162, 72, 137, 177, 127, 137, 113, 31, 125, 218, 223, 69, 53, 144, 163, 106, 52, 242, 21, 27, 36, 42, 158, 146, 13, 238, 186, 188, 16, 220, 239, 252, 219, 201, 131, 45, 102, 34, 7, 240, 77, 75, 85, 119, 165, 6, 215, 143, 218, 89, 114, 13, 45, 169, 84, 230, 30, 253, 138, 180, 255, 73, 106, 118, 195, 209, 25, 45, 92, 14, 133, 85, 44, 53, 231, 172, 119, 233, 26, 190, 188, 143, 47, 152, 76, 34, 54, 229, 18, 62, 13, 113, 3, 229, 50, 23, 78, 116, 26, 254, 85, 76, 15, 76, 11, 129, 194, 161, 23, 20, 198, 231, 136, 27, 211, 86, 75, 191, 2, 12, 170, 154, 134]
---
.
.
.

Find Topics by Message Type

Use topic find to search for all topics that use a specific message type. You can use this syntax to discover all sensor streams of a particular type across the network.

topicNames = ros2("topic","find","sensor_msgs/PointCloud2")
topicNames = 1×1 cell array
    {'/sensing/lidar/top/pointcloud'}

You can see that the function returns the /sensing/lidar/top/pointcloud topic using the sensor_msgs/PointCloud2 message type.

Inspect LiDAR Point Cloud Topic in Detail

Use topic info with -verbose to see the full QoS profiles of publishers and subscribers. The -verbose output is useful for diagnosing communication issues caused by QoS mismatches between nodes.

ros2 topic info /sensing/lidar/top/pointcloud -verbose
Publisher Count: 1
                           nodename: 'lidar_driver'
                      nodenamespace: '/'
                          topictype: 'sensor_msgs/msg/PointCloud2'
                       endpointtype: 'Publisher'
                         qoshistory: 'KeepLast'
                           qosdepth: 10
                     qosreliability: 'Reliable'
                      qosdurability: 'Volatile'
                        qosdeadline: 9.2234e+09
                        qoslifespan: 9.2234e+09
                      qosliveliness: 'Automatic'
                   qosleaseduration: 9.2234e+09
    qosavoidrosnamespaceconventions: 0

Subscriber Count: 1
                           nodename: 'perception_pipeline'
                      nodenamespace: '/'
                          topictype: 'sensor_msgs/msg/PointCloud2'
                       endpointtype: 'Subscriber'
                         qoshistory: 'KeepLast'
                           qosdepth: 10
                     qosreliability: 'Reliable'
                      qosdurability: 'Volatile'
                        qosdeadline: 9.2234e+09
                        qoslifespan: 9.2234e+09
                      qosliveliness: 'Automatic'
                   qosleaseduration: 9.2234e+09
    qosavoidrosnamespaceconventions: 0

You can see the message type, the number of publishers and subscribers, and detailed QoS settings for each endpoint. This information helps identify mismatches that could prevent message delivery.

Stop the timers and clear the workspace to shut down the network.

t = timerfind;
stop(t);
delete(t);

Run the helper script attached to this example to generate a ROS 2 network that simulates an autonomous lane driving scenario. The network includes nodes for perception, planning, and behavior control, along with services for intersection management and plugin configuration, and actions for trajectory execution and path following. You can use this network to introspect nodes and services directly from MATLAB®.

exampleHelperROS2LaneDrivingNetwork
pause(2) % Allow time for DDS discovery to register all nodes

List All Nodes

List all nodes currently active on the ROS 2 network to see the functional modules in this lane driving system.

ros2 node list
/axle_joint_state_publisher
/lane_change_executor
/path_follower
/perception/object_recognition/tracking/multi_object_tracker
/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor
/perception/traffic_light_recognition/traffic_light_multi_camera_fusion
/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner
/robot_info_logger
/robot_state_publisher
/trajectory_controller

You can see nodes representing different functional modules in the autonomous driving stack, such as /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner, /perception/object_recognition/tracking/multi_object_tracker, /trajectory_controller, /path_follower, and /robot_state_publisher.

List Nodes on Specific Domain

In a multi-domain setup, different subsystems may run on different domains. Use DomainID to query a specific domain. By default, DomainID is 0 unless otherwise specified by the ROS_DOMAIN_ID environment variable.

nodeList = ros2("node","list",DomainID=0)
nodeList = 11×1 cell
    {'/axle_joint_state_publisher'                                                                   }
    {'/lane_change_executor'                                                                         }
    {'/path_follower'                                                                                }
    {'/perception/object_recognition/tracking/multi_object_tracker'                                  }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor'}
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion'                       }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner'              }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner'          }
    {'/robot_info_logger'                                                                            }
    {'/robot_state_publisher'                                                                        }
    {'/trajectory_controller'                                                                        }

You will see the same list of nodes since this network runs on domain 0. Specifying a different domain ID (for example, DomainID=1) would show nodes on that domain instead, which is useful when multiple ROS 2 subsystems are isolated by domain.

Include Hidden Nodes

Some ROS 2 middleware components register hidden nodes (prefixed with _). Use the -all flag to reveal container nodes and internal service nodes that manage the lifecycle of other components.

ros2 node list -all
/path_follower
/perception/traffic_light_recognition/traffic_light_multi_camera_fusion
/robot_info_logger
/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner
/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor
/trajectory_controller
/robot_state_publisher
/perception/object_recognition/tracking/multi_object_tracker
/lane_change_executor
/axle_joint_state_publisher
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner
/_matlab_introspec__0_rmw_cyclonedds_cpp

You will find additional hidden nodes prefixed with _ such as /_matlab_introspec__1_rmw_cyclonedds_cpp that are used internally by the ROS 2 middleware for parameter management and introspection.

Inspect Trajectory Controller Node

Use node info to see all publishers, subscribers, services, and actions associated with a node. Add -all to also show hidden topics and services.

ros2 node info /trajectory_controller -all
/trajectory_controller
  Subscribers:
            Topic                          Type               
    _____________________    _________________________________

    {'/cmd_vel'         }    {'geometry_msgs/Twist'          }
    {'/parameter_events'}    {'rcl_interfaces/ParameterEvent'}

  Publishers:
                     Topic                                          Type                     
    _______________________________________    ______________________________________________

    {'/cmd_vel'                           }    {'geometry_msgs/Twist'                       }
    {'/follow_trajectory/_action/feedback'}    {'control_msgs/FollowJointTrajectoryFeedback'}
    {'/follow_trajectory/_action/status'  }    {'action_msgs/GoalStatusArray'               }
    {'/parameter_events'                  }    {'rcl_interfaces/ParameterEvent'             }
    {'/rosout'                            }    {'rcl_interfaces/Log'                        }

  Service Servers:
                          Service                                                    Type                          
    ____________________________________________________    _______________________________________________________

    {'/follow_trajectory/_action/cancel_goal'          }    {'action_msgs/CancelGoal'                             }
    {'/follow_trajectory/_action/get_result'           }    {'control_msgs/action/FollowJointTrajectory_GetResult'}
    {'/follow_trajectory/_action/send_goal'            }    {'control_msgs/action/FollowJointTrajectory_SendGoal' }
    {'/trajectory_controller/describe_parameters'      }    {'rcl_interfaces/DescribeParameters'                  }
    {'/trajectory_controller/get_parameter_types'      }    {'rcl_interfaces/GetParameterTypes'                   }
    {'/trajectory_controller/get_parameters'           }    {'rcl_interfaces/GetParameters'                       }
    {'/trajectory_controller/get_type_description'     }    {'type_description_interfaces/GetTypeDescription'     }
    {'/trajectory_controller/list_parameters'          }    {'rcl_interfaces/ListParameters'                      }
    {'/trajectory_controller/set_parameters'           }    {'rcl_interfaces/SetParameters'                       }
    {'/trajectory_controller/set_parameters_atomically'}    {'rcl_interfaces/SetParametersAtomically'             }

  Service Clients:
  Action Servers:
            Action                             Type                 
    ______________________    ______________________________________

    {'/follow_trajectory'}    {'control_msgs/FollowJointTrajectory'}

  Action Clients:

You can see that this node hosts the /follow_trajectory action server, publishes to /cmd_vel (type geometry_msgs/Twist), and subscribes to velocity commands. With -all, you also see its hidden service endpoints such as describe_parameters, get_parameters, and set_parameters used for parameter management.

List Services with Type Information

Services in this network provide dynamic control over planning and perception modules. List all services with their types to identify available configuration endpoints.

ros2 service list -show-types
                                                              Service                                                                                  MessageType                    
    ____________________________________________________________________________________________________________________________    __________________________________________________

    {'/axle_joint_state_publisher/describe_parameters'                                                                         }    {'rcl_interfaces/DescribeParameters'             }
    {'/axle_joint_state_publisher/get_parameter_types'                                                                         }    {'rcl_interfaces/GetParameterTypes'              }
    {'/axle_joint_state_publisher/get_parameters'                                                                              }    {'rcl_interfaces/GetParameters'                  }
    {'/axle_joint_state_publisher/get_type_description'                                                                        }    {'type_description_interfaces/GetTypeDescription'}
    {'/axle_joint_state_publisher/list_parameters'                                                                             }    {'rcl_interfaces/ListParameters'                 }
    {'/axle_joint_state_publisher/set_parameters'                                                                              }    {'rcl_interfaces/SetParameters'                  }
    {'/axle_joint_state_publisher/set_parameters_atomically'                                                                   }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/lane_change_executor/describe_parameters'                                                                               }    {'rcl_interfaces/DescribeParameters'             }
    {'/lane_change_executor/get_parameter_types'                                                                               }    {'rcl_interfaces/GetParameterTypes'              }
    {'/lane_change_executor/get_parameters'                                                                                    }    {'rcl_interfaces/GetParameters'                  }
    {'/lane_change_executor/get_type_description'                                                                              }    {'type_description_interfaces/GetTypeDescription'}
    {'/lane_change_executor/list_parameters'                                                                                   }    {'rcl_interfaces/ListParameters'                 }
    {'/lane_change_executor/set_parameters'                                                                                    }    {'rcl_interfaces/SetParameters'                  }
    {'/lane_change_executor/set_parameters_atomically'                                                                         }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/path_follower/describe_parameters'                                                                                      }    {'rcl_interfaces/DescribeParameters'             }
    {'/path_follower/get_parameter_types'                                                                                      }    {'rcl_interfaces/GetParameterTypes'              }
    {'/path_follower/get_parameters'                                                                                           }    {'rcl_interfaces/GetParameters'                  }
    {'/path_follower/get_type_description'                                                                                     }    {'type_description_interfaces/GetTypeDescription'}
    {'/path_follower/list_parameters'                                                                                          }    {'rcl_interfaces/ListParameters'                 }
    {'/path_follower/set_parameters'                                                                                           }    {'rcl_interfaces/SetParameters'                  }
    {'/path_follower/set_parameters_atomically'                                                                                }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/perception/object_recognition/tracking/multi_object_tracker/describe_parameters'                                        }    {'rcl_interfaces/DescribeParameters'             }
    {'/perception/object_recognition/tracking/multi_object_tracker/get_parameter_types'                                        }    {'rcl_interfaces/GetParameterTypes'              }
    {'/perception/object_recognition/tracking/multi_object_tracker/get_parameters'                                             }    {'rcl_interfaces/GetParameters'                  }
    {'/perception/object_recognition/tracking/multi_object_tracker/get_type_description'                                       }    {'type_description_interfaces/GetTypeDescription'}
    {'/perception/object_recognition/tracking/multi_object_tracker/list_parameters'                                            }    {'rcl_interfaces/ListParameters'                 }
    {'/perception/object_recognition/tracking/multi_object_tracker/set_parameters'                                             }    {'rcl_interfaces/SetParameters'                  }
    {'/perception/object_recognition/tracking/multi_object_tracker/set_parameters_atomically'                                  }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/describe_parameters'      }    {'rcl_interfaces/DescribeParameters'             }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/get_parameter_types'      }    {'rcl_interfaces/GetParameterTypes'              }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/get_parameters'           }    {'rcl_interfaces/GetParameters'                  }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/get_type_description'     }    {'type_description_interfaces/GetTypeDescription'}
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/list_parameters'          }    {'rcl_interfaces/ListParameters'                 }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/set_parameters'           }    {'rcl_interfaces/SetParameters'                  }
    {'/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor/set_parameters_atomically'}    {'rcl_interfaces/SetParametersAtomically'        }
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/describe_parameters'                             }    {'rcl_interfaces/DescribeParameters'             }
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/get_parameter_types'                             }    {'rcl_interfaces/GetParameterTypes'              }
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/get_parameters'                                  }    {'rcl_interfaces/GetParameters'                  }
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/get_type_description'                            }    {'type_description_interfaces/GetTypeDescription'}
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/list_parameters'                                 }    {'rcl_interfaces/ListParameters'                 }
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/set_parameters'                                  }    {'rcl_interfaces/SetParameters'                  }
    {'/perception/traffic_light_recognition/traffic_light_multi_camera_fusion/set_parameters_atomically'                       }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/planning/enable_auto_mode/intersection'                                                                                 }    {'std_srvs/Empty'                                }
    {'/planning/enable_auto_mode/intersection_occlusion'                                                                       }    {'std_srvs/Empty'                                }
    {'/planning/enable_auto_mode/lane_change_left'                                                                             }    {'std_srvs/Empty'                                }
    {'/planning/enable_auto_mode/lane_change_right'                                                                            }    {'std_srvs/Empty'                                }
    {'/planning/enable_auto_mode/start_planner'                                                                                }    {'std_srvs/Empty'                                }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/describe_parameters'                    }    {'rcl_interfaces/DescribeParameters'             }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/get_parameter_types'                    }    {'rcl_interfaces/GetParameterTypes'              }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/get_parameters'                         }    {'rcl_interfaces/GetParameters'                  }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/get_type_description'                   }    {'type_description_interfaces/GetTypeDescription'}
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/list_parameters'                        }    {'rcl_interfaces/ListParameters'                 }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/set_parameters'                         }    {'rcl_interfaces/SetParameters'                  }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/set_parameters_atomically'              }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/config_logger'                      }    {'std_srvs/Empty'                                }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/describe_parameters'                }    {'rcl_interfaces/DescribeParameters'             }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/get_parameter_types'                }    {'rcl_interfaces/GetParameterTypes'              }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/get_parameters'                     }    {'rcl_interfaces/GetParameters'                  }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/get_type_description'               }    {'type_description_interfaces/GetTypeDescription'}
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/list_parameters'                    }    {'rcl_interfaces/ListParameters'                 }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/service/load_plugin'                }    {'std_srvs/Empty'                                }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/service/unload_plugin'              }    {'std_srvs/Empty'                                }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/set_parameters'                     }    {'rcl_interfaces/SetParameters'                  }
    {'/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/set_parameters_atomically'          }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/robot_info_logger/describe_parameters'                                                                                  }    {'rcl_interfaces/DescribeParameters'             }
    {'/robot_info_logger/get_parameter_types'                                                                                  }    {'rcl_interfaces/GetParameterTypes'              }
    {'/robot_info_logger/get_parameters'                                                                                       }    {'rcl_interfaces/GetParameters'                  }
    {'/robot_info_logger/get_type_description'                                                                                 }    {'type_description_interfaces/GetTypeDescription'}
    {'/robot_info_logger/list_parameters'                                                                                      }    {'rcl_interfaces/ListParameters'                 }
    {'/robot_info_logger/set_parameters'                                                                                       }    {'rcl_interfaces/SetParameters'                  }
    {'/robot_info_logger/set_parameters_atomically'                                                                            }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/robot_state_publisher/describe_parameters'                                                                              }    {'rcl_interfaces/DescribeParameters'             }
    {'/robot_state_publisher/get_parameter_types'                                                                              }    {'rcl_interfaces/GetParameterTypes'              }
    {'/robot_state_publisher/get_parameters'                                                                                   }    {'rcl_interfaces/GetParameters'                  }
    {'/robot_state_publisher/get_type_description'                                                                             }    {'type_description_interfaces/GetTypeDescription'}
    {'/robot_state_publisher/list_parameters'                                                                                  }    {'rcl_interfaces/ListParameters'                 }
    {'/robot_state_publisher/set_parameters'                                                                                   }    {'rcl_interfaces/SetParameters'                  }
    {'/robot_state_publisher/set_parameters_atomically'                                                                        }    {'rcl_interfaces/SetParametersAtomically'        }
    {'/trajectory_controller/describe_parameters'                                                                              }    {'rcl_interfaces/DescribeParameters'             }
    {'/trajectory_controller/get_parameter_types'                                                                              }    {'rcl_interfaces/GetParameterTypes'              }
    {'/trajectory_controller/get_parameters'                                                                                   }    {'rcl_interfaces/GetParameters'                  }
    {'/trajectory_controller/get_type_description'                                                                             }    {'type_description_interfaces/GetTypeDescription'}
    {'/trajectory_controller/list_parameters'                                                                                  }    {'rcl_interfaces/ListParameters'                 }
    {'/trajectory_controller/set_parameters'                                                                                   }    {'rcl_interfaces/SetParameters'                  }
    {'/trajectory_controller/set_parameters_atomically'                                                                        }    {'rcl_interfaces/SetParametersAtomically'        }

You will find services such as /planning/enable_auto_mode/intersection and /planning/enable_auto_mode/lane_change_left of type std_srvs/Empty, plugin management services like /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/service/load_plugin, and action-related services like /follow_trajectory/_action/send_goal.

Find Services by Type

Search for all services that use a specific service type. This helps identify which configuration or control endpoints share the same interface.

ros2 service find std_srvs/Empty
/planning/enable_auto_mode/intersection
/planning/enable_auto_mode/intersection_occlusion
/planning/enable_auto_mode/lane_change_left
/planning/enable_auto_mode/lane_change_right
/planning/enable_auto_mode/start_planner
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/config_logger
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/service/load_plugin
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/service/unload_plugin

You can see all services using the std_srvs/Empty type, including /planning/enable_auto_mode/intersection, /planning/enable_auto_mode/lane_change_left, /planning/enable_auto_mode/lane_change_right, and the plugin management services on the behavior velocity planner.

Inspect Planning Service

Get detailed information about a specific service to see which node hosts the server and which nodes are connected as clients. This helps verify that the planning module is correctly wired to its dependents.

ros2 service info /planning/enable_auto_mode/intersection
Service Type: std_srvs/Empty
Clients Count: 0
ServicesCount: 1

You can see that the service type is std_srvs/Empty and the server is hosted by the /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner node. This service enables autonomous intersection handling when called by a client.

This example shows how to use the ros2 function to discover actions and parameters in an autonomous lane driving network. Actions represent long-running tasks like trajectory execution, while parameters expose tunable configuration values on each node.

Load ROS 2 Network

Run the helper script to generate the lane driving ROS 2 network. This network includes action servers for trajectory following, path following, and lane change execution.

exampleHelperROS2LaneDrivingNetwork
pause(2) % Allow time for DDS discovery to register all entities

List All Actions with Types

Actions are used for long-running tasks such as trajectory execution or lane change maneuvers. List all actions with their types to understand what goal-oriented capabilities the network offers.

ros2 action list -show-types
             Action                          MessageType              
    ________________________    ______________________________________

    {'/execute_lane_change'}    {'control_msgs/FollowJointTrajectory'}
    {'/follow_path'        }    {'control_msgs/FollowJointTrajectory'}
    {'/follow_trajectory'  }    {'control_msgs/FollowJointTrajectory'}


Open ros2NetworkAnalyzer to visualize your live ROS 2 network graph with nodes, topics, services, actions, and their connections.

You can see three actions on the network: /follow_trajectory, /follow_path, and /execute_lane_change, all of type control_msgs/FollowJointTrajectory. These represent the trajectory execution, path following, and lane change capabilities of the control layer.

Get Action Type

Query the type of a specific action to understand what goal, feedback, and result message structures it uses.

ros2 action type /follow_trajectory
control_msgs/FollowJointTrajectory

You will see the type control_msgs/FollowJointTrajectory, which defines the goal (desired trajectory), feedback (current progress), and result (success/failure) message structures for trajectory execution.

Get Action Information

Inspect a specific action to see which node hosts the action server and which nodes are connected as action clients. This verifies that the planner-to-controller pipeline is properly wired.

ros2 action info /execute_lane_change
Action Type: control_msgs/FollowJointTrajectory
Action Client: 1
    /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner
Action Server: 1
    /lane_change_executor

You will find that the action server is hosted by the /lane_change_executor node and the action client is on the /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner node.

List Parameters on All Nodes

Parameters let you tune node behavior at runtime. List all parameters across nodes in the network to get a full picture of tunable configuration values.

ros2 param list
/axle_joint_state_publisher:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/lane_change_executor:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/path_follower:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/perception/object_recognition/tracking/multi_object_tracker:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/perception/traffic_light_recognition/camera6/classification/traffic_light_occlusion_predictor:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/perception/traffic_light_recognition/traffic_light_multi_camera_fusion:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/robot_info_logger:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/robot_state_publisher:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time
/trajectory_controller:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time

You will see parameters listed per node, including standard ROS 2 parameters such as use_sim_time and qos_overrides on each node. Every node automatically exposes these parameters for runtime configuration.

List Parameters on Behavior Velocity Planner

Narrow the parameter listing to the behavior velocity planner node to see what configuration knobs are available for adjusting planning behavior at intersections and crosswalks.

ros2 param list /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner
/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner:
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  start_type_description_service
  use_sim_time

You can see only the parameters belonging to this specific node, making it easier to inspect and modify its configuration without scrolling through parameters from all other nodes in the network.

Describe Specific Parameter

Use param describe to get metadata about a parameter, including its data type, current value, description, and constraints. This is useful for understanding what values are valid before modifying runtime configuration.

ros2 param describe /planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner use_sim_time
               MessageType: 'rcl_interfaces/ParameterDescriptor'
                      name: 'use_sim_time'
                      type: 1
               description: ''
    additional_constraints: ''
                 read_only: 0
            dynamic_typing: 0
      floating_point_range: [0×1 struct]
             integer_range: [0×1 struct]

You will find that use_sim_time is a boolean parameter that determines whether the node uses simulated time or wall-clock time. The output includes its data type, current value, and any additional constraints.

Input Arguments

collapse all

Message

Message type, specified as a string scalar or character vector. The value is case-sensitive and no partial matches are allowed. It must match a message on the list given by calling ros2("msg","list").

Function syntax:

Example: ros2("msg","show","sensor_msgs/LaserScan")

Command syntax:

Example: ros2 msg show sensor_msgs/LaserScan

Data Types: char | string

Topic

Topic name, specified as a string scalar or character vector. The value is case-sensitive and no partial matches are allowed. It must match a topic on the list given by calling ros2("topic","list").

Function syntax:

Example: ros2("topic","info","/scan")

Command syntax:

Example: ros2 topic info /scan

Data Types: char | string

Topic message type, specified as a string scalar or character vector. The value is case-sensitive and no partial matches are allowed. It must match a message type on the list given by calling ros2("msg","list").

Function syntax:

Example: ros2("topic","find","std_msgs/String")

Command syntax:

Example: ros2 topic find std_msgs/String

Data Types: char | string

Node

Node name, specified as a string scalar or character vector. The value is case-sensitive and no partial matches are allowed. It must match a node on the list given by calling ros2("node","list").

Function syntax:

Example: ros2("node","info","/turtlesim")

Command syntax:

Example: ros2 node info /turtlesim

Data Types: char | string

Service

Service name, specified as a string or character vector. The value is case-sensitive and no partial matches are allowed. It must match a service on the list given by calling ros2("service","list").

Function syntax:

Example: ros2("service","type","/set_bool")

Command syntax:

Example: ros2 service type /set_bool

Data Types: char | string

Service type, specified as a string scalar or character vector. The value is case-sensitive and no partial matches are allowed. It must match a service type on the network.

Function syntax:

Example: ros2("service","find","std_srvs/SetBool")

Command syntax:

Example: ros2 service find std_srvs/SetBool

Data Types: char | string

Action

Action name, specified as a string or character vector. The value is case-sensitive and no partial matches are allowed. It must match an action on the list given by calling ros2("action","list").

Function syntax:

Example: ros2("action","type","/navigate_to_pose")

Command syntax:

Example: ros2 action type /navigate_to_pose

Data Types: char | string

Parameter

Parameter name, specified as a string scalar or character vector. The value is case-sensitive and no partial matches are allowed. It must match a parameter on the list given by calling ros2("param","list").

Function syntax:

Example: ros2("param","describe","/turtlesim","use_sim_time")

Command syntax:

Example: ros2 param describe /turtlesim use_sim_time

Data Types: char | string

Bag

Path to the ROS 2 bag files, specified as a string scalar or character vector.

Note

The folder must contain a ROS 2 bag database file (.db3) and a metadata.yaml file that stores metadata about the bag. The folder name must match the name of the ROS 2 bag file.

Function syntax:

Example: ros2("bag","info","C:\Users\alltopics")

Command syntax:

Example: ros2 bag info C:\Users\alltopics

Data Types: char | string

Network

ROS 2 network domain ID, specified as a nonnegative scalar integer between 0 and 232. By default, the value is 0 unless otherwise specified by the ROS_DOMAIN_ID environment variable.

This argument applies to all network introspection subcommands, including "topic","list", "node","list", "service","list", "action","list", and "param","list".

Note

The DomainID name-value argument applies only to information retrieved from the active network, such as node and topic lists. It does not apply to static ROS 2 data, such as message information.

The first time you call ros2 for a specific domain ID, not all network information might be immediately available. If ros2 returns incomplete network information, wait before calling the function again.

Example: ros2("topic","list",DomainID=1)

Data Types: double

Output Arguments

collapse all

Message

List of all message types available in MATLAB, returned as a cell array of character vectors.

Details of the information inside the ROS message definition, returned as a character vector.

Topic

List of topics on the ROS 2 network, returned as a cell array of character vectors.

Message type of the specified topic, returned as a string scalar.

Data Types: string

Detailed information about the specified topic, returned as a structure. The structure includes the message type, list of publishers, and list of subscribers for the topic.

Data Types: struct

List of topics on the ROS 2 network that use the specified message type, returned as a cell array of character vectors.

Node

List of node names available, returned as a cell array of character vectors.

Detailed information about the specified node, returned as a structure. The structure includes the publishers, subscribers, services, and actions associated with the node.

Data Types: struct

Service

List of services on the ROS 2 network, returned as a cell array of character vectors.

Service type of the specified service, returned as a string scalar.

Data Types: string

List of services on the ROS 2 network that use the specified service type, returned as a cell array of character vectors.

Detailed information about the specified service, returned as a structure. The structure includes the service type, server node, and client nodes.

Data Types: struct

Action

List of actions on the ROS 2 network, returned as a cell array of character vectors.

Action type of the specified action, returned as a string scalar.

Data Types: string

Detailed information about the specified action, returned as a structure. The structure includes the action type, action server node, and action client nodes.

Data Types: struct

Parameter

List of parameters available on the nodes in the ROS 2 network, returned as a cell array of character vectors.

Metadata about the specified parameter, returned as a structure. The structure includes the parameter type, description, and constraints.

Data Types: struct

Bag

Information about contents of the ROS 2 bag, returned as a structure. This structure contains fields related to the ROS 2 bag log file and its contents. This is an example of the contents returned as a structure:

         Path: 'C:\Users\alltopics.db3'
      Version: '1'
    StorageId: 'sqlite3'
     Duration: 102.396644003
        Start: [1×1 struct]
          End: [1×1 struct]
         Size: 4965433
     Messages: 36503
        Types: [5×1 struct]
       Topics: [5×1 struct]

Data Types: struct

Version History

Introduced in R2019b

expand all