Class TrcPose3D

java.lang.Object
trclib.pathdrive.TrcPose3D

public class TrcPose3D extends Object
This class implements a 3D pose object that represents the positional state of an object.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    double
     
    double
     
    double
     
    double
     
    double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor: Create an instance of the object.
    TrcPose3D(double[] data)
    Constructor: Create an instance of the object.
    TrcPose3D(double x, double y, double z)
    Constructor: Create an instance of the object.
    TrcPose3D(double x, double y, double z, double yaw, double pitch, double roll)
    Constructor: Create an instance of the object.
  • Method Summary

    Modifier and Type
    Method
    Description
    This method creates and returns a copy of this pose.
    double
    This method returns the distance of the specified pose to this pose.
    boolean
    This method compares this pose with the specified pose for equality.
    int
    This method returns the hash code of the values in this pose.
    static TrcPose3D[]
    loadPosesFromCsv(String path, boolean loadFromResources)
    This method loads pose data from a CSV file either on the external file system or attached resources.
    void
    This method sets this pose to be the same as the given pose.
    This method converts the Pose3D to a Pose2D.
    org.apache.commons.math3.linear.RealVector
    This method returns the vector form of this pose.
    This method returns the string representation of the pose.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public double x
    • y

      public double y
    • z

      public double z
    • yaw

      public double yaw
    • pitch

      public double pitch
    • roll

      public double roll
  • Constructor Details

    • TrcPose3D

      public TrcPose3D(double x, double y, double z, double yaw, double pitch, double roll)
      Constructor: Create an instance of the object.
      Parameters:
      x - specifies the x component of the pose.
      y - specifies the y component of the pose.
      z - specifies the z component of the pose.
      yaw - specifies the yaw angle.
      pitch - specifies the pitch angle.
      roll - specifies the roll angle.
    • TrcPose3D

      public TrcPose3D(double[] data)
      Constructor: Create an instance of the object.
      Parameters:
      data - specifies an array with 6 elements: x, y, z, yaw, pitch and roll.
    • TrcPose3D

      public TrcPose3D(double x, double y, double z)
      Constructor: Create an instance of the object.
      Parameters:
      x - specifies the x coordinate of the pose.
      y - specifies the y coordinate of the pose.
      z - specifies the z coordinate of the pose.
    • TrcPose3D

      public TrcPose3D()
      Constructor: Create an instance of the object.
  • Method Details

    • toString

      public String toString()
      This method returns the string representation of the pose.
      Overrides:
      toString in class Object
      Returns:
      string representation of the pose.
    • loadPosesFromCsv

      public static TrcPose3D[] loadPosesFromCsv(String path, boolean loadFromResources)
      This method loads pose data from a CSV file either on the external file system or attached resources.
      Parameters:
      path - specifies the file system path or resource name.
      loadFromResources - specifies true if the data is from attached resources, false if from file system.
      Returns:
      an array of poses.
    • equals

      public boolean equals(Object o)
      This method compares this pose with the specified pose for equality.
      Overrides:
      equals in class Object
      Returns:
      true if equal, false otherwise.
    • hashCode

      public int hashCode()
      This method returns the hash code of the values in this pose.
      Overrides:
      hashCode in class Object
      Returns:
      pose hash code.
    • clone

      public TrcPose3D clone()
      This method creates and returns a copy of this pose.
      Overrides:
      clone in class Object
      Returns:
      a copy of this pose.
    • toPose2D

      public TrcPose2D toPose2D()
      This method converts the Pose3D to a Pose2D.
      Returns:
      converted Pose2D.
    • toPosVector

      public org.apache.commons.math3.linear.RealVector toPosVector()
      This method returns the vector form of this pose.
      Returns:
      vector form of this pose.
    • distanceTo

      public double distanceTo(TrcPose3D pose)
      This method returns the distance of the specified pose to this pose.
      Parameters:
      pose - specifies the pose to calculate the distance to.
      Returns:
      distance to specified pose.
    • setAs

      public void setAs(TrcPose3D pose)
      This method sets this pose to be the same as the given pose.
      Parameters:
      pose - specifies the pose to make this pose equal to.