Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.domain.topics.mcap_topic_reader

Module Contents

McapTopicReader

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

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.

Parameters

roboto_client Optional[roboto.http.RobotoClient]
signed_url_resolver Optional[SignedUrlResolver]

McapTopicReader.accepts()

static accepts(message_paths_to_representations)#View Source

Parameters

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

Return type

bool

McapTopicReader.get_data()

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

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

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]

McapTopicReader.get_data_as_df()

get_data_as_df(message_paths_to_representations, start_time=None, end_time=None, timestamp_message_path_representation_mapping=None)#View Source

Parameters

message_paths_to_representations collections.abc.Iterable[roboto.domain.topics.record.MessagePathRepresentationMapping]
start_time Optional[int]
end_time Optional[int]
timestamp_message_path_representation_mapping Optional[roboto.domain.topics.record.MessagePathRepresentationMapping]

Return type

tuple[pandas.Series, pandas.DataFrame]

RobotoClientUrlResolver

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

A SignedUrlResolver that fetches signed URLs via the Roboto API.

Parameters

SignedUrlResolver

class roboto.domain.topics.mcap_topic_reader.SignedUrlResolver#View Source

Bases: Protocol

Resolves a file ID to a signed download URL.

logger

roboto.domain.topics.mcap_topic_reader.logger#View Source

Was this page helpful?