Package trclib.pathdrive
Class TrcPose3D
java.lang.Object
trclib.pathdrive.TrcPose3D
This class implements a 3D pose object that represents the positional state of an object.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor: 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 TypeMethodDescriptionclone()
This method creates and returns a copy of this pose.double
distanceTo
(TrcPose3D pose) 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
hashCode()
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.toPose2D()
This method converts the Pose3D to a Pose2D.org.apache.commons.math3.linear.RealVector
This method returns the vector form of this pose.toString()
This method returns the string representation of the pose.
-
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
This method returns the string representation of the pose. -
loadPosesFromCsv
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
This method compares this pose with the specified pose for equality. -
hashCode
public int hashCode()This method returns the hash code of the values in this pose. -
clone
This method creates and returns a copy of this pose. -
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
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
This method sets this pose to be the same as the given pose.- Parameters:
pose
- specifies the pose to make this pose equal to.
-