Class LocalizationEngine


  • public class LocalizationEngine
    extends java.lang.Object
    • Method Detail

      • calculate

        public void calculate​(double leftMeters,
                              double rightMeters,
                              double heading)
        Calculates the current robot location given some sensor readings. This should be called at least once every 20ms
        Parameters:
        leftMeters - Total distance in meters traveled by the left side of the robot
        rightMeters - Total distance in meters traveled by the right side of the robot
        heading - The robot's current heading/angle
      • getRotatedError

        public Error2D getRotatedError​(FieldPosition goalPosition)
        Get the rotated 2D error from the robot's current location to a goal position
        Parameters:
        goalPosition - Goal position (where the robot wants to be)
        Returns:
        Error from current position to goal
      • setRobotPosition

        public void setRobotPosition​(FieldPosition position)
        Force-set the robot location
        Parameters:
        position - Robot position
      • getRobotPosition

        public FieldPosition getRobotPosition()
        Get the robot's current field-relative position
        Returns:
        A COPY of the current position object
      • getLocationObject

        public FieldPosition getLocationObject()
        Get a reference to the current FieldPosition object. This should only be used if you know what you are doing.
        Returns:
        Local object reference