Class FieldPose

java.lang.Object
com.crossbotics.ftchelper.util.FieldPose

public class FieldPose extends Object
Where the robot is on the field: x and y in inches, heading in degrees (counterclockwise is positive, like the IMU).

A "pose" is the robot's place AND the way it is pointing, together.

The library does not choose where (0, 0) is. Your team decides that for each game and writes it down. Docs: docs/modules/util.md. Signs: docs/conventions.md.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    Degrees, counterclockwise positive.
    double
    Inches.
    double
    Inches.
  • Constructor Summary

    Constructors
    Constructor
    Description
    A pose at (0, 0), heading 0.
    FieldPose(double x, double y, double headingDeg)
    Makes a pose from three numbers.
  • Method Summary

    Modifier and Type
    Method
    Description
    A new pose with the same numbers.
    The pose as text for telemetry, e.g.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public double x
      Inches.
    • y

      public double y
      Inches.
    • headingDeg

      public double headingDeg
      Degrees, counterclockwise positive.
  • Constructor Details

    • FieldPose

      public FieldPose()
      A pose at (0, 0), heading 0.
    • FieldPose

      public FieldPose(double x, double y, double headingDeg)
      Makes a pose from three numbers.
      Parameters:
      x - inches
      y - inches
      headingDeg - degrees, counterclockwise positive
  • Method Details

    • copy

      public FieldPose copy()
      A new pose with the same numbers. Changing the copy does not change this one. (In Java, passing an object around shares the SAME object; a copy keeps them apart.)
    • toString

      public String toString()
      The pose as text for telemetry, e.g. "(12.0 in, -36.5 in, 90.0 deg)". "@Override" means this replaces Java's built-in toString, which would print gibberish.
      Overrides:
      toString in class Object