(self, keyframe_id=None)
Resets internal variables of the simulation, possibly to a keyframe.

    Args:
      keyframe_id: Optional integer specifying the index of a keyframe defined
        in the model XML to which the simulation state should be initialized.
        Must be between 0 and `self.model.nkey - 1` (inclusive).

    Raises:
      ValueError: If `keyframe_id` is out of range.
Resets internal variables of the simulation, possibly to a keyframe.
Resets internal variables of the simulation possibly to a keyframe .
def reset(self, keyframe_id=None):
    """Resets internal variables of the simulation, possibly to a keyframe.

    Args:
      keyframe_id: Optional integer specifying the index of a keyframe defined
        in the model XML to which the simulation state should be initialized.
        Must be between 0 and `self.model.nkey - 1` (inclusive).

    Raises:
      ValueError: If `keyframe_id` is out of range.
    """
    if keyframe_id is None:
      mjlib.mj_resetData(self.model.ptr, self.data.ptr)
    else:
      if not 0 <= keyframe_id < self.model.nkey:
        raise ValueError(_KEYFRAME_ID_OUT_OF_RANGE.format(
            max_valid=self.model.nkey-1, actual=keyframe_id))
      mjlib.mj_resetDataKeyframe(self.model.ptr, self.data.ptr, keyframe_id)

    # Disable actuation since we don't yet have meaningful control inputs.
    with self.model.disable('actuation'):
      self.forward()
def reset ( self , keyframe_id = None ) : if keyframe_id is None : mjlib . mj_resetData ( self . model . ptr , self . data . ptr ) else : if not 0 <= keyframe_id < self . model . nkey : raise ValueError ( _KEYFRAME_ID_OUT_OF_RANGE . format ( max_valid = self . model . nkey - 1 , actual = keyframe_id ) ) mjlib . mj_resetDataKeyframe ( self . model . ptr , self . data . ptr , keyframe_id ) # Disable actuation since we don't yet have meaningful control inputs. with self . model . disable ( 'actuation' ) : self . forward ( )