Crate rosbag

Source
Expand description

Utilities for efficient reading of ROS bag files.

§Example

use rosbag::{ChunkRecord, MessageRecord, IndexRecord, RosBag};

let bag = RosBag::new(path)?;
// Iterate over records in the chunk section
for record in bag.chunk_records() {
    match record? {
        ChunkRecord::Chunk(chunk) => {
            // iterate over messages in the chunk
            for msg in chunk.messages() {
                match msg? {
                    MessageRecord::MessageData(msg_data) => {
                        // ..
                    }
                    MessageRecord::Connection(conn) => {
                        // ..
                    }
                }
            }
        },
        ChunkRecord::IndexData(index_data) => {
            // ..
        },
    }
}
// Iterate over records in the index section
for record in bag.index_records() {
    match record? {
        IndexRecord::IndexData(index_data) => {
            // ..
        }
        IndexRecord::Connection(conn) => {
            // ..
        }
        IndexRecord::ChunkInfo(chunk_info) => {
            // ..
        }
    }
}

Modules§

record_types
Collection of record types.

Structs§

ChunkRecordsIterator
Iterator over records stored in the chunk section of a rosbag file.
IndexRecordsIterator
Iterator over records stored in the chunk section of a rosbag file.
MessageRecordsIterator
Iterator over records stored in a Chunk record.
RosBag
Open rosbag file.

Enums§

ChunkRecord
Record types which can be stored in the chunk section.
Error
The error type for ROS bag file reading and parsing.
IndexRecord
Record types which can be stored in the chunk section.
MessageRecord
Record types which can be stored in a Chunk record.

Type Aliases§

Result
A specialized Result type for ROS bag file reading and parsing.