-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Overview
The BagFormat::create_writer() method currently ignores the WriterConfig parameter and always creates a writer with default settings.
Current State
pub fn create_writer<P: AsRef<Path>>(
path: P,
_config: &crate::io::writer::WriterConfig,
) -> Result<Box<dyn crate::io::traits::FormatWriter>> {
// For now, we create a simple writer
// TODO: Use config options for compression, chunk size, etc.
let writer = BagWriter::create(path)?;
Ok(Box::new(writer))
}Desired Behavior
Use the WriterConfig to configure:
- Compression type: bz2, lz4, none
- Chunk size: Size of each chunk (default: 768KB)
- Chunk threshold: Messages per chunk before splitting
Example Implementation
pub fn create_writer<P: AsRef<Path>>(
path: P,
config: &crate::io::writer::WriterConfig,
) -> Result<Box<dyn crate::io::traits::FormatWriter>> {
let compression = config.compression.as_deref().unwrap_or("bz2");
let chunk_size = config.chunk_size.unwrap_or(768 * 1024);
let writer = BagWriter::create_with_options(path, compression, chunk_size)?;
Ok(Box::new(writer))
}Files to Modify
src/io/formats/bag/parallel.rs- Updatecreate_writer()methodsrc/io/formats/bag/writer.rs- Addcreate_with_options()method
Acceptance Criteria
- Compression option is respected ("bz2", "lz4", "none")
- Chunk size option is respected
- Default values match historical ROS1 bag behavior
- Tests verify each configuration option
- Documentation is updated
Related Code
- Location:
src/io/formats/bag/parallel.rs:59 - See also:
WriterConfigdefinition insrc/io/writer/mod.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels