Class: MessageIntrospector

MessageIntrospector(typeName)

A utility class for inspecting ROS 2 message structure without using loader.loadInterface directly. Provides access to message schema, field names, and default values.

Constructor

new MessageIntrospector(typeName)

Create a new MessageIntrospector for a ROS 2 message type.
Parameters:
Name Type Description
typeName string The full message type name (e.g., 'geometry_msgs/msg/Twist')
Source:
Throws:
  • If typeName is not a non-empty string
    Type
    TypeValidationError
  • If the message type cannot be loaded
    Type
    Error

Members

defaults

Get the default values for all fields. Creates a new instance of the message and converts it to a plain object. Result is cached for performance.
Source:

fields

Get the field names of the message.
Source:

schema

Get the ROSMessageDef schema for the message type.
Source:

typeClass

Get the underlying ROS message class.
Source:

typeName

Get the full message type name.
Source: