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)
| 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`.""" |