MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / _make_body

Function _make_body

dm_control/suite/swimmer.py:124–133  ·  view source on GitHub ↗

Generates an xml string defining a single physical body.

(body_index)

Source from the content-addressed store, hash-verified

122
123
124def _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
136class Physics(mujoco.Physics):

Callers 1

_make_modelFunction · 0.70

Calls 1

setMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…