Jafar
|
The class DataProvider is an interface between the modules 'datareader' and 'traversability'. More...
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>
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 > | |
T | parseFile (std::string pathConfigFile, std::string key) |
Parse a config file for a key. | |
Private Attributes | |
FileInfoDataSet | mFileInfo |
jafar::datareader::PositionReader * | mPosReader |
jafar::datareader::ImageReader * | mImgReader |
std::string | mExcepStr |
Constructor where the data specific parameters are passed in the form of a struct FileInfoDataSet; FileInfoDataSet.
fileInfo | of 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".
pathConfigFile | string defining the config file |
excepStr | string delimiting unavailable data. Default value: "none" |
void jafar::traversability::DataProvider::getData | ( | int | idx, |
CameraPoseParameters & | camPose, | ||
jafar::image::Image & | img | ||
) |
Function that combines getPose and getImage.
idx | index of sample |
camPose | output of type CameraPoseParameters containing pose data |
img | output of type image::Image containing the image |
void jafar::traversability::DataProvider::getImage | ( | int | idx, |
jafar::image::Image & | img | ||
) |
Get image data for sample idx provided that the DataReader is set up successfully.
idx | index of sample |
img | output of type image::Image containing the image |
Get image data for sample idx provided that the DataReader is set up successfully.
idx | index of sample |
void jafar::traversability::DataProvider::getPose | ( | int | idx, |
CameraPoseParameters & | camPose | ||
) |
Get pose data for sample idx provided that the DataReader is set up successfully.
idx | index of sample |
camPose | output of type CameraPoseParameters containing pose data |
Get pose data for sample idx provided that the DataReader is set up successfully.
idx | index of sample |
void jafar::traversability::DataProvider::initImageReader | ( | FileInfoDataSet | fileInfo | ) | [private] |
Init ImageReader.
fileInfo | file info object specifying the data set |
void jafar::traversability::DataProvider::initPositionReader | ( | FileInfoDataSet | fileInfo | ) | [private] |
Init PositionReader.
fileInfo | file info object specifying the data set |
FileInfoDataSet jafar::traversability::DataProvider::parseConfigFile | ( | std::string | pathConfigFile | ) |
Parse config file in order to gather relevant information for the FileInfoDataSet object.
pathConfigFile | string specifying the config file |
ImageInfo jafar::traversability::DataProvider::parseConfigFileForImageInfo | ( | std::string | pathConfigFile | ) |
Parse config file in order to gather image info-.
pathConfigFile | string specifying the config file |
CameraIntrinsicParameters jafar::traversability::DataProvider::parseConfigFileForInternals | ( | std::string | pathConfigFile | ) |
Parse config file in order to gather the intrinsic parameters of the camera (calibration parameters).
pathConfigFile | string specifying the config file |
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.
pathConfigFile | path to the config file |
key | string that specifies the entry |
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.
pathConfigFile | string defining the config file |
excepStr | string delimiting unavailable data. Default value: "none" |
void jafar::traversability::DataProvider::setup | ( | FileInfoDataSet | fileInfo | ) |
To setup DataProvider.
This function is used by the constructor, but it can be used by the user also.
fileInfo | of type FileInfoDataSet, containing data set specific parameters |
Generated on Wed Oct 15 2014 00:37:51 for Jafar by doxygen 1.7.6.1 |