Issues rosbag big bags compressed with lz4

asked 2018-04-27 06:16:56 -0500

rkappes gravatar image

Hey everyone,

our setup:

  1. Ubuntu 16.04.03 LTS
  2. ROS Kinectic
  3. RealSense R200

We try to record longterm bag-files (about an hour) of realsense_camera r200_nodelet_rgbd.launch. We saved therefore the bags on a external SSD with interface 3.1 USB 2. generation. The bag file is about 289,0 GB.

When we play the rosbag while no node is subscribing to the packed topics, the bag file runs without a problem. Also rviz can subscribe to the topics, but when we run our own node, which is subscribing to the topics with message_filters ( ) for message synchronization, the rosbag play failed with different errors messages:

  1. ROSLZ4_OUTPUT_SMALL: output buffer is too small
  2. ROSLZ4_DATA_ERROR: malformed data to decompress

The errors appear always on the same time. But if we copy the bag file from our back up, the errors appears on a different time. We tried to rosbag reindex and rosbag fix but both seems not to work. We also recorded the bag files several times, but the same errors appears anytime.

The other option is to not use the time synchronizazion, but we have no clue how to change callback to solve the problem.

The code snippet of the callback:

const int QUEUE_LENGTH = 50;

std::deque<cv::Mat> colorQueue;
std::deque<cv::Mat> depthQueue;
std::deque<sensor_msgs::CameraInfo> colorInfoQueue;

const double offset = 1.0;
const double frequence = 15.0;
const double max = 30.0;
const double step = frequence + offset;
double fIndex = 0.0;

void callback(const sensor_msgs::CameraInfo::ConstPtr& rgbInfo, const sensor_msgs::Image::ConstPtr& rgbImage, const sensor_msgs::Image::ConstPtr& depthImage) {
    if(fIndex >= max) {
        fIndex = fIndex - max;
        colorQueue.push_back(cv_bridge::toCvCopy(rgbImage, rgbImage->encoding)->image);
        if(colorQueue.size() >= QUEUE_LENGTH)
        depthQueue.push_back(cv_bridge::toCvCopy(depthImage, depthImage->encoding)->image);
        if(depthQueue.size() >= QUEUE_LENGTH)
        if(colorInfoQueue.size() >= QUEUE_LENGTH)
    fIndex = fIndex + step;

Hope any can help us to solve the problem.

edit retag flag offensive close merge delete