Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
jafar::traversability::DataProvider Class Reference

The class DataProvider is an interface between the modules 'datareader' and 'traversability'. More...


Detailed Description

The class DataProvider is an interface between the modules 'datareader' and 'traversability'.

It provides a simple manner to load pose or image data from specified source. Useful is the possibility of loading a config file that contains the relevant, data set specific information.

Definition at line 31 of file trv_dataProvider.hpp.

#include <trv_dataProvider.hpp>

List of all members.

Public Member Functions

 DataProvider (void)
 Void constructor; the data set specific parameters can to be set using the method setup.
 DataProvider (FileInfoDataSet fileInfo)
 Constructor where the data specific parameters are passed in the form of a struct FileInfoDataSet; FileInfoDataSet.
 DataProvider (std::string pathConfigFile, std::string excepStr="none")
 Constructor where the data specific parameters are loaded with the help of a config file.
void setup (std::string pathConfigFile, std::string excepStr="none")
 To setup DataProvider.
void setup (FileInfoDataSet fileInfo)
 To setup DataProvider.
void getPose (int idx, CameraPoseParameters &camPose)
 Get pose data for sample idx provided that the DataReader is set up successfully.
CameraPoseParameters getPose (int idx)
 Get pose data for sample idx provided that the DataReader is set up successfully.
void getImage (int idx, jafar::image::Image &img)
 Get image data for sample idx provided that the DataReader is set up successfully.
jafar::image::Image getImage (int idx)
 Get image data for sample idx provided that the DataReader is set up successfully.
void getData (int idx, CameraPoseParameters &camPose, jafar::image::Image &img)
 Function that combines getPose and getImage.
void printFileInfo (void)
 Print the file info for the actually set up data repository.
void printPoseData (int idx)
 Print pose data of the sample at index idx .
FileInfoDataSet parseConfigFile (std::string pathConfigFile)
 Parse config file in order to gather relevant information for the FileInfoDataSet object.
ImageInfo parseConfigFileForImageInfo (std::string pathConfigFile)
 Parse config file in order to gather image info-.
CameraIntrinsicParameters parseConfigFileForInternals (std::string pathConfigFile)
 Parse config file in order to gather the intrinsic parameters of the camera (calibration parameters).

Private Member Functions

void initPositionReader (FileInfoDataSet fileInfo)
 Init PositionReader.
void initImageReader (FileInfoDataSet fileInfo)
 Init ImageReader.
jblas::vec6 getPoseDataFromSource (jafar::datareader::PositionReader *posReader, int idx)
CameraPoseParameters getPoseDataFromSourceStr (jafar::datareader::PositionReader *posReader, int idx)
template<typename T >
parseFile (std::string pathConfigFile, std::string key)
 Parse a config file for a key.

Private Attributes

FileInfoDataSet mFileInfo
jafar::datareader::PositionReadermPosReader
jafar::datareader::ImageReadermImgReader
std::string mExcepStr

Constructor & Destructor Documentation

Constructor where the data specific parameters are passed in the form of a struct FileInfoDataSet; FileInfoDataSet.

Parameters:
fileInfoof type FileInfoDataSet, containing data set specific parameters
jafar::traversability::DataProvider::DataProvider ( std::string  pathConfigFile,
std::string  excepStr = "none" 
)

Constructor where the data specific parameters are loaded with the help of a config file.

If either image or pose data are not available, the corresponding path parameters delimited by a string which can be specified with the help of the second argument. By default, this "exception string" is "none".

Todo:
write list with config file entries.
Parameters:
pathConfigFilestring defining the config file
excepStrstring delimiting unavailable data. Default value: "none"

Member Function Documentation

Function that combines getPose and getImage.

Parameters:
idxindex of sample
camPoseoutput of type CameraPoseParameters containing pose data
imgoutput of type image::Image containing the image

Get image data for sample idx provided that the DataReader is set up successfully.

Parameters:
idxindex of sample
imgoutput of type image::Image containing the image

Get image data for sample idx provided that the DataReader is set up successfully.

Parameters:
idxindex of sample
Returns:
output of type image::Image containing the image

Get pose data for sample idx provided that the DataReader is set up successfully.

Parameters:
idxindex of sample
camPoseoutput of type CameraPoseParameters containing pose data

Get pose data for sample idx provided that the DataReader is set up successfully.

Parameters:
idxindex of sample
Returns:
output of type CameraPoseParameters containing pose data

Init ImageReader.

Parameters:
fileInfofile info object specifying the data set

Init PositionReader.

Parameters:
fileInfofile info object specifying the data set

Parse config file in order to gather relevant information for the FileInfoDataSet object.

Parameters:
pathConfigFilestring specifying the config file
Returns:
file info, contained in the struct FileInfoDataSet

Parse config file in order to gather image info-.

Parameters:
pathConfigFilestring specifying the config file
Returns:
image info, contained in the struct ImageInfo

Parse config file in order to gather the intrinsic parameters of the camera (calibration parameters).

Parameters:
pathConfigFilestring specifying the config file
Returns:
calibration parameters, contained in the struct CameraIntrinsicParameters
template<typename T >
T jafar::traversability::DataProvider::parseFile ( std::string  pathConfigFile,
std::string  key 
) [inline, private]

Parse a config file for a key.

If the key is not found, 0 or the empty string is returned, depending on the typename.

Parameters:
pathConfigFilepath to the config file
keystring that specifies the entry
Returns:
return variable can be a string, double, float, int, ...

Definition at line 161 of file trv_dataProvider.hpp.

void jafar::traversability::DataProvider::setup ( std::string  pathConfigFile,
std::string  excepStr = "none" 
)

To setup DataProvider.

This function is used by the constructor, but it can be used by the user also.

Parameters:
pathConfigFilestring defining the config file
excepStrstring delimiting unavailable data. Default value: "none"

To setup DataProvider.

This function is used by the constructor, but it can be used by the user also.

Parameters:
fileInfoof type FileInfoDataSet, containing data set specific parameters

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:51 for Jafar by doxygen 1.7.6.1
LAAS-CNRS