xml_calibration_parser::XmlCalibrationParser Class Reference

#include <xml_calibration_parser.h>

List of all members.

Classes

struct  Calibration
struct  JointCalibration

Public Member Functions

float get_calibration_value (float position, std::string joint_name)
std::vector< JointCalibrationgetJointsCalibrations ()
 XmlCalibrationParser (std::string path_to_calibration)
 XmlCalibrationParser ()
 ~XmlCalibrationParser ()

Protected Types

typedef std::map< std::string,
std::vector< float > > 
mapType

Protected Member Functions

int build_calibration_table ()
std::vector< float > calibration_to_lookup_table (std::vector< Calibration > calib)
float compute_lookup_value (int index, std::vector< Calibration > calib)
float linear_interpolate (float x, float x0, float y0, float x1, float y1)
void parse_calibration_file (TiXmlNode *pParent)
std::vector< Calibrationparse_joint_attributes (TiXmlNode *pParent)
int return_index_from_raw_position (float raw_position)
int round (float number)

Static Protected Member Functions

static float return_raw_position_from_index (int lookup_index)

Protected Attributes

mapType joints_calibrations_map
std::vector< JointCalibrationjointsCalibrations
 The vector containing the calibration.

Static Protected Attributes

static const float lookup_offset = 1.0f
static const float lookup_precision = 1000.0f

Detailed Description

Definition at line 52 of file xml_calibration_parser.h.


Member Typedef Documentation

typedef std::map<std::string, std::vector<float> > xml_calibration_parser::XmlCalibrationParser::mapType [protected]

Definition at line 83 of file xml_calibration_parser.h.


Constructor & Destructor Documentation

xml_calibration_parser::XmlCalibrationParser::XmlCalibrationParser (  )  [inline]

Definition at line 55 of file xml_calibration_parser.h.

xml_calibration_parser::XmlCalibrationParser::XmlCalibrationParser ( std::string  path_to_calibration  ) 

The constructor: parses the given file and stores the calibration in the vector std::vector<JointCalibration> jointsCalibrations.

Parameters:
path_to_calibration the path to the xml calibration file. Please note that it is best to use ros parameters to set the path in your code calling this constructor.

Definition at line 58 of file xml_calibration_parser.cpp.

xml_calibration_parser::XmlCalibrationParser::~XmlCalibrationParser (  )  [inline]

Definition at line 57 of file xml_calibration_parser.h.


Member Function Documentation

int xml_calibration_parser::XmlCalibrationParser::build_calibration_table (  )  [protected]

Transform the calibration values to a lookup table for fast processing of the calibration process. NB: the lookup table ranges from 0 to +lookup_offset with a precision of 1/lookup_precision.

Definition at line 175 of file xml_calibration_parser.cpp.

std::vector<float> xml_calibration_parser::XmlCalibrationParser::calibration_to_lookup_table ( std::vector< Calibration calib  )  [protected]
float xml_calibration_parser::XmlCalibrationParser::compute_lookup_value ( int  index,
std::vector< Calibration calib 
) [protected]
float xml_calibration_parser::XmlCalibrationParser::get_calibration_value ( float  position,
std::string  joint_name 
)

Definition at line 264 of file xml_calibration_parser.cpp.

std::vector< XmlCalibrationParser::JointCalibration > xml_calibration_parser::XmlCalibrationParser::getJointsCalibrations (  ) 

Definition at line 317 of file xml_calibration_parser.cpp.

float xml_calibration_parser::XmlCalibrationParser::linear_interpolate ( float  x,
float  x0,
float  y0,
float  x1,
float  y1 
) [protected]

Definition at line 282 of file xml_calibration_parser.cpp.

void xml_calibration_parser::XmlCalibrationParser::parse_calibration_file ( TiXmlNode *  pParent  )  [protected]

Parses the calibration file and retreive the full calibration for the cyberglove.

Parameters:
pParent The parent node (Cyberglove_calibration) containing all the xml tree.

Definition at line 82 of file xml_calibration_parser.cpp.

std::vector< XmlCalibrationParser::Calibration > xml_calibration_parser::XmlCalibrationParser::parse_joint_attributes ( TiXmlNode *  pParent  )  [protected]

Parses the Joint element of the calibration file.

Parameters:
pParent a Joint element
Returns:
the calibration values for this Joint.

Definition at line 122 of file xml_calibration_parser.cpp.

int xml_calibration_parser::XmlCalibrationParser::return_index_from_raw_position ( float  raw_position  )  [protected]

inline function to convert a raw position to a valid index for our lookup table

Parameters:
raw_position the raw position (directly read from the glove)
Returns:
the calibrated value

Definition at line 300 of file xml_calibration_parser.cpp.

static float xml_calibration_parser::XmlCalibrationParser::return_raw_position_from_index ( int  lookup_index  )  [inline, static, protected]

inline function to convert an index of our lookup table to a raw position.

Parameters:
lookup_index the index in the lookup table
Returns:
the corresponding raw position

Definition at line 127 of file xml_calibration_parser.h.

int xml_calibration_parser::XmlCalibrationParser::round ( float  number  )  [protected]

rounds the given number

Parameters:
number a float
Returns:
the float rounded to the closest int

Definition at line 309 of file xml_calibration_parser.cpp.


Member Data Documentation

Definition at line 84 of file xml_calibration_parser.h.

The vector containing the calibration.

Definition at line 81 of file xml_calibration_parser.h.

const float xml_calibration_parser::XmlCalibrationParser::lookup_offset = 1.0f [static, protected]

Definition at line 98 of file xml_calibration_parser.h.

const float xml_calibration_parser::XmlCalibrationParser::lookup_precision = 1000.0f [static, protected]

Definition at line 97 of file xml_calibration_parser.h.


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


cyberglove
Author(s): Ugo Cupcic
autogenerated on Fri Jan 11 11:37:57 2013