Struct rmw_message_info_s

Struct Documentation

struct rmw_message_info_s

Information describing an rmw message.

Public Members

rmw_time_point_value_t source_timestamp

Time when the message was published by the publisher.

The exact point at which the timestamp is taken is not specified, but it should be taken consistently at the same point in the publishing process each time.

rmw_time_point_value_t received_timestamp

Time when the message was received by the subscription.

The exact point at which the timestamp is taken is not specified, but it should be taken consistently at the same point in the process of receiving a message each time.

uint64_t publication_sequence_number

Sequence number of the received message set by the publisher.

This sequence number is set by the publisher and therefore uniquely identifies a message when combined with the publisher GID. For long running applications, the sequence number might wrap around at some point.

If the rmw implementation doesn’t support sequence numbers, its value will be RMW_MESSAGE_INFO_SEQUENCE_NUMBER_UNSUPPORTED.

Requirements:

If psn1 and psn2 are the publication sequence numbers obtained by calls to rmw_take*(), where psn1 was obtained in a call that happened before psn2 and both sequence numbers are from the same publisher (i.e. also same publisher gid), then:

  • psn2 > psn1 (except in the case of a wrap around)

  • psn2 - psn1 - 1 is the number of messages the publisher sent in the middle of both received messages. Those might have already been taken by other rmw_take*() calls that happened in between or lost. psn2 - psn1 - 1 = 0 if and only if the messages were sent by the publisher consecutively.

uint64_t reception_sequence_number

Sequence number of the received message set by the subscription.

This sequence number is set by the subscription regardless of which publisher sent the message. For long running applications, the sequence number might wrap around at some point.

If the rmw implementation doesn’t support sequence numbers, its value will be RMW_MESSAGE_INFO_SEQUENCE_NUMBER_UNSUPPORTED.

Requirements:

If rsn1 and rsn2 are the reception sequence numbers obtained by calls to rmw_take*(), where rsn1 was obtained in a call that happened before rsn2, then:

  • rsn2 > rsn1 (except in the case of a wrap around)

  • rsn2 = rsn1 + 1 if and only if both rmw_take*() calls happened consecutively.

rmw_gid_t publisher_gid

Global unique identifier of the publisher that sent the message.

The identifier uniquely identifies the publisher for the local context, but it will not necessarily be the same identifier given in other contexts or processes for the same publisher. Therefore the identifier will uniquely identify the publisher within your application but may disagree about the identifier for that publisher when compared to another application. Even with this limitation, when combined with the publisher sequence number it can uniquely identify a message within your local context. Publisher GIDs generated by the rmw implementation could collide at some point, in which case it is not possible to distinguish which publisher sent the message. The details of how GIDs are generated are rmw implementation dependent.

It is possible the the rmw implementation needs to reuse a publisher GID, due to running out of unique identifiers or some other constraint, in which case the rmw implementation may document what happens in that case, but that behavior is not defined here. However, this should be avoided, if at all possible, by the rmw implementation, and should be unlikely to happen in practice.

Todo:

In the future we want this to uniquely identify the publisher globally across contexts, processes, and machines.

bool from_intra_process

Whether this message is from intra_process communication or not.