(n_boxes)
return etree.tostring(mjcf, pretty_print=True), common.ASSETS
Returns a tuple containing the model XML string and a dict of assets.
Returns a tuple containing the model XML string and a dict of assets.
Returns a tuple containing the model XML string and a dict of assets .
def make_model(n_boxes):
  """Returns a tuple containing the model XML string and a dict of assets."""
  xml_string = common.read_model('stacker.xml')
  parser = etree.XMLParser(remove_blank_text=True)
  mjcf = etree.XML(xml_string, parser)

  # Remove unused boxes
  for b in range(n_boxes, 4):
    box = xml_tools.find_element(mjcf, 'body', 'box' + str(b))
    box.getparent().remove(box)

  return etree.tostring(mjcf, pretty_print=True), common.ASSETS
def make_model ( n_boxes ) : xml_string = common . read_model ( 'stacker.xml' ) parser = etree . XMLParser ( remove_blank_text = True ) mjcf = etree . XML ( xml_string , parser ) # Remove unused boxes for b in range ( n_boxes , 4 ) : box = xml_tools . find_element ( mjcf , 'body' , 'box' + str ( b ) ) box . getparent ( ) . remove ( box ) return etree . tostring ( mjcf , pretty_print = True ) , common . ASSETS