roboto.domain.topics.mcap_topic_reader#

Module Contents#

class roboto.domain.topics.mcap_topic_reader.McapTopicReader(roboto_client=None, signed_url_resolver=None)#

Bases: roboto.domain.topics.topic_reader.TopicReader

Private interface for retrieving topic data stored in MCAP files.

Uses HTTP Range requests to efficiently fetch only required chunks from remote storage, avoiding full file downloads.

Note

This is not intended as a public API. To access topic data, prefer the get_data or get_data_as_df methods on Topic, MessagePath, or Event.

Parameters:
static accepts(message_paths_to_representations)#
Parameters:

message_paths_to_representations (collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping])

Return type:

bool

get_data(message_paths_to_representations, start_time=None, end_time=None, timestamp_message_path_representation_mapping=None, topic_name=None)#

Yield (log_time, record) pairs from the mappings’ MCAP files in log-time order.

Each record merges the projected fields of one message from every file whose next message has that log time.

Parameters:
  • message_paths_to_representations (collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping]) – The message paths to read. Each MessagePathRepresentationMapping pairs message paths with the representation whose associated MCAP file stores them; a mapping whose representation is not associated with a file is skipped.

  • start_time (Optional[int]) – Inclusive lower bound on message log time in nanoseconds, or None for unbounded.

  • end_time (Optional[int]) – Exclusive upper bound on message log time in nanoseconds, or None for unbounded.

  • timestamp_message_path_representation_mapping (Optional[roboto.domain.topics.record.MessagePathRepresentationMapping]) – Not read; each row’s timestamp is the log time of the messages it merges.

  • topic_name (Optional[str]) – Read only messages on MCAP channels of this topic, or on every channel when None.

Yields:

The log time in nanoseconds and the merged record.

Raises:

RobotoInternalException – topic_name is given and a file’s summary lists no channel on that topic.

Return type:

collections.abc.Generator[tuple[roboto.domain.topics.topic_reader.Timestamp, dict[str, Any]], None, None]

get_data_as_df(message_paths_to_representations, start_time=None, end_time=None, timestamp_message_path_representation_mapping=None)#
Parameters:
Return type:

tuple[pandas.Series, pandas.DataFrame]

class roboto.domain.topics.mcap_topic_reader.RobotoClientUrlResolver(roboto_client)#

A SignedUrlResolver that fetches signed URLs via the Roboto API.

Parameters:

roboto_client (roboto.http.RobotoClient)

class roboto.domain.topics.mcap_topic_reader.SignedUrlResolver#

Bases: Protocol

Resolves a file ID to a signed download URL.

roboto.domain.topics.mcap_topic_reader.logger#