pcg_gazebo.parsers
pcg_gazebo.parsers¶
Parsing module to generated and convert SDF, URDF and SDF Configuration formats.
Sources
parse_sdf¶
parse_sdf(input_xml)
pcg_gazebo SDF instance.
Input arguments
input_xml(type:str): Filename of the SDF file or SDF XML formatted text.
Returns
pcg_gazebo.parsers.types.XMLBase object.
parse_urdf¶
parse_urdf(input_xml)
pcg_gazebo URDF instance.
Input arguments
input_xml(type:str): Filename of the URDF file or URDF XML formatted text.
Returns
pcg_gazebo.parsers.types.XMLBase object.
parse_sdf_config¶
parse_sdf_config(input_xml)
pcg_gazebo SDF Configuration instance.
Input arguments
input_xml(type:str): Filename of the SDF Configuration file or SDF Configuration XML formatted text.
Returns
pcg_gazebo.parsers.types.XMLBase object.
parse_xml¶
parse_xml(input_xml, type='sdf')
collections.OrderedDict.
Input arguments
input_xml(type:str): Filename of the XML file or XML formatted text.type(type:str): Type of XML format used in the input file, options aresdf,urdforsdf_config.
Returns
collections.OrderedDict: Dictionary where the XML tags are the keys.
parse_xml_str¶
parse_xml_str(xml_str, type='sdf')
collections.OrderedDict.
Input arguments
input_xml(type:str): XML formatted text.type(type:str): Type of XML format used in the input file, options aresdf,urdforsdf_config.
Returns
collections.OrderedDict: Dictionary where the XML tags are the keys.
parse_xml_dict¶
parse_xml_dict(xml_dict, type='sdf')
collections.OrderedDict created from a XML file
and return an SDF, URDF or SDF Configuration pcg_gazebo element.
Input arguments
xml_dict(type:collections.OrderedDict): XML contents.type(type:str): Type of XML format used in the input file, options aresdf,urdforsdf_config.
Returns
pcg_gazebo.parsers.types.XMLBase object.
convert_to_dict¶
convert_to_dict(xml_dict)
xmltodict output into a dictionary that can be
parsed into a pcg_gazebo.parsers.types.XMLBase.
Input arguments
xml_dict(type:collections.OrderedDict): XML content in dictionary form.
Returns
dict: Formatted XML dictionary.
convert_from_string¶
convert_from_string(str_input_xml)
Input arguments
str_input_xml(type:str): Input string
Returns
bool, int, float, list of float or str.
sdf2urdf¶
sdf2urdf(sdf)
pcg_gazebo element and its child elements
into an URDF pcg_gazebo element.
Input arguments
sdf(type:pcg_gazebo.parsers.types.XMLBase): Valid SDF element
Returns
pcg_gazebo.parsers.types.XMLBase as an URDF element.
urdf2sdf¶
urdf2sdf(urdf)
pcg_gazebo element and its child elements
into a SDF pcg_gazebo element.
Input arguments
urdf(type:pcg_gazebo.parsers.types.XMLBase): Valid URDF element
Returns
pcg_gazebo.parsers.types.XMLBase as a SDF element.