Esempio n. 1
0
    /// <summary>
    /// Convert ROS-spaced TfQuaternion from TfListener to Unity-spaced Quaternion
    /// </summary>
    /// <param name="quat">A TfQuaternion as returned by the TransformListener class.</param>
    /// <returns>A quaternion</returns>
    public static Quaternion QuatTfToUnity(TfQuaternion quat)
    {
        Quaternion tfQ = new Quaternion(-(float)quat.x, -(float)quat.z, -(float)quat.y, (float)quat.w);

        // Right hand to Left Hand
        return(tfQ);
    }
Esempio n. 2
0
 /// <summary>
 /// Convert ROS-spaced TfQuaternion from TfListener to Unity-spaced Quaternion
 /// </summary>
 /// <param name="quat">A TfQuaternion as returned by the TransformListener class.</param>
 /// <returns>A quaternion</returns>
 public static Quaternion QuatTfToUnity(TfQuaternion quat)
 {
     return(new Quaternion((float)quat.x, (float)quat.y, (float)quat.z, (float)quat.w));  // TASK: not yet implemented
 }