Class Utils

java.lang.Object
edu.tufts.hrilab.map.util.Utils

public class Utils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javax.vecmath.Matrix4d
    converts a point and orientation to matrix format
    static Pose
    convertToPose(javax.vecmath.Matrix4d m)
    gets pose from a Matrix4d
    static double
    dist(double x1, double y1, double x2, double y2)
    gets distance between two points
    static double
    dist(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
    gets distance between two points
    static javax.vecmath.Quat4d
    eulerToQuat4d(double yaw, double pitch, double roll)
    Converts a euler angle to a quat4d
    static double[]
    quat4dToEuler(javax.vecmath.Quat4d q)
    converts a quat4d into euler angles

    Methods inherited from class java.lang.Object

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

    • Utils

      public Utils()
  • Method Details

    • dist

      public static double dist(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
      gets distance between two points
      Parameters:
      p1 - source point
      p2 - target point
      Returns:
      distance between the points
    • dist

      public static double dist(double x1, double y1, double x2, double y2)
      gets distance between two points
      Parameters:
      x1 - source point x
      y1 - source point y
      x2 - target point x
      y2 - target point y
      Returns:
      distance between the points
    • convertToMatrix4d

      public static javax.vecmath.Matrix4d convertToMatrix4d(Pose pose)
      converts a point and orientation to matrix format
      Parameters:
      pose -
      Returns:
      a Matrix4d representing the point and orientation
    • convertToPose

      public static Pose convertToPose(javax.vecmath.Matrix4d m)
      gets pose from a Matrix4d
      Parameters:
      m - matrix to get pose from
      Returns:
      pose represented by m
    • quat4dToEuler

      public static double[] quat4dToEuler(javax.vecmath.Quat4d q)
      converts a quat4d into euler angles
      Parameters:
      q - quat4d to convert
      Returns:
      double array with euler angles {roll, pitch, yaw}
    • eulerToQuat4d

      public static javax.vecmath.Quat4d eulerToQuat4d(double yaw, double pitch, double roll)
      Converts a euler angle to a quat4d
      Parameters:
      yaw - yaw of euler angle
      pitch - pitch of euler angle
      roll - roll of euler angle