(self, physics)
return limits.T
Returns lower and upper bounds for sampling arm joint positions.

    Args:
      physics: An `mjcf.Physics` instance.

    Returns:
      A (2, num_joints) numpy array containing (lower, upper) position bounds.
      For hinge joints without limits the bounds are defined as [0, 2pi].

    Raises:
      RuntimeError: If the model contains unlimited joints that are not hinges.
Returns lower and upper bounds for sampling arm joint positions.
Returns lower and upper bounds for sampling arm joint positions .
def _get_joint_pos_sampling_bounds(self, physics):
    """Returns lower and upper bounds for sampling arm joint positions.

    Args:
      physics: An `mjcf.Physics` instance.

    Returns:
      A (2, num_joints) numpy array containing (lower, upper) position bounds.
      For hinge joints without limits the bounds are defined as [0, 2pi].

    Raises:
      RuntimeError: If the model contains unlimited joints that are not hinges.
    """
    bound_joints = physics.bind(self.joints)
    limits = np.array(bound_joints.range, copy=True)
    is_hinge = bound_joints.type == mjbindings.enums.mjtJoint.mjJNT_HINGE
    is_limited = bound_joints.limited.astype(np.bool)
    invalid = ~is_hinge & ~is_limited  # All non-hinge joints must have limits.
    if any(invalid):
      invalid_str = '\n'.join(str(self.joints[i]) for i in np.where(invalid)[0])
      raise RuntimeError(_INVALID_JOINTS_ERROR.format(invalid_str=invalid_str))
    # For unlimited hinges we sample positions between 0 and 2pi.
    limits[is_hinge & ~is_limited] = 0., 2*np.pi
    return limits.T
def _get_joint_pos_sampling_bounds ( self , physics ) : bound_joints = physics . bind ( self . joints ) limits = np . array ( bound_joints . range , copy = True ) is_hinge = bound_joints . type == mjbindings . enums . mjtJoint . mjJNT_HINGE is_limited = bound_joints . limited . astype ( np . bool ) invalid = ~ is_hinge & ~ is_limited # All non-hinge joints must have limits. if any ( invalid ) : invalid_str = '\n' . join ( str ( self . joints [ i ] ) for i in np . where ( invalid ) [ 0 ] ) raise RuntimeError ( _INVALID_JOINTS_ERROR . format ( invalid_str = invalid_str ) ) # For unlimited hinges we sample positions between 0 and 2pi. limits [ is_hinge & ~ is_limited ] = 0. , 2 * np . pi return limits . T