pub struct Reader {
pub metadata: Metadata,
pub connections: Vec<TopicConnection>,
/* private fields */
}Fields§
§metadata: Metadata§connections: Vec<TopicConnection>Implementations§
Source§impl Reader
The Reader struct provides an interface for reading message data from a ROS bag file.
impl Reader
The Reader struct provides an interface for reading message data from a ROS bag file.
The Reader initializes with the path to a ROS bag directory and reads metadata
and message data from the storage. It supports filtering messages by time and handling
each message through a user-defined function.
§Errors
- Returns an error if the ROS bag version is not supported.
- Returns an error if the compression mode is not supported.
- Returns an error if a non-CDR serialization format is found in any topic.
- Returns an error if the storage identifier is not ‘sqlite3’.
§Note
- This struct assumes that the ROS bag files are in
sqlite3format. - The
handle_messagesmethod allows for processing of individual messages.
pub fn new(path: impl AsRef<Path>) -> Result<Self>
pub fn open(&mut self) -> Result<()>
pub fn handle_messages( &mut self, handle_func: impl Fn((i64, i64, Vec<u8>)) -> Result<()>, start: Option<i64>, stop: Option<i64>, ) -> Result<()>
pub fn duration(&self) -> i64
pub fn start_time(&self) -> i64
pub fn end_time(&self) -> i64
pub fn message_count(&self) -> i32
pub fn compression_format(&self) -> String
pub fn compression_mode(&self) -> Option<String>
pub fn topics(&self) -> HashMap<String, TopicInfo>
pub fn ros_distro(&self) -> String
Auto Trait Implementations§
impl !RefUnwindSafe for Reader
impl !Sync for Reader
impl !UnwindSafe for Reader
impl Freeze for Reader
impl Send for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more