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§
- Chunk
Records Iterator - Iterator over records stored in the chunk section of a rosbag file.
- Index
Records Iterator - Iterator over records stored in the chunk section of a rosbag file.
- Message
Records Iterator - Iterator over records stored in a
Chunk
record. - RosBag
- Open rosbag file.
Enums§
- Chunk
Record - Record types which can be stored in the chunk section.
- Error
- The error type for ROS bag file reading and parsing.
- Index
Record - Record types which can be stored in the chunk section.
- Message
Record - Record types which can be stored in a
Chunk
record.
Type Aliases§
- Result
- A specialized Result type for ROS bag file reading and parsing.