Drake
xmlUtil.cpp File Reference
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <string>
#include "drake/Path.h"
#include "drake/common/drake_assert.h"
#include "drake/math/roll_pitch_yaw.h"
#include "drake/thirdParty/bsd/tinydir/tinydir.h"
#include "xmlUtil.h"
Include dependency graph for xmlUtil.cpp:

Functions

void ParseThreeVectorValue (const char *strval, Eigen::Vector3d *val)
 Parses a three vector value from parameter strval. More...
 
double StringToDouble (const string &str)
 Converts a string to a double value. More...
 
void ParseThreeVectorValue (const tinyxml2::XMLElement *node, Eigen::Vector3d *val)
 Parses a three vector value from parameter node, which is an XML node. More...
 
void ParseThreeVectorValue (const tinyxml2::XMLElement *node, const char *element_name, Eigen::Vector3d *val)
 Parses a three vector value from parameter node, which is an XML node. More...
 
void ParseThreeVectorAttribute (const tinyxml2::XMLElement *node, const char *attribute_name, Eigen::Vector3d *val)
 Parses a three vector value from parameter node, which is an XML node. More...
 
bool parseVectorAttribute (const tinyxml2::XMLElement *node, const char *attribute_name, Eigen::Vector3d &val)
 
bool parseVectorAttribute (const tinyxml2::XMLElement *node, const char *attribute_name, Eigen::Vector4d &val)
 
bool parseVectorValue (tinyxml2::XMLElement *node, const char *element_name, Eigen::Vector3d &val)
 
bool parseVectorValue (tinyxml2::XMLElement *node, const char *element_name, Eigen::Vector4d &val)
 
bool parseStringValue (tinyxml2::XMLElement *node, const char *element_name, std::string &val)
 
void originAttributesToTransform (tinyxml2::XMLElement *node, Eigen::Isometry3d &T)
 
void poseValueToTransform (tinyxml2::XMLElement *node, const PoseMap &pose_map, Eigen::Isometry3d &T, const Eigen::Isometry3d &T_default_frame)
 
void populatePackageMap (map< string, string > &package_map)
 
string resolveFilename (const string &filename, const map< string, string > &package_map, const string &root_dir)
 

Function Documentation

void originAttributesToTransform ( tinyxml2::XMLElement *  node,
Eigen::Isometry3d &  T 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool parseStringValue ( tinyxml2::XMLElement *  node,
const char *  element_name,
std::string &  val 
)

Here is the caller graph for this function:

void ParseThreeVectorAttribute ( const tinyxml2::XMLElement *  node,
const char *  attribute_name,
Eigen::Vector3d *  val 
)

Parses a three vector value from parameter node, which is an XML node.

The value is specified by an attribute within the XML whose name is apecified by parameter attribute_name.This method also supports a three vector specified by a single scalar value, which it automatically converts into a three vector by using the same scalar value for all three dimensions.

Parameters
[in]nodeA pointer to the XML element node that contains an attribute with a three vector or a scalar value.
[in]attribute_nameThe name of the attribute containing the three vector or scalar value.
[out]valThe three vector where the results should be stored.
Returns
Whether the three vector was successfully parsed from the XML element node.
Exceptions
std::invalid_argumentIf any problem is encountered parsing the three vector value.

Here is the call graph for this function:

Here is the caller graph for this function:

void ParseThreeVectorValue ( const char *  strval,
Eigen::Vector3d *  val 
)

Parses a three vector value from parameter strval.

There are two formats of strval that can be successfully parsed. The first format is "val1 val2 val3" where val1, val2, and val3 are double values. The second valid format is "val" where val is a double type. In this case, this method automatically converts the val1 scalar value into a three vector by using the same scalar value for all three dimensions.

Parameters
[in]strvalA pointer to the character array describing a three vector or a scalar value.
[out]valThe three vector into which the results should be stored.
Returns
Whether the three vector was successfully parsed from strval.
Exceptions
std::invalid_argumentIf any problem is encountered parsing the three vector value.

Here is the call graph for this function:

Here is the caller graph for this function:

void ParseThreeVectorValue ( const tinyxml2::XMLElement *  node,
Eigen::Vector3d *  val 
)

Parses a three vector value from parameter node, which is an XML node.

It also supports a single scalar value, which it automatically converts to a three vector by using the same scalar value for all three dimensions.

Parameters
[in]nodeA pointer to the XML element node that contains either a three vector or a scalar value.
[out]valThe three vector into which the results should be stored.
Returns
Whether the three vector was successfully parsed from the XML element node.
Exceptions
std::invalid_argumentIf any problem is encountered parsing the three vector value.

Here is the call graph for this function:

void ParseThreeVectorValue ( const tinyxml2::XMLElement *  node,
const char *  element_name,
Eigen::Vector3d *  val 
)

Parses a three vector value from parameter node, which is an XML node.

The value is contained in an element within node, as specified by parameter element_name. This method also supports a three vector specified by a single scalar value, which it automatically converts into a three vector by using the same scalar value for all three dimensions.

Parameters
[in]nodeA pointer to the XML element node that contains either a three vector or a scalar value.
[in]element_nameThe name of the child XML element containing the scale three vector or scalar value.
[out]valThe three vector where the results should be stored.
Returns
Whether the three vector was successfully parsed from the XML element node.
Exceptions
std::invalid_argumentIf any problem is encountered parsing the three vector value.

Here is the call graph for this function:

bool parseVectorAttribute ( const tinyxml2::XMLElement *  node,
const char *  attribute_name,
Eigen::Vector3d &  val 
)

Here is the caller graph for this function:

bool parseVectorAttribute ( const tinyxml2::XMLElement *  node,
const char *  attribute_name,
Eigen::Vector4d &  val 
)
bool parseVectorValue ( tinyxml2::XMLElement *  node,
const char *  element_name,
Eigen::Vector3d &  val 
)

Here is the caller graph for this function:

bool parseVectorValue ( tinyxml2::XMLElement *  node,
const char *  element_name,
Eigen::Vector4d &  val 
)
void populatePackageMap ( map< string, string > &  package_map)
void poseValueToTransform ( tinyxml2::XMLElement *  node,
const PoseMap pose_map,
Eigen::Isometry3d &  T,
const Eigen::Isometry3d &  T_default_frame 
)

Here is the call graph for this function:

Here is the caller graph for this function:

string resolveFilename ( const string &  filename,
const map< string, string > &  package_map,
const string &  root_dir 
)
double StringToDouble ( const std::string &  str)

Converts a string to a double value.

Parameters
[in]strA pointer to a string containing a representation of a double value.
Returns
The corresponding double value that was represented in str.
Exceptions
std::invalid_argumentIf any problem is encountered while parsing the double value represented within str.

Here is the caller graph for this function: