Classes |
struct | gpElementParserData |
struct | gpContactParserData |
struct | gpGraspParserData |
Typedefs |
typedef struct gpElementParserData | gpElementParserData |
typedef struct gpContactParserData | gpContactParserData |
typedef struct gpGraspParserData | gpGraspParserData |
Functions |
int | gpSave_grasp_list (std::list< gpGrasp > &graspList, std::string filename) |
std::string | getNodeString (xmlDocPtr doc, xmlNodePtr node) |
void | warningMessage (int line_number, const xmlChar *URL, const xmlChar *element_name, std::string &message) |
void | formatErrorMessage (int line_number, const xmlChar *URL, const xmlChar *element_name, std::string &message) |
void | elementMissingMessage (int line_number, const xmlChar *URL, const xmlChar *element_name, std::string &message) |
bool | gpParseElement (xmlDocPtr doc, xmlNodePtr entry_node, std::string element, gpElementParserData &data) |
bool | gpParseContact (xmlDocPtr doc, xmlNodePtr entry_node, gpContactParserData &data) |
bool | gpParseGrasp (xmlDocPtr doc, xmlNodePtr entry_node, gpGraspParserData &data) |
int | gpLoad_grasp_list (std::string filename, std::list< gpGrasp > &graspList) |
int | gpCheck_grasp_list_validity (std::list< gpGrasp > &graspList, std::string objectName) |
Detailed Description
This module is used to read and write files (in XML format) containing a list of grasps computed for a given object with a given hand.
Function Documentation
std::string getNodeString |
( |
xmlDocPtr |
doc, |
|
|
xmlNodePtr |
node |
|
) |
| |
Converts the char string of the given node to a std::string after removing all newline characters as well as space characters at the end of the string.
int gpCheck_grasp_list_validity |
( |
std::list< gpGrasp > & |
graspList, |
|
|
std::string |
objectName |
|
) |
| |
Checks the validity of a grasp list.
- Parameters:
-
graspList | the grasp list to check |
objectName | name of the object (a freeflying robot) we load the list for |
- Returns:
- GP_OK in case of success (valid list), GP_ERROR otherwise
int gpLoad_grasp_list |
( |
std::string |
filename, |
|
|
std::list< gpGrasp > & |
graspList |
|
) |
| |
Parses an XML file describing a grasp list.
- Parameters:
-
filename | name of the XML file |
graspList | the grasp list that will be filled with the content of the file |
- Returns:
- GP_OK in case of success, GP_ERROR otherwise
Reads the content of a <contact> node and fills the gpContactParserData structure.
- Parameters:
-
doc | pointer to the structure used by libxml2 to parse the XML document |
entry_node | the node whose children will be browsed |
data | the data structure that will be used to store all the read information about the body |
- Returns:
- true if all the mandatory elements were found, false otherwise
bool gpParseElement |
( |
xmlDocPtr |
doc, |
|
|
xmlNodePtr |
entry_node, |
|
|
std::string |
element, |
|
|
gpElementParserData & |
data |
|
) |
| |
Reads the content of the given node and fills the appropriate field in the gpElementParserData structure. This function is used for simple element (with no chidren nodes).
- Parameters:
-
doc | pointer to the structure used by libxml2 to parse the XML document |
entry_node | the node whose children will be browsed |
element | the name of the element that will be looked for among the entry node children |
data | the data structure that will be used to store the read information |
- Returns:
- true if the searched element was found, false otherwise
Reads the content of a <grasp> node and fills the gpGraspParserData structure.
- Parameters:
-
doc | pointer to the structure used by libxml2 to parse the XML document |
entry_node | the node whose children will be browsed |
data | the data structure that will be used to store all the read information about the body |
- Returns:
- true if all the mandatory elements were found, false otherwise
int gpSave_grasp_list |
( |
std::list< gpGrasp > & |
graspList, |
|
|
std::string |
filename |
|
) |
| |
Saves a grasp list as a file in XML format.
- Parameters:
-
graspList | the grasp list to save |
filename | the file where to save the list in (if it has no .xml extension, the extension will be added) |
- Returns:
- GP_OK in case of success, GP_ERROR otherwise