Pose

public class Pose

This is the Pose class. It defines poses in 2D space, like the Pose2D class in Road Runner except in the Pedro Pathing code so I don't have to import the Road Runner library. A Pose consists of two coordinates defining a position and a third value for the heading, so basically just defining any position and orientation the robot can be at, unless your robot can fly for whatever reason.

Author

Anyi Lin - 10158 Scott's Bots

Constructors

Link copied to clipboard
public void Pose(double setX, double setY, double setHeading)
This creates a new Pose from a x, y, and heading inputs.
public void Pose(double setX, double setY, double setHeading, boolean isInPedroCoordinates)
This creates a new Pose from a x, y, and heading inputs in the Pedro Pathing coordinate system or the FTC Standard coordinate system.
public void Pose(double setX, double setY)
This creates a new Pose from x and y inputs.
public void Pose(double setX, double setY, boolean isInPedroCoordinates)
This creates a new Pose from x and y inputs.
public void Pose()
This creates a new Pose with no inputs and 0 for all values.

Properties

Link copied to clipboard
public double heading
Link copied to clipboard
public double x
Link copied to clipboard
public double y

Functions

Link copied to clipboard
public void add(Pose pose)
This adds all the values of an input Pose to this Pose.
Link copied to clipboard
public Pose copy()
This creates a copy of this Pose that points to a new memory location.
Link copied to clipboard
public void flipSigns()
This flips the signs of all values in this Pose by multiplying them by -1.
Link copied to clipboard
This is a method that converts the Pose to FTC Standard coordinate system from Pedro Coordinate system.
Link copied to clipboard
This is a method that converts the Pose to Pedro coordinates from the FTC Standard coordinate system.
Link copied to clipboard
public double getHeading()
This returns the heading value.
Link copied to clipboard
This returns a new Vector with magnitude 1 pointing in the direction of the heading.
Link copied to clipboard
public Vector getVector()
This returns the Pose as a Vector.
Link copied to clipboard
public double getX()
This returns the x value.
Link copied to clipboard
public double getY()
This returns the y value.
Link copied to clipboard
public boolean roughlyEquals(Pose pose)
This checks if the input Pose is within 0.0001 in all values to this Pose.
public boolean roughlyEquals(Pose pose, double accuracy)
This returns if a Pose is within a specified accuracy of this Pose in terms of x position, y position, and heading.
Link copied to clipboard
public void scalarDivide(double scalar)
This divides all the values of this Pose by a scalar.
Link copied to clipboard
public void scalarMultiply(double scalar)
This multiplies all the values of this Pose by a scalar.
Link copied to clipboard
public void setCoordinateSystem(boolean pedroCoordinates)
This sets the Pose to be in Pedro coordinates or FTC Standard coordinates.
Link copied to clipboard
public void setHeading(double set)
This sets the heading value.
Link copied to clipboard
public void setX(double set)
This sets the x value.
Link copied to clipboard
public void setY(double set)
This sets the y value.
Link copied to clipboard
public void subtract(Pose pose)
This subtracts all the values of an input Pose from this Pose.
Link copied to clipboard
public String toString()