|
| | __bool__ (self) |
| |
| | __contains__ (self, key) |
| |
| | __copy__ (self) |
| |
| | __deepcopy__ (self, memo=None) |
| |
| | __enter__ (self) |
| |
| | __exit__ (self, exc_type, exc_value, traceback) |
| |
| | __getitem__ (self, key) |
| |
| | __iter__ (self) |
| |
| | __len__ (self) |
| |
| | __next__ (self) |
| |
| | __nonzero__ (self) |
| |
| | __str__ (self) |
| |
| | close (self) |
| |
| | closed (self) |
| |
| | filename (self) |
| |
| | flush (self) |
| |
| | get_end_time (self) |
| |
| | get_message_class (self, typename, typehash=None) |
| |
| | get_message_count (self, topic_filters=None) |
| |
| | get_message_definition (self, msg_or_type) |
| |
| | get_message_type_hash (self, msg_or_type) |
| |
| | get_qoses (self, topic, typename) |
| |
| | get_start_time (self) |
| |
| | get_topic_info (self, counts=True) |
| |
| | get_type_and_topic_info (self, topic_filters=None) |
| |
| | mode (self) |
| |
| | open (self) |
| |
| | read_messages (self, topics=None, start_time=None, end_time=None, raw=False, **__) |
| |
| | size (self) |
| |
| | stop_on_error (self) |
| |
| | stop_on_error (self, flag) |
| |
| | topics (self) |
| |
| | write (self, topic, msg, t=None, raw=False, **kwargs) |
| |
|
| | BagMessage = collections.namedtuple("BagMessage", "topic message timestamp") |
| | Returned from read_messages() as (topic name, ROS message, ROS timestamp object).
|
| |
| tuple | MODES = ("r", "w", "a") |
| | Supported opening modes, overridden in subclasses.
|
| |
| | next |
| |
| bool | STREAMABLE = True |
| | Whether bag supports reading or writing stream objects, overridden in subclasses.
|
| |
| | TopicTuple |
| | Returned from get_type_and_topic_info() as (typename, message count, connection count, median frequency).
|
| |
| | TypesAndTopicsTuple = collections.namedtuple("TypesAndTopicsTuple", ["msg_types", "topics"]) |
| | Returned from get_type_and_topic_info() as ({typename: typehash}, {topic name: TopicTuple}).
|
| |
ROS bag interface.
%Bag can be used a context manager, is an iterable providing (topic, message, timestamp) tuples
and supporting `len(bag)`; and supports topic-based membership
(`if mytopic in bag`, `for t, m, s in bag[mytopic]`, `len(bag[mytopic])`).
Extra methods and properties compared with rosbag.Bag: Bag.get_message_class(),
Bag.get_message_definition(), Bag.get_message_type_hash(), Bag.get_topic_info();
Bag.closed and Bag.topics.
Definition at line 85 of file api.py.
| get_topic_info |
( |
|
self, |
|
|
|
counts = True |
|
) |
| |
Returns topic and message type metainfo as {(topic, typename, typehash): count}.
@param counts if false, counts may be returned as None if lookup is costly
Reimplemented in EmbagReader, McapBag, ROS1Bag, and ROS2Bag.
Definition at line 227 of file api.py.
| get_type_and_topic_info |
( |
|
self, |
|
|
|
topic_filters = None |
|
) |
| |
Returns thorough metainfo on topic and message types.
@param topic_filters list of topics or a single topic to filter returned topics-dict by,
if any
@return TypesAndTopicsTuple(msg_types, topics) namedtuple,
msg_types as dict of {typename: typehash},
topics as a dict of {topic: TopicTuple() namedtuple}.
Reimplemented in EmbagReader, McapBag, and ROS2Bag.
Definition at line 235 of file api.py.
| read_messages |
( |
|
self, |
|
|
|
topics = None, |
|
|
|
start_time = None, |
|
|
|
end_time = None, |
|
|
|
raw = False, |
|
|
** |
__ |
|
) |
| |
Yields messages from the bag, optionally filtered by topic and timestamp.
@param topics list of topics or a single topic to filter by, if any
@param start_time earliest timestamp of message to return, as ROS time or convertible
(int/float/duration/datetime/decimal)
@param end_time latest timestamp of message to return, as ROS time
(int/float/duration/datetime/decimal)
@param raw if true, then returned messages are tuples of
(typename, bytes, typehash, typeclass)
or (typename, bytes, typehash, position, typeclass),
depending on file format
@return BagMessage namedtuples of (topic, message, timestamp as ROS time)
Reimplemented in EmbagReader, McapBag, ROS2Bag, and ROS1Bag.
Definition at line 271 of file api.py.
| write |
( |
|
self, |
|
|
|
topic, |
|
|
|
msg, |
|
|
|
t = None, |
|
|
|
raw = False, |
|
|
** |
kwargs |
|
) |
| |
Writes a message to the bag.
@param topic name of topic
@param msg ROS message
@param t message timestamp if not using current wall time, as ROS time
or convertible (int/float/duration/datetime/decimal)
@param raw if true, `msg` is in raw format, (typename, bytes, typehash, typeclass)
@param kwargs ROS version-specific arguments,
like `connection_header` for ROS1 or `qoses` for ROS2
Reimplemented in McapBag, ROS1Bag, and ROS2Bag.
Definition at line 288 of file api.py.