Package edu.tufts.hrilab.map.util
Class Utils
java.lang.Object
edu.tufts.hrilab.map.util.Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javax.vecmath.Matrix4d
convertToMatrix4d
(Pose pose) converts a point and orientation to matrix formatstatic Pose
convertToPose
(javax.vecmath.Matrix4d m) gets pose from a Matrix4dstatic double
dist
(double x1, double y1, double x2, double y2) gets distance between two pointsstatic double
dist
(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2) gets distance between two pointsstatic javax.vecmath.Quat4d
eulerToQuat4d
(double yaw, double pitch, double roll) Converts a euler angle to a quat4dstatic double[]
quat4dToEuler
(javax.vecmath.Quat4d q) converts a quat4d into euler angles
-
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 pointp2
- 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 xy1
- source point yx2
- target point xy2
- target point y- Returns:
- distance between the points
-
convertToMatrix4d
converts a point and orientation to matrix format- Parameters:
pose
-- Returns:
- a Matrix4d representing the point and orientation
-
convertToPose
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 anglepitch
- pitch of euler angleroll
- roll of euler angle
-