code: def rotation_at_time(t, timestamps, rotation_sequence):
          
          idx = np.flatnonzero(timestamps >= (t - 0.0001))[0]
          t0 = timestamps[idx - 1]
          t1 = timestamps[idx]
          tau = (t - t0) / (t1 - t0)
          
          q1 = rotation_sequence[:, idx - 1]
          q2 = rotation_sequence[:, idx]
          q = rotations.slerp(q1, q2, tau)
          return q
docs: Get the gyro rotation at time t using SLERP.
          
          Parameters
          -----------
          t : float
                  The query timestamp.
          timestamps : array_like float
                  List of all timestamps
          rotation_sequence : (4, N) ndarray
                  Rotation sequence as unit quaternions with scalar part as first element.
                  
          Returns
          -----------
          q : (4,) ndarray
                  Unit quaternion representing the rotation at time t.