Class Convert

java.lang.Object
edu.tufts.hrilab.util.Convert

public class Convert extends Object
Methods for converting between various Transform related types (points, orientations, etc). NOTE: this is similar to the edu.tufts.hrilab.diarcros.util.Convert class but contains only non-ROS versions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    convertToEuler(javax.vecmath.Quat4d q)
    Convert a quaternion to euler angles.
    static javax.vecmath.Matrix4d
    convertToMatrix4d(javax.vecmath.Point3d p, javax.vecmath.Quat4d q)
    Converts a point and orientation to matrix format.
    static javax.vecmath.Matrix4d
    convertToMatrix4d(org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d,javax.vecmath.Quat4d> pose)
    converts a point and orientation to matrix format
    static org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d,javax.vecmath.Quat4d>
    convertToPair(javax.vecmath.Matrix4d m)
    gets pose from a Matrix4d
    static javax.vecmath.Quat4d
    convertToQuat4d(double yaw, double pitch, double roll)
    Convert euler angles to Quat4d quaternion.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Convert

      public Convert()
  • Method Details

    • convertToMatrix4d

      public static javax.vecmath.Matrix4d convertToMatrix4d(javax.vecmath.Point3d p, javax.vecmath.Quat4d q)
      Converts a point and orientation to matrix format.
      Parameters:
      p - point (x,y,z)
      q - quaternion (x,y,z,w)
      Returns:
      a Matrix4d representing the point and orientation
    • convertToMatrix4d

      public static javax.vecmath.Matrix4d convertToMatrix4d(org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d,javax.vecmath.Quat4d> pose)
      converts a point and orientation to matrix format
      Parameters:
      pose -
      Returns:
      a Matrix4d representing the point and orientation
    • convertToPair

      public static org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d,javax.vecmath.Quat4d> convertToPair(javax.vecmath.Matrix4d m)
      gets pose from a Matrix4d
      Parameters:
      m - matrix to get pose from
      Returns:
      pose represented by m
    • convertToEuler

      public static double[] convertToEuler(javax.vecmath.Quat4d q)
      Convert a quaternion to euler angles. quat4d -> XYZ Euler Angles (NASA Standard Aeroplane) (https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/indexLocal.htm)
      Parameters:
      q - Quat4d quaternion
      Returns:
    • convertToQuat4d

      public static javax.vecmath.Quat4d convertToQuat4d(double yaw, double pitch, double roll)
      Convert euler angles to Quat4d quaternion.
      Parameters:
      yaw -
      pitch -
      roll -
      Returns: