
Public Member Functions | |
| def | __contains__ (self, key) |
| def | __init__ (self, f, mode="r", **__) |
| def | __next__ (self) |
| def | autodetect (cls, f) |
| def | close (self) |
| def | closed (self) |
| def | filename (self) |
| def | get_end_time (self) |
| def | get_message_class (self, typename, typehash=None) |
| def | get_message_count (self, topic_filters=None) |
| def | get_message_definition (self, msg_or_type) |
| def | get_message_type_hash (self, msg_or_type) |
| def | get_qoses (self, topic, typename) |
| def | get_start_time (self) |
| def | get_topic_info (self, *_, **__) |
| def | get_type_and_topic_info (self, topic_filters=None) |
| def | mode (self) |
| def | open (self) |
| def | read_messages (self, topics=None, start_time=None, end_time=None, raw=False) |
| def | size (self) |
| def | topics (self) |
| def | write (self, topic, msg, t=None, raw=False, **__) |
Public Member Functions inherited from grepros.api.BaseBag | |
| def | __bool__ (self) |
| def | __copy__ (self) |
| def | __deepcopy__ (self, memo=None) |
| def | __enter__ (self) |
| def | __exit__ (self, exc_type, exc_value, traceback) |
| def | __getitem__ (self, key) |
| def | __iter__ (self) |
| def | __len__ (self) |
| def | __nonzero__ (self) |
| def | __str__ (self) |
| def | flush (self) |
| def | get_topic_info (self, counts=True) |
| def | read_messages (self, topics=None, start_time=None, end_time=None, raw=False, **__) |
| def | stop_on_error (self) |
| def | stop_on_error (self, flag) |
Public Attributes | |
| get_fields_and_field_types | |
| SLOT_TYPES | |
Static Public Attributes | |
| string | MCAP_MAGIC = b"\x89MCAP\x30\r\n" |
| MCAP file header magic start bytes. More... | |
| tuple | MODES = ("r", "w") |
| Supported opening modes. More... | |
Static Public Attributes inherited from grepros.api.BaseBag | |
| BagMessage = collections.namedtuple("BagMessage", "topic message timestamp") | |
| Returned from read_messages() as (topic name, ROS message, ROS timestamp object). More... | |
| tuple | MODES = ("r", "w", "a") |
| Supported opening modes, overridden in subclasses. More... | |
| next | |
| bool | STREAMABLE = True |
| Whether bag supports reading or writing stream objects, overridden in subclasses. More... | |
| TopicTuple | |
| Returned from get_type_and_topic_info() as (typename, message count, connection count, median frequency). More... | |
| TypesAndTopicsTuple = collections.namedtuple("TypesAndTopicsTuple", ["msg_types", "topics"]) | |
| Returned from get_type_and_topic_info() as ({typename: typehash}, {topic name: TopicTuple}). More... | |
Private Member Functions | |
| def | _decode_message (self, message, channel, schema) |
| def | _make_message_class (self, schema, message, generate=True) |
| def | _patch_message (self, message, typename, typehash) |
| def | _patch_message_class (self, cls, typename, typehash) |
| def | _populate_meta (self) |
MCAP bag interface, providing most of rosbag.Bag interface. Bag cannot be appended to, and cannot be read and written at the same time (MCAP API limitation).
| def grepros.plugins.mcap.McapBag.__init__ | ( | self, | |
| f, | |||
mode = "r", |
|||
| ** | __ | ||
| ) |
| def grepros.plugins.mcap.McapBag.__contains__ | ( | self, | |
| key | |||
| ) |
Returns whether bag contains given topic.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.__next__ | ( | self | ) |
Retrieves next message from bag as (topic, message, timestamp).
Reimplemented from grepros.api.BaseBag.
|
private |
|
private |
|
private |
Patches MCAP ROS2 message with expected attributes and methods, recursively. @param message ROS message instance as returned from mcap_ros2.decoder @param typename ROS message type name, like "std_msgs/Bool" @param typehash ROS message type hash @return original message patched, or new instance if ROS2 temporal type
|
private |
Patches MCAP ROS2 message class with expected attributes and methods, recursively. @param cls ROS message class as returned from mcap_ros2.decoder @param typename ROS message type name, like "std_msgs/Bool" @param typehash ROS message type hash @return patched class
|
private |
| def grepros.plugins.mcap.McapBag.autodetect | ( | cls, | |
| f | |||
| ) |
| def grepros.plugins.mcap.McapBag.close | ( | self | ) |
Closes the bag file.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.closed | ( | self | ) |
Returns whether file is closed.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.filename | ( | self | ) |
Returns bag file path.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_end_time | ( | self | ) |
Returns the end time of the bag, as UNIX timestamp.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_message_class | ( | self, | |
| typename, | |||
typehash = None |
|||
| ) |
Returns ROS message class for typename, or None if unknown type. @param typehash message type definition hash, if any
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_message_count | ( | self, | |
topic_filters = None |
|||
| ) |
Returns the number of messages in the bag. @param topic_filters list of topics or a single topic to filter by, if any
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_message_definition | ( | self, | |
| msg_or_type | |||
| ) |
Returns ROS message type definition full text from bag, including subtype definitions.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_message_type_hash | ( | self, | |
| msg_or_type | |||
| ) |
Returns ROS message type MD5 hash.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_qoses | ( | self, | |
| topic, | |||
| typename | |||
| ) |
Returns topic Quality-of-Service profiles as a list of dicts, or None if not available.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_start_time | ( | self | ) |
Returns the start time of the bag, as UNIX timestamp.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.get_topic_info | ( | self, | |
| * | _, | ||
| ** | __ | ||
| ) |
| def grepros.plugins.mcap.McapBag.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 from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.mode | ( | self | ) |
Returns file open mode.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.open | ( | self | ) |
Opens the bag file if not already open.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.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 at all
@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 or convertible
(int/float/duration/datetime/decimal)
@param raw if true, then returned messages are tuples of
(typename, bytes, typehash, typeclass)
@return BagMessage namedtuples of
(topic, message, timestamp as rospy/rclpy.Time)
| def grepros.plugins.mcap.McapBag.size | ( | self | ) |
Returns current file size.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.topics | ( | self | ) |
Returns the list of topics in bag, in alphabetic order.
Reimplemented from grepros.api.BaseBag.
| def grepros.plugins.mcap.McapBag.write | ( | self, | |
| topic, | |||
| msg, | |||
t = None, |
|||
raw = False, |
|||
| ** | __ | ||
| ) |
Writes out message to MCAP file.
@param topic name of topic
@param msg ROS1 message
@param t message timestamp if not using current ROS time,
as ROS time type or convertible (int/float/duration/datetime/decimal)
@param raw if true, `msg` is in raw format, (typename, bytes, typehash, typeclass)
Reimplemented from grepros.api.BaseBag.
|
private |
|
static |
|
static |