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

Method action_spec

dm_control/composer/task.py:178–195  ·  view source on GitHub ↗

Returns a `BoundedArray` spec matching the `Physics` actuators. BoundedArray.name should contain a tab-separated list of actuator names. When overloading this method, non-MuJoCo actuators should be added to the top of the list when possible, as a matter of convention. Args: p

(self, physics)

Source from the content-addressed store, hash-verified

176 self.control_timestep, self.physics_timestep)
177
178 def action_spec(self, physics):
179 """Returns a `BoundedArray` spec matching the `Physics` actuators.
180
181 BoundedArray.name should contain a tab-separated list of actuator names.
182 When overloading this method, non-MuJoCo actuators should be added to the
183 top of the list when possible, as a matter of convention.
184
185 Args:
186 physics: used to query actuator names in the model.
187 """
188 names = [physics.model.id2name(i, 'actuator') or str(i)
189 for i in range(physics.model.nu)]
190 action_spec = mujoco.action_spec(physics)
191 return specs.BoundedArray(shape=action_spec.shape,
192 dtype=action_spec.dtype,
193 minimum=action_spec.minimum,
194 maximum=action_spec.maximum,
195 name='\t'.join(names))
196
197 def get_reward_spec(self):
198 """Optional method to define non-scalar rewards for a `Task`."""

Callers

nothing calls this directly

Calls 1

id2nameMethod · 0.80

Tested by

no test coverage detected