class

MessageInfo(rawInfo)

MessageInfo Contains metadata about a received message, including timestamps, sequence numbers, and the publisher's globally unique identifier (GID). This is the rclnodejs equivalent of rclpy's MessageInfo. It is passed as the second argument to subscription callbacks when the callback accepts two parameters.
Source:
Example
node.createSubscription(
  'std_msgs/msg/String',
  'topic',
  (msg, messageInfo) => {
    console.log('Source timestamp:', messageInfo.sourceTimestamp);
    console.log('Received at:', messageInfo.receivedTimestamp);
    console.log('Publisher GID:', messageInfo.publisherGid);
  }
);

Members

member

publicationSequenceNumber :bigint

The publication sequence number assigned by the publisher.
Type:
  • bigint
Source:
member

publisherGid :Buffer

The globally unique identifier (GID) of the publisher. A Buffer containing the raw GID bytes.
Type:
  • Buffer
Source:
member

receivedTimestamp :bigint

The timestamp when the message was received by the subscription (nanoseconds since epoch).
Type:
  • bigint
Source:
member

receptionSequenceNumber :bigint

The reception sequence number assigned by the subscriber.
Type:
  • bigint
Source:
member

sourceTimestamp :bigint

The timestamp when the message was published (nanoseconds since epoch).
Type:
  • bigint
Source:

Methods

function

toPlainObject() → {object}

Convert to a plain object representation.
Source:
Returns:
Plain object with all metadata fields
Type object