Generates an xml string defining a single physical body.
(body_index)
| 122 | |
| 123 | |
| 124 | def _make_body(body_index): |
| 125 | """Generates an xml string defining a single physical body.""" |
| 126 | body_name = 'segment_{}'.format(body_index) |
| 127 | visual_name = 'visual_{}'.format(body_index) |
| 128 | inertial_name = 'inertial_{}'.format(body_index) |
| 129 | body = etree.Element('body', name=body_name) |
| 130 | body.set('pos', '0 .1 0') |
| 131 | etree.SubElement(body, 'geom', {'class': 'visual', 'name': visual_name}) |
| 132 | etree.SubElement(body, 'geom', {'class': 'inertial', 'name': inertial_name}) |
| 133 | return body |
| 134 | |
| 135 | |
| 136 | class Physics(mujoco.Physics): |
no test coverage detected
searching dependent graphs…