#include <xml_calibration_parser.h>
Classes | |
struct | Calibration |
struct | JointCalibration |
Public Member Functions | |
float | get_calibration_value (float position, std::string joint_name) |
std::vector< JointCalibration > | getJointsCalibrations () |
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< Calibration > | parse_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< JointCalibration > | jointsCalibrations |
The vector containing the calibration. | |
Static Protected Attributes | |
static const float | lookup_offset = 1.0f |
static const float | lookup_precision = 1000.0f |
Definition at line 52 of file xml_calibration_parser.h.
typedef std::map<std::string, std::vector<float> > xml_calibration_parser::XmlCalibrationParser::mapType [protected] |
Definition at line 83 of file xml_calibration_parser.h.
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.
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.
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.
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.
pParent | a Joint element |
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
raw_position | the raw position (directly read from the glove) |
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_index | the index in the lookup table |
Definition at line 127 of file xml_calibration_parser.h.
int xml_calibration_parser::XmlCalibrationParser::round | ( | float | number | ) | [protected] |
rounds the given number
number | a float |
Definition at line 309 of file xml_calibration_parser.cpp.
Definition at line 84 of file xml_calibration_parser.h.
std::vector<JointCalibration> xml_calibration_parser::XmlCalibrationParser::jointsCalibrations [protected] |
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.