(self)
return observable.Generic(bodies_orientations_in_egocentric_frame)
Orientations of the bodies as quaternions, in the egocentric frame.
Orientations of the bodies as quaternions, in the egocentric frame.
Orientations of the bodies as quaternions in the egocentric frame .
def bodies_quats(self):
    """Orientations of the bodies as quaternions, in the egocentric frame."""
    def bodies_orientations_in_egocentric_frame(physics):
      """Compute relative orientation of the bodies."""
      # Get the bodies
      bodies = self._entity.bodies
      # Get the quaternions of all the bodies &root in the global frame
      bodies_xquat = physics.bind(bodies).xquat
      root_xquat = physics.bind(self._entity.root_body).xquat
      # Compute the relative quaternion of the bodies in the root frame
      bodies_quat_diff = transformations.quat_diff(
          np.tile(root_xquat, len(bodies)).reshape(-1, 4),
          bodies_xquat)  # q1^-1 * q2
      return np.reshape(bodies_quat_diff, -1)
    return observable.Generic(bodies_orientations_in_egocentric_frame)
def bodies_quats ( self ) : def bodies_orientations_in_egocentric_frame ( physics ) : """Compute relative orientation of the bodies.""" # Get the bodies bodies = self . _entity . bodies # Get the quaternions of all the bodies &root in the global frame bodies_xquat = physics . bind ( bodies ) . xquat root_xquat = physics . bind ( self . _entity . root_body ) . xquat # Compute the relative quaternion of the bodies in the root frame bodies_quat_diff = transformations . quat_diff ( np . tile ( root_xquat , len ( bodies ) ) . reshape ( - 1 , 4 ) , bodies_xquat ) # q1^-1 * q2 return np . reshape ( bodies_quat_diff , - 1 ) return observable . Generic ( bodies_orientations_in_egocentric_frame )