OKVIS ROS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
okvis::VioParametersReader Class Reference

This class reads and parses config file. More...

#include <VioParametersReader.hpp>

Inheritance diagram for okvis::VioParametersReader:
okvis::RosParametersReader

Classes

struct  CameraCalibration
 Struct that contains all the camera calibration information. More...
 

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW VioParametersReader ()
 The default constructor. More...
 
 VioParametersReader (const std::string &filename)
 The constructor. This calls readConfigFile(). More...
 
virtual ~VioParametersReader ()
 Trivial destructor. More...
 
void readConfigFile (const std::string &filename)
 Read and parse a config file. To get the result call getParameters(). More...
 
bool getParameters (okvis::VioParameters &parameters) const
 Get parameters. More...
 

Public Attributes

bool useDriver
 Directly interface with driver without ROS message passing. More...
 
std::shared_ptr< void > viSensor
 

Protected Member Functions

bool parseBoolean (cv::FileNode node, bool &val) const
 Parses booleans from a cv::FileNode. OpenCV sadly has no implementation like this. More...
 
virtual bool getCameraCalibration (std::vector< CameraCalibration, Eigen::aligned_allocator< CameraCalibration >> &calibrations, cv::FileStorage &configurationFile)
 Get the camera calibration. This looks for the calibration in the configuration file first. If this fails it will directly get the calibration from the sensor, if useDriver is set to true. More...
 
bool getCalibrationViaConfig (std::vector< CameraCalibration, Eigen::aligned_allocator< CameraCalibration >> &calibrations, cv::FileNode cameraNode) const
 Get the camera calibration via the configuration file. More...
 
bool getCalibrationViaVisensorAPI (std::vector< CameraCalibration, Eigen::aligned_allocator< CameraCalibration >> &calibrations) const
 Get the camera calibrations via the visensor API. More...
 

Protected Attributes

bool readConfigFile_
 If readConfigFile() has been called at least once this is true. More...
 
okvis::VioParameters vioParameters_
 The parameters. More...
 

Detailed Description

This class reads and parses config file.

Constructor & Destructor Documentation

okvis::VioParametersReader::VioParametersReader ( )

The default constructor.

okvis::VioParametersReader::VioParametersReader ( const std::string &  filename)

The constructor. This calls readConfigFile().

Parameters
filenameConfiguration filename.
virtual okvis::VioParametersReader::~VioParametersReader ( )
inlinevirtual

Trivial destructor.

Member Function Documentation

bool okvis::VioParametersReader::getCalibrationViaConfig ( std::vector< CameraCalibration, Eigen::aligned_allocator< CameraCalibration >> &  calibrations,
cv::FileNode  cameraNode 
) const
protected

Get the camera calibration via the configuration file.

Parameters
[out]calibrationsRead calibration.
[in]cameraNodeFile node pointing to the cameras sequence.
Returns
True if reading and parsing of calibration was successful.
bool okvis::VioParametersReader::getCalibrationViaVisensorAPI ( std::vector< CameraCalibration, Eigen::aligned_allocator< CameraCalibration >> &  calibrations) const
protected

Get the camera calibrations via the visensor API.

Parameters
[out]calibrationsThe calibrations.
Returns
True if successful.
bool okvis::VioParametersReader::getCameraCalibration ( std::vector< CameraCalibration, Eigen::aligned_allocator< CameraCalibration >> &  calibrations,
cv::FileStorage &  configurationFile 
)
protectedvirtual

Get the camera calibration. This looks for the calibration in the configuration file first. If this fails it will directly get the calibration from the sensor, if useDriver is set to true.

Remarks
Overload this function if you want to get the calibrations via ROS for example.
Parameters
calibrationsThe calibrations.
configurationFileThe config file.
Returns
True if reading of the calibration was successful.

Reimplemented in okvis::RosParametersReader.

bool okvis::VioParametersReader::getParameters ( okvis::VioParameters parameters) const
inline

Get parameters.

Parameters
[out]parametersA copy of the parameters.
Returns
True if parameters have been read from a configuration file. If it returns false then the variable parameters has not been changed.
bool okvis::VioParametersReader::parseBoolean ( cv::FileNode  node,
bool &  val 
) const
protected

Parses booleans from a cv::FileNode. OpenCV sadly has no implementation like this.

Parameters
[in]nodeThe file node.
[out]valThe parsed value.
Returns
True if parsing was successful. If it returns false then the variable val has not been changed.
void okvis::VioParametersReader::readConfigFile ( const std::string &  filename)

Read and parse a config file. To get the result call getParameters().

Parameters
filenameConfiguration filename.

Member Data Documentation

bool okvis::VioParametersReader::readConfigFile_
protected

If readConfigFile() has been called at least once this is true.

bool okvis::VioParametersReader::useDriver

Directly interface with driver without ROS message passing.

okvis::VioParameters okvis::VioParametersReader::vioParameters_
protected

The parameters.

std::shared_ptr<void> okvis::VioParametersReader::viSensor

The documentation for this class was generated from the following files: