Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
xml_calibration_parser::XmlCalibrationParser Class Reference

#include <xml_calibration_parser.h>

List of all members.


struct  Calibration
struct  JointCalibration

Public Member Functions

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

Protected Types

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

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

Definition at line 55 of file xml_calibration_parser.h.

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

path_to_calibrationthe 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.

Definition at line 57 of file xml_calibration_parser.h.

Member Function Documentation

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.

return the value to store in the lookup table for a given index, using the calibration information.

indexthe index for which we compute the value
calibthe vector containing the calibration informations (a list of raw_value <=> calibrated_value)
the value to be stored in the lookup table

Definition at line 225 of file xml_calibration_parser.cpp.

float xml_calibration_parser::XmlCalibrationParser::get_calibration_value ( float  position,
std::string  joint_name 

Definition at line 264 of file xml_calibration_parser.cpp.

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.

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

pParentThe parent node (Cyberglove_calibration) containing all the xml tree.

Definition at line 82 of file xml_calibration_parser.cpp.

Parses the Joint element of the calibration file.

pParenta Joint element
the calibration values for this Joint.

Definition at line 122 of file xml_calibration_parser.cpp.

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

raw_positionthe raw position (directly read from the glove)
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.

lookup_indexthe index in the lookup table
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

numbera float
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:

Author(s): Ugo Cupcic
autogenerated on Fri Jan 3 2014 12:04:16