Skip to content

parsing ROSBag files to Sync data (also sync with GT data)

Notifications You must be signed in to change notification settings

SungJaeShin/parsingROSBag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parsing ROSBag files with sync data

Dependencies

  • OpenCV (with Contrib)
  • Eigen
  • ROS
  • cv_bridge
  • sensor_msgs
  • Realsense-ros

Parameters (config.yaml in config folder)

(1) SAVE_IMG

  • Not save images → 0
  • Save images → 1

(2) PUBLISH_SYNCED_IMGS

  • Use publish ROS topic → true
  • Not use publish ROS topic → false

(3) DIFF_THRESHOLD

  • Set different between current time and lastest time → ${VALUE}

(4) SYNC_GT_TIME

  • Sync with GT and image time → true
  • Not use GT info → false

(5) SIM_THRESHOLD

  • To set GT boundary near by current image → ${VALUE}

(6) std::string gt_path

  • To write GT absolute path → ${STRING}

Build and Run

Clone the repository and build and run simultaneously:

   $ cd catkin_ws/src
   $ git clone https://github.com/SungJaeShin/parsingROSBag.git
   $ cd ../../
   $ catkin config -DCMAKE_BUILD_TYPE=Release
   $ catkin build parsingROSBag
   $ source devel/setup.bash
   $ sh start_parsing.sh

Input Data

(1) sensor_msgs::CameraInfo

  • /camera/camera/color/camera_info
  • /camera/camera/depth/camera_info
  • /camera/camera/infra1/camera_info
  • /camera/camera/infra2/camera_info

(2) sensor_msgs::CompressedImage

  • /camera/camera/color/image_raw/compressed
  • /camera/camera/infra1/image_rect_raw/compressed
  • /camera/camera/infra2/image_rect_raw/compressed

(3) sensor_msgs::Image

  • /camera/camera/depth/image_rect_raw

Output Data

(1) sensor_msgs::Image

  • /sync_color
  • /sync_depth
  • /sync_infra1

(2) Save Sync Color and Depth Image (.jpg)

  • If you want to save .png extension image, please go to saveSyncImgs funtion and change .jpg to .png !!
  • Default saved image is 3 FPS in rosbag time !!
    • If you want to save more images, then please change double value in time_diff statement ! (in this code, setting 0.25)

(3) Save the Image Concerning Sync Color time and GT time Image (.jpg)

  • You can set the time to sync with gt. By adjusting SIM_THRESHOLD, you can set an image that fits the range of GT ! (in this code, setting 0.01)

Exmaple

  • example of ar table dataset
    • In the result, the only image is saved as 00002.jpg, and the image parsed according to GT time is saved as gt_2_1662915732.374960.jpg.
GT text file (looking at Line 2)
Only image parsing Parsing image depend on GT time (line 2)

Acknowledgement

Thank you Alvin Jinsung Choi for correcting the code error!


Future Work

  • I will sync all other images !