Classes | Functions | Variables
read_rosbags.cpp File Reference
#include <bits/stdc++.h>
#include <boost/thread/thread.hpp>
#include <camera_info_manager/camera_info_manager.h>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <ros/ros.h>
#include <rosbag/bag.h>
#include <rosbag/view.h>
#include <utility>
#include <vector>
#include <string>
#include <stdio.h>
#include <sensor_msgs/CompressedImage.h>
#include <compressed_depth_image_transport/rvl_codec.h>
#include <compressed_depth_image_transport/compression_common.h>
Include dependency graph for read_rosbags.cpp:

Go to the source code of this file.

Classes

struct  HeaderOfBinFile
 This structure indicates header of bin files. More...
 

Functions

void arrangeFramesWithTimeStamps (const std::string &file_name, int num_depth_frames, int num_ab_frames)
 AB and depth images with the same timestamp are treated as frames and written to the final binary file, which is arranged in ascending order of timestamps. More...
 
bool comparator (std::pair< long, int > &first_element, std::pair< long, int > &second_element)
 comparison function More...
 
void deleteFile (std::string file_name)
 deleting the intermediate files. remove() function does not work with a null terminated string, so here null character at the end of the string is removed then passed remove function More...
 
void findMissingABOrDepthFrames (const std::string &file_name, int num_depth_frames, int num_ab_frames)
 This function finds whether any depth frame do not have the AB frame corresponding to it. More...
 
int main (int argc, char **argv)
 This is main function. More...
 
void notifyFrameLoss (const std::string &file_name)
 Notifies if capture is less than 10FPS. More...
 
void sort_map (std::map< long, int > &mapped_array)
 sorts the map More...
 
void storeCameraTopicsInbinFile (std::string bag_file_name, std::vector< std::string > cam_name)
 Stores camera topics in binary file. More...
 

Variables

int CAM_VERSION = 2
 

Function Documentation

◆ arrangeFramesWithTimeStamps()

void arrangeFramesWithTimeStamps ( const std::string &  file_name,
int  num_depth_frames,
int  num_ab_frames 
)

AB and depth images with the same timestamp are treated as frames and written to the final binary file, which is arranged in ascending order of timestamps.

Parameters
file_namefile name
num_depth_framesnumber of depth frames
num_ab_framesnumber of AB frames

Definition at line 282 of file read_rosbags.cpp.

◆ comparator()

bool comparator ( std::pair< long, int > &  first_element,
std::pair< long, int > &  second_element 
)

comparison function

Parameters
first_elementfirst element
second_elementsecond element
Returns
true if first pair element's first value is less than second pair element's first value
false if first pair element's first value is greater than second pair element's first value

Definition at line 50 of file read_rosbags.cpp.

◆ deleteFile()

void deleteFile ( std::string  file_name)

deleting the intermediate files. remove() function does not work with a null terminated string, so here null character at the end of the string is removed then passed remove function

Parameters
file_namefile name

Definition at line 85 of file read_rosbags.cpp.

◆ findMissingABOrDepthFrames()

void findMissingABOrDepthFrames ( const std::string &  file_name,
int  num_depth_frames,
int  num_ab_frames 
)

This function finds whether any depth frame do not have the AB frame corresponding to it.

Parameters
file_nameInput file name
num_depth_framesTotal number of depth frames
num_ab_framesTotal number of AB frames

Definition at line 113 of file read_rosbags.cpp.

◆ main()

int main ( int  argc,
char **  argv 
)

This is main function.

Parameters
argcnumber of input arguments to the function
argvarray of pointer to the input arguments
Returns
int

Definition at line 675 of file read_rosbags.cpp.

◆ notifyFrameLoss()

void notifyFrameLoss ( const std::string &  file_name)

Notifies if capture is less than 10FPS.

Parameters
file_namefile name

Definition at line 224 of file read_rosbags.cpp.

◆ sort_map()

void sort_map ( std::map< long, int > &  mapped_array)

sorts the map

Parameters
mapped_arrayinput mapped array to sort function

Definition at line 60 of file read_rosbags.cpp.

◆ storeCameraTopicsInbinFile()

void storeCameraTopicsInbinFile ( std::string  bag_file_name,
std::vector< std::string >  cam_name 
)

Stores camera topics in binary file.

Parameters
bag_file_nameinput bag file name
cam_namecamera prefix names

Definition at line 410 of file read_rosbags.cpp.

Variable Documentation

◆ CAM_VERSION

int CAM_VERSION = 2

Definition at line 22 of file read_rosbags.cpp.



adi_3dtof_adtf31xx
Author(s):
autogenerated on Sat May 17 2025 02:12:30