Skip to content

Package created to extract data from rosbags using rosbag API

Notifications You must be signed in to change notification settings

thisparticle/rosbag_extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bag Extractor

Overview

This repository is a tailored adaptation of the dataset_bag_extractor and livox_to_pointcloud2 projects, specifically optimized for the GEODE and S3E dataset. It provides a comprehensive package designed to extract raw data from ROS (Robot Operating System) bags, facilitating the extraction of various data types such as images, IMU data, and point clouds from Velodyne, Ouster, and Livox sensors.

Key Features

  • img2jpg: Converts compressed image topics to JPG format, utilizing OpenCV and the cv_bridge. Images are saved with a timestamp-based naming convention.
  • imu2txt: Extracts IMU data into a text file, with each data point on a new line, including timestamp and IMU measurements.
  • pc2bin: Saves PointCloud data from Velodyne or Ouster topics into binary files (.bin), using a PointCloud iterator. Each file is named with a timestamp.
  • livox2bin: Similar to pc2bin, but specifically for Livox point clouds, extracting data from the livox_ros_driver::CustomMsg message type.

Installation

Dependencies

Before you begin, ensure you have the following dependencies installed:

Building from Source

  1. Clone the latest version of the repository into your catkin workspace:
    cd catkin_workspace/src
    git clone https://github.com/thisparticle/rosbag_extractor.git
    cd ../
  2. Build the package using:
    catkin build

Usage

To use the tool, first, ensure you have a launch file configured to meet your specific requirements in terms of structure, sensors, and topics. A minimal example is provided for testing, which can be executed as follows:

roslaunch bag_extractor <extract_dataset>.launch bag:=<bag_file>

Launch Files

  • <extract_dataset>.launch: Launches all sensor nodes for the specified ROS bag file. This file is provided as a template for extracting data from the GEODE dataset, but can be adapted for other use cases with minor modifications.

Nodes

All nodes in this package share common parameters:

  • bag: Name of the ROS bag file. Note that the path in the .launch file is relative to the ~/.ros or $ROS_HOME directory.
  • topic: Name of the topic from which to extract data.
  • folder: Name of the folder where the extracted data will be stored. This folder must exist before running the node. The .launch file includes a script to create directories if they do not exist.

Optional parameters:

  • start_time: Start time for data extraction from the bag.
  • end_time: End time for data extraction from the bag.

For LiDAR messages:

  • lidar_type: Type of LiDAR (Livox, Ouster, Velodyne).

Node Details

  • img2jpg: Extracts images from compressed image topics and saves them as JPG files, using OpenCV and cv_bridge. Images are named with a timestamp.

  • imu2txt: Extracts IMU data and saves it in a text file, with each message on a new line, formatted as follows:

    timestamp roll pitch yaw ang_vel_X ang_vel_Y ang_vel_Z lin_acc_X lin_acc_Y lin_acc_Z
    
  • pc2bin: Extracts PointCloud data from Velodyne or Ouster topics and saves it in binary files. Each file is named with a timestamp and contains the following data:

    • Velodyne: x y z intensity ring time
    • Ouster: x y z intensity t reflectivity ring ambient range
  • livox2bin: Extracts PointCloud data from a Livox Points topic and saves it in binary files, formatted as: x y z intensity tag line

About

Package created to extract data from rosbags using rosbag API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published