Copied rosbag code directly in