Returns a tuple containing the model XML string and a dict of assets.
(n_boxes)
| 39 | |
| 40 | |
| 41 | def make_model(n_boxes): |
| 42 | """Returns a tuple containing the model XML string and a dict of assets.""" |
| 43 | xml_string = common.read_model('stacker.xml') |
| 44 | parser = etree.XMLParser(remove_blank_text=True) |
| 45 | mjcf = etree.XML(xml_string, parser) |
| 46 | |
| 47 | # Remove unused boxes |
| 48 | for b in range(n_boxes, 4): |
| 49 | box = xml_tools.find_element(mjcf, 'body', 'box' + str(b)) |
| 50 | box.getparent().remove(box) |
| 51 | |
| 52 | return etree.tostring(mjcf, pretty_print=True), common.ASSETS |
| 53 | |
| 54 | |
| 55 | @SUITE.add('hard') |