(random, limit)
return quaternion
Generates a random quaternion limited to the specified rotations.
Generates a random quaternion limited to the specified rotations.
Generates a random quaternion limited to the specified rotations .
def random_limited_quaternion(random, limit):
  """Generates a random quaternion limited to the specified rotations."""
  axis = random.randn(3)
  axis /= np.linalg.norm(axis)
  angle = random.rand() * limit

  quaternion = np.zeros(4)
  mjbindings.mjlib.mju_axisAngle2Quat(quaternion, axis, angle)

  return quaternion
def random_limited_quaternion ( random , limit ) : axis = random . randn ( 3 ) axis /= np . linalg . norm ( axis ) angle = random . rand ( ) * limit quaternion = np . zeros ( 4 ) mjbindings . mjlib . mju_axisAngle2Quat ( quaternion , axis , angle ) return quaternion