MCPcopy Index your code
hub / github.com/google-deepmind/dm_control / attach

Method attach

dm_control/composer/entity.py:299–317  ·  view source on GitHub ↗

Attaches an `Entity` without any additional degrees of freedom. Args: entity: The `Entity` to attach. attach_site: (optional) The site to which to attach the entity's model. If not set, defaults to self.attachment_site. Returns: The frame of the attached model.

(self, entity, attach_site=None)

Source from the content-addressed store, hash-verified

297 raise NotImplementedError
298
299 def attach(self, entity, attach_site=None):
300 """Attaches an `Entity` without any additional degrees of freedom.
301
302 Args:
303 entity: The `Entity` to attach.
304 attach_site: (optional) The site to which to attach the entity's model. If
305 not set, defaults to self.attachment_site.
306
307 Returns:
308 The frame of the attached model.
309 """
310
311 if attach_site is None:
312 attach_site = self.attachment_site
313
314 frame = attach_site.attach(entity.mjcf_model)
315 self._attached.append(entity)
316 entity._parent = weakref.ref(self) # pylint: disable=protected-access
317 return frame
318
319 def detach(self):
320 """Detaches this entity if it has previously been attached."""

Callers 15

setUpMethod · 0.45
add_free_entityMethod · 0.45
testObservableNamesMethod · 0.45
testAttachMethod · 0.45
testDetachMethod · 0.45
testSetPoseMethod · 0.45
testShiftPoseMethod · 0.45
make_modelMethod · 0.45

Calls

no outgoing calls

Tested by 15

setUpMethod · 0.36
testObservableNamesMethod · 0.36
testAttachMethod · 0.36
testDetachMethod · 0.36
testSetPoseMethod · 0.36
testShiftPoseMethod · 0.36
make_modelMethod · 0.36