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)
| 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.""" |
no outgoing calls