(self, physics)
Randomizes the tail and fin angles and the orientation of the Fish.
Randomizes the tail and fin angles and the orientation of the Fish.
Randomizes the tail and fin angles and the orientation of the Fish .
def initialize_episode(self, physics):
    """Randomizes the tail and fin angles and the orientation of the Fish."""
    quat = self.random.randn(4)
    physics.named.data.qpos['root'][3:7] = quat / np.linalg.norm(quat)
    for joint in _JOINTS:
      physics.named.data.qpos[joint] = self.random.uniform(-.2, .2)
    # Hide the target. It's irrelevant for this task.
    physics.named.model.geom_rgba['target', 3] = 0
    super().initialize_episode(physics)
def initialize_episode ( self , physics ) : quat = self . random . randn ( 4 ) physics . named . data . qpos [ 'root' ] [ 3 : 7 ] = quat / np . linalg . norm ( quat ) for joint in _JOINTS : physics . named . data . qpos [ joint ] = self . random . uniform ( - .2 , .2 ) # Hide the target. It's irrelevant for this task. physics . named . model . geom_rgba [ 'target' , 3 ] = 0 super ( ) . initialize_episode ( physics )