Skip to content

Commit

Permalink
adapt rosbag2_py
Browse files Browse the repository at this point in the history
Signed-off-by: Karsten Knese <[email protected]>
  • Loading branch information
Karsten1987 committed Apr 14, 2021
1 parent 0de223a commit c6a24e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rosbag2_py/src/rosbag2_py/_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,25 @@ class Player
const rosbag2_storage::StorageOptions & storage_options,
PlayOptions & play_options)
{
std::shared_ptr<rosbag2_cpp::Reader> reader = nullptr;
std::unique_ptr<rosbag2_cpp::Reader> reader = nullptr;
// Determine whether to build compression or regular reader
{
rosbag2_storage::MetadataIo metadata_io{};
rosbag2_storage::BagMetadata metadata{};
if (metadata_io.metadata_file_exists(storage_options.uri)) {
metadata = metadata_io.read_metadata(storage_options.uri);
if (!metadata.compression_format.empty()) {
reader = std::make_shared<rosbag2_cpp::Reader>(
reader = std::make_unique<rosbag2_cpp::Reader>(
std::make_unique<rosbag2_compression::SequentialCompressionReader>());
}
}
if (reader == nullptr) {
reader = std::make_shared<rosbag2_cpp::Reader>(
reader = std::make_unique<rosbag2_cpp::Reader>(
std::make_unique<rosbag2_cpp::readers::SequentialReader>());
}
}

rosbag2_transport::Player impl(reader);
rosbag2_transport::Player impl(std::move(reader));
impl.play(storage_options, play_options);
}
};
Expand Down

0 comments on commit c6a24e0

Please sign in to comment.