Skip to content

Commit

Permalink
PR #2669 from SamerKhshiboun: use playback device for rosbags
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Apr 3, 2023
2 parents 86ab0c8 + 929fbc5 commit 00d23c4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions realsense2_camera/src/realsense_node_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,8 @@ void RealSenseNodeFactory::init()
{
{
ROS_INFO_STREAM("publish topics from rosbag file: " << rosbag_filename.c_str());
auto pipe = std::make_shared<rs2::pipeline>();
rs2::config cfg;
cfg.enable_device_from_file(rosbag_filename.c_str(), false);
cfg.enable_all_streams();
pipe->start(cfg); //File will be opened in read mode at this point
_device = pipe->get_active_profile().get_device();
rs2::context ctx;
_device = ctx.load_device(rosbag_filename.c_str());
_serial_no = _device.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER);
}
if (_device)
Expand Down

0 comments on commit 00d23c4

Please sign in to comment.