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

Method find

dm_control/mjcf/base.py:108–133  ·  view source on GitHub ↗

Finds an element with a particular identifier. This function allows the direct access to an arbitrarily deeply nested child element by name, without the need to manually traverse through the object tree. The `namespace` argument specifies the kind of element to find. In most cases,

(self, namespace, identifier)

Source from the content-addressed store, hash-verified

106
107 @abc.abstractmethod
108 def find(self, namespace, identifier):
109 """Finds an element with a particular identifier.
110
111 This function allows the direct access to an arbitrarily deeply nested
112 child element by name, without the need to manually traverse through the
113 object tree. The `namespace` argument specifies the kind of element to
114 find. In most cases, this corresponds to the element's XML tag name.
115 However, if an element has multiple specialized tags, then the namespace
116 corresponds to the tag name of the most general element of that kind.
117 For example, `namespace='joint'` would search for `<joint>` and
118 `<freejoint>`, while `namespace='actuator'` would search for `<general>`,
119 `<motor>`, `<position>`, `<velocity>`, and `<cylinder>`.
120
121 Args:
122 namespace: A string specifying the namespace being searched. See the
123 docstring above for explanation.
124 identifier: The identifier string of the desired element.
125
126 Returns:
127 An `mjcf.Element` object, or `None` if an element with the specified
128 identifier is not found.
129
130 Raises:
131 ValueError: if either `namespace` or `identifier` is not a string, or if
132 `namespace` is not a valid namespace.
133 """
134
135 @abc.abstractmethod
136 def find_all(self, namespace,

Callers 15

test_nestedMethod · 0.95
_make_modelFunction · 0.45
_make_modelFunction · 0.45
_make_modelFunction · 0.45
make_modelFunction · 0.45
testMJCFFeatureMethod · 0.45
testMJCFFeatureIndexMethod · 0.45
testMJCFCameraMethod · 0.45
testMJCFCameraSpecsMethod · 0.45
testMJCFSegCameraMethod · 0.45
find_elementFunction · 0.45

Calls

no outgoing calls

Tested by 15

test_nestedMethod · 0.76
testMJCFFeatureMethod · 0.36
testMJCFFeatureIndexMethod · 0.36
testMJCFCameraMethod · 0.36
testMJCFCameraSpecsMethod · 0.36
testMJCFSegCameraMethod · 0.36
testAttachMethod · 0.36
testAttachmentFramesMethod · 0.36