robopal.commons.xml_splice module¶
- class robopal.commons.xml_splice.XMLSplicer(name: str = 'robot', scene: str = 'default', mount: str | List[str] = None, manipulator: str | List[str] = None, gripper: str | List[str] = None, **kwargs)[源代码]¶
基类:
object- add_component_from_xml(xml: str, goal_body: tuple) None[源代码]¶
For each input xml file, we extract the component we need, and append it into global tree.
- 参数:
xml -- xml file path
goal_body -- goal body, a tuple consist of id and name
- add_node_from_xml(xml_path: str = None)[源代码]¶
Add node from xml file. The attached node is the parent node of the new node. :param node: the parent node of the new node :param xml_path: the path of the xml file
- save_and_load_xml(output_path='/home/docs/checkouts/readthedocs.org/user_builds/robopal/envs/stable/lib/python3.11/site-packages/robopal/commons/../assets')[源代码]¶
Save xml file and get its path
- set_node_attrib(node: str, name: str, attrib: dict)[源代码]¶
Set node attribute. e.g. >>> self.set_node_attrib('body', 'green_block', {'pos': '0.5 0.0 0.46'}) :param node: node name :param attrib: attribute dict