libmove3d  3.13.0
Classes | Typedefs | Functions
GraspIO
GraspPlanning

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:
graspListthe grasp list to check
objectNamename 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:
filenamename of the XML file
graspListthe grasp list that will be filled with the content of the file
Returns:
GP_OK in case of success, GP_ERROR otherwise
bool gpParseContact ( xmlDocPtr  doc,
xmlNodePtr  entry_node,
gpContactParserData data 
)

Reads the content of a <contact> node and fills the gpContactParserData structure.

Parameters:
docpointer to the structure used by libxml2 to parse the XML document
entry_nodethe node whose children will be browsed
datathe 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:
docpointer to the structure used by libxml2 to parse the XML document
entry_nodethe node whose children will be browsed
elementthe name of the element that will be looked for among the entry node children
datathe data structure that will be used to store the read information
Returns:
true if the searched element was found, false otherwise
bool gpParseGrasp ( xmlDocPtr  doc,
xmlNodePtr  entry_node,
gpGraspParserData data 
)

Reads the content of a <grasp> node and fills the gpGraspParserData structure.

Parameters:
docpointer to the structure used by libxml2 to parse the XML document
entry_nodethe node whose children will be browsed
datathe 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:
graspListthe grasp list to save
filenamethe 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
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines