(body_index)
return body
Generates an xml string defining a single physical body.
Generates an xml string defining a single physical body.
Generates an xml string defining a single physical body .
def _make_body(body_index):
  """Generates an xml string defining a single physical body."""
  body_name = 'segment_{}'.format(body_index)
  visual_name = 'visual_{}'.format(body_index)
  inertial_name = 'inertial_{}'.format(body_index)
  body = etree.Element('body', name=body_name)
  body.set('pos', '0 .1 0')
  etree.SubElement(body, 'geom', {'class': 'visual', 'name': visual_name})
  etree.SubElement(body, 'geom', {'class': 'inertial', 'name': inertial_name})
  return body
def _make_body ( body_index ) : body_name = 'segment_{}' . format ( body_index ) visual_name = 'visual_{}' . format ( body_index ) inertial_name = 'inertial_{}' . format ( body_index ) body = etree . Element ( 'body' , name = body_name ) body . set ( 'pos' , '0 .1 0' ) etree . SubElement ( body , 'geom' , { 'class' : 'visual' , 'name' : visual_name } ) etree . SubElement ( body , 'geom' , { 'class' : 'inertial' , 'name' : inertial_name } ) return body