Bag serialize messages to and from a single file on disk using the bag format.
def rosbag.bag.Bag.__init__ | ( | self, | |
f, | |||
mode = 'r' , |
|||
compression = Compression.NONE , |
|||
chunk_threshold = 768 * 1024 , |
|||
allow_unindexed = False , |
|||
options = None , |
|||
skip_index = False |
|||
) |
Open a bag file. The mode can be 'r', 'w', or 'a' for reading (default), writing or appending. The file will be created if it doesn't exist when opened for writing or appending; it will be truncated when opened for writing. Simultaneous reading and writing is allowed when in writing or appending mode. @param f: filename of bag to open or a stream to read from @type f: str or file @param mode: mode, either 'r', 'w', or 'a' @type mode: str @param compression: compression mode, see U{rosbag.Compression} for valid modes @type compression: str @param chunk_threshold: minimum number of uncompressed bytes per chunk @type chunk_threshold: int @param allow_unindexed: if True, allow opening unindexed bags @type allow_unindexed: bool @param options: the bag options (currently: compression and chunk_threshold) @type options: dict @param skip_index: if True, don't read the connection index records on open [2.0+] @type skip_index: bool @raise ValueError: if any argument is invalid @raise ROSBagException: if an error occurs opening file @raise ROSBagFormatException: if bag format is corrupted
def rosbag.bag.Bag.__enter__ | ( | self | ) |
def rosbag.bag.Bag.__exit__ | ( | self, | |
exc_type, | |||
exc_value, | |||
traceback | |||
) |
def rosbag.bag.Bag.__iter__ | ( | self | ) |
def rosbag.bag.Bag.__str__ | ( | self | ) |
def rosbag.bag.Bag._clear_index | ( | self | ) | [private] |
def rosbag.bag.Bag._close_file | ( | self | ) | [private] |
def rosbag.bag.Bag._create_reader | ( | self | ) | [private] |
def rosbag.bag.Bag._get_chunk_offset | ( | self | ) | [private] |
def rosbag.bag.Bag._get_chunk_threshold | ( | self | ) | [private] |
def rosbag.bag.Bag._get_compression | ( | self | ) | [private] |
def rosbag.bag.Bag._get_connections | ( | self, | |
topics = None , |
|||
connection_filter = None |
|||
) | [private] |
def rosbag.bag.Bag._get_entries | ( | self, | |
connections = None , |
|||
start_time = None , |
|||
end_time = None |
|||
) | [private] |
def rosbag.bag.Bag._get_entries_reverse | ( | self, | |
connections = None , |
|||
start_time = None , |
|||
end_time = None |
|||
) | [private] |
def rosbag.bag.Bag._get_entry | ( | self, | |
t, | |||
connections = None |
|||
) | [private] |
def rosbag.bag.Bag._get_entry_after | ( | self, | |
t, | |||
connections = None |
|||
) | [private] |
def rosbag.bag.Bag._get_indexes | ( | self, | |
connections | |||
) | [private] |
def rosbag.bag.Bag._get_yaml_info | ( | self, | |
key = None |
|||
) | [private] |
def rosbag.bag.Bag._has_compressed_chunks | ( | self | ) | [private] |
def rosbag.bag.Bag._open | ( | self, | |
f, | |||
mode, | |||
allow_unindexed | |||
) | [private] |
def rosbag.bag.Bag._open_append | ( | self, | |
f, | |||
allow_unindexed | |||
) | [private] |
def rosbag.bag.Bag._open_read | ( | self, | |
f, | |||
allow_unindexed | |||
) | [private] |
def rosbag.bag.Bag._open_write | ( | self, | |
f | |||
) | [private] |
def rosbag.bag.Bag._read_message | ( | self, | |
position, | |||
raw = False |
|||
) | [private] |
def rosbag.bag.Bag._read_version | ( | self | ) | [private] |
def rosbag.bag.Bag._set_chunk_threshold | ( | self, | |
chunk_threshold | |||
) | [private] |
def rosbag.bag.Bag._set_compression | ( | self, | |
compression | |||
) | [private] |
def rosbag.bag.Bag._set_compression_mode | ( | self, | |
compression | |||
) | [private] |
def rosbag.bag.Bag._start_appending | ( | self | ) | [private] |
def rosbag.bag.Bag._start_writing | ( | self | ) | [private] |
def rosbag.bag.Bag._start_writing_chunk | ( | self, | |
t | |||
) | [private] |
def rosbag.bag.Bag._stop_writing | ( | self | ) | [private] |
def rosbag.bag.Bag._stop_writing_chunk | ( | self | ) | [private] |
def rosbag.bag.Bag._uncompressed_size | ( | self | ) | [private] |
def rosbag.bag.Bag._write_chunk_header | ( | self, | |
chunk_header | |||
) | [private] |
def rosbag.bag.Bag._write_chunk_info_record | ( | self, | |
chunk_info | |||
) | [private] |
def rosbag.bag.Bag._write_connection_index_record | ( | self, | |
connection_id, | |||
entries | |||
) | [private] |
def rosbag.bag.Bag._write_connection_record | ( | self, | |
connection_info | |||
) | [private] |
def rosbag.bag.Bag._write_file_header_record | ( | self, | |
index_pos, | |||
connection_count, | |||
chunk_count | |||
) | [private] |
def rosbag.bag.Bag._write_message_data_record | ( | self, | |
connection_id, | |||
t, | |||
serialized_bytes | |||
) | [private] |
def rosbag.bag.Bag.close | ( | self | ) |
def rosbag.bag.Bag.filename | ( | self | ) |
def rosbag.bag.Bag.flush | ( | self | ) |
def rosbag.bag.Bag.mode | ( | self | ) |
def rosbag.bag.Bag.options | ( | self | ) |
def rosbag.bag.Bag.read_messages | ( | self, | |
topics = None , |
|||
start_time = None , |
|||
end_time = None , |
|||
connection_filter = None , |
|||
raw = False |
|||
) |
Read messages from the bag, optionally filtered by topic, timestamp and connection details. @param topics: list of topics or a single topic [optional] @type topics: list(str) or str @param start_time: earliest timestamp of message to return [optional] @type start_time: U{genpy.Time} @param end_time: latest timestamp of message to return [optional] @type end_time: U{genpy.Time} @param connection_filter: function to filter connections to include [optional] @type connection_filter: function taking (topic, datatype, md5sum, msg_def, header) and returning bool @param raw: if True, then generate tuples of (datatype, (data, md5sum, position), pytype) @type raw: bool @return: generator of (topic, message, timestamp) tuples for each message in the bag file @rtype: generator of tuples of (str, U{genpy.Message}, U{genpy.Time}) [not raw] or (str, (str, str, str, tuple, class), U{genpy.Time}) [raw]
def rosbag.bag.Bag.reindex | ( | self | ) |
def rosbag.bag.Bag.size | ( | self | ) |
def rosbag.bag.Bag.version | ( | self | ) |
def rosbag.bag.Bag.write | ( | self, | |
topic, | |||
msg, | |||
t = None , |
|||
raw = False |
|||
) |
Write a message to the bag. @param topic: name of topic @type topic: str @param msg: message to add to bag, or tuple (if raw) @type msg: Message or tuple of raw message data @param t: ROS time of message publication, if None specifed, use current time [optional] @type t: U{genpy.Time} @param raw: if True, msg is in raw format, i.e. (msg_type, serialized_bytes, md5sum, pytype) @type raw: bool @raise ValueError: if arguments are invalid or bag is closed
rosbag::bag.Bag::_buffer [private] |
rosbag::bag.Bag::_chunk_count [private] |
rosbag::bag.Bag::_chunk_headers [private] |
rosbag::bag.Bag::_chunk_open [private] |
rosbag::bag.Bag::_chunk_threshold [private] |
rosbag::bag.Bag::_chunks [private] |
rosbag::bag.Bag::_compression [private] |
rosbag::bag.Bag::_connection_count [private] |
rosbag::bag.Bag::_connection_indexes [private] |
rosbag::bag.Bag::_connections [private] |
rosbag::bag.Bag::_curr_chunk_data_pos [private] |
rosbag::bag.Bag::_curr_chunk_info [private] |
rosbag::bag.Bag::_curr_compression [private] |
rosbag::bag.Bag::_file [private] |
rosbag::bag.Bag::_file_header_pos [private] |
rosbag::bag.Bag::_filename [private] |
rosbag::bag.Bag::_index_data_pos [private] |
rosbag::bag.Bag::_mode [private] |
rosbag::bag.Bag::_output_file [private] |
rosbag::bag.Bag::_reader [private] |
rosbag::bag.Bag::_skip_index [private] |
rosbag::bag.Bag::_topic_connections [private] |
rosbag::bag.Bag::_version [private] |
rosbag::bag.Bag::chunk_threshold = property(_get_chunk_threshold, _set_chunk_threshold) [static] |
rosbag::bag.Bag::compression = property(_get_compression, _set_compression) [static] |