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.TopicReaderPrivate 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_dataorget_data_as_dfmethods onTopic,MessagePath, orEvent.- Parameters:
roboto_client (Optional[roboto.http.RobotoClient])
signed_url_resolver (Optional[SignedUrlResolver])
- 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
MessagePathRepresentationMappingpairs 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
Nonefor unbounded.end_time (Optional[int]) – Exclusive upper bound on message log time in nanoseconds, or
Nonefor 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_nameis 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:
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]
- class roboto.domain.topics.mcap_topic_reader.RobotoClientUrlResolver(roboto_client)#
A
SignedUrlResolverthat fetches signed URLs via the Roboto API.- Parameters:
roboto_client (roboto.http.RobotoClient)
- class roboto.domain.topics.mcap_topic_reader.SignedUrlResolver#
Bases:
ProtocolResolves a file ID to a signed download URL.
- roboto.domain.topics.mcap_topic_reader.logger#