OKVIS ROS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
dataset_convertor.cpp File Reference

Source file for the VioParametersReader class. More...

#include <vector>
#include <map>
#include <memory>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <ros/ros.h>
#include <ros/console.h>
#include <rosbag/bag.h>
#include <rosbag/view.h>
#include <rosbag/chunked_file.h>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <message_filters/subscriber.h>
#include <message_filters/time_synchronizer.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/image_encodings.h>
#include <sensor_msgs/Imu.h>
#include <geometry_msgs/TransformStamped.h>
#include <boost/foreach.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>

Functions

void signalHandler (int s)
 
string colouredString (string str, string colour, string option)
 
bool createDirs (string folderPath, map< string, map< string, string >> sensor_info)
 
void writeCameraHeader (shared_ptr< ofstream > file)
 
void writeImuHeader (shared_ptr< ofstream > file)
 
void writeViconHeader (shared_ptr< ofstream > file)
 
void writeCSVHeaders (map< string, shared_ptr< ofstream >> &files, const map< string, map< string, string >> &sensor_info)
 
map< string, shared_ptr
< ofstream > > 
openFileStreams (const string folder_path, map< string, map< string, string >> &sensor_info)
 
map< string, map< string,
string > > 
sensorInfo (const ros::NodeHandle &nh)
 
void writeCSVCamera (shared_ptr< ofstream > file, ros::Time stamp)
 
void writeCSVImu (shared_ptr< ofstream > file, sensor_msgs::Imu::ConstPtr imu)
 
void writeCSVVicon (shared_ptr< ofstream > file, geometry_msgs::TransformStamped::ConstPtr vicon)
 
bool isTopicInMap (map< string, map< string, string > > &topic2info, string topic_name)
 
bool findTopicInMap (map< string, map< string, string > > &topic2info, string topic_name, map< string, map< string, string > >::iterator &element)
 
int main (int argc, char **argv)
 

Variables

const string RESET = "\033[0m"
 
const string BLACK = "0m"
 
const string RED = "1m"
 
const string GREEN = "2m"
 
const string BOLD = "\033[1;3"
 
const string REGULAR = "\033[0;3"
 
const string UNDERLINE = "\033[4;3"
 
const string BACKGROUND = "\033[4"
 
const int DOUBLE_PRECISION = 17
 
const string SENSOR_LIST = "sensors"
 
const string CSVFILE = "data_file"
 
const string DATADIR = "data_dir"
 
const string SENSOR_TYPE = "type"
 
const string INFO = "info"
 
const string TOPIC = "topic"
 
const string NAME = "name"
 
const string CAMERA = "camera"
 
const string IMU = "imu"
 
const string VICON = "vicon"
 
const string configDirectoryName = "/config/"
 
const string cam0DirectoryName = "/cam0"
 
const string cam1DirectoryName = "/cam1"
 
const string imuDirectoryName = "/imu0"
 
const string imuFileName = "imu0.csv"
 
std::ofstream imu_file_
 

Detailed Description

Source file for the VioParametersReader class.

Author
Stefan Leutenegger
Andrea Nicastro

Function Documentation

string colouredString ( string  str,
string  colour,
string  option 
)
bool createDirs ( string  folderPath,
map< string, map< string, string >>  sensor_info 
)
bool findTopicInMap ( map< string, map< string, string > > &  topic2info,
string  topic_name,
map< string, map< string, string > >::iterator &  element 
)
bool isTopicInMap ( map< string, map< string, string > > &  topic2info,
string  topic_name 
)
int main ( int  argc,
char **  argv 
)
map<string, shared_ptr<ofstream> > openFileStreams ( const string  folder_path,
map< string, map< string, string >> &  sensor_info 
)
map<string, map<string, string> > sensorInfo ( const ros::NodeHandle &  nh)
void signalHandler ( int  s)
void writeCameraHeader ( shared_ptr< ofstream >  file)
void writeCSVCamera ( shared_ptr< ofstream >  file,
ros::Time  stamp 
)
void writeCSVHeaders ( map< string, shared_ptr< ofstream >> &  files,
const map< string, map< string, string >> &  sensor_info 
)
void writeCSVImu ( shared_ptr< ofstream >  file,
sensor_msgs::Imu::ConstPtr  imu 
)
void writeCSVVicon ( shared_ptr< ofstream >  file,
geometry_msgs::TransformStamped::ConstPtr  vicon 
)
void writeImuHeader ( shared_ptr< ofstream >  file)
void writeViconHeader ( shared_ptr< ofstream >  file)

Variable Documentation

const string BACKGROUND = "\033[4"
const string BLACK = "0m"
const string BOLD = "\033[1;3"
const string cam0DirectoryName = "/cam0"
const string cam1DirectoryName = "/cam1"
const string CAMERA = "camera"
const string configDirectoryName = "/config/"
Todo:
: obsolete! delete
const string CSVFILE = "data_file"
const string DATADIR = "data_dir"
const int DOUBLE_PRECISION = 17
const string GREEN = "2m"
const string IMU = "imu"
std::ofstream imu_file_
const string imuDirectoryName = "/imu0"
const string imuFileName = "imu0.csv"
const string INFO = "info"
const string NAME = "name"
const string RED = "1m"
const string REGULAR = "\033[0;3"
const string RESET = "\033[0m"
const string SENSOR_LIST = "sensors"
const string SENSOR_TYPE = "type"
const string TOPIC = "topic"
const string UNDERLINE = "\033[4;3"
const string VICON = "vicon"