Class SimpleOdometry2d

java.lang.Object
me.autobot.lib.odometry.SimpleOdometry2d

public class SimpleOdometry2d extends Object
A simple 2D odometry object that can be used to track the position and rotation of an object.
  • Constructor Details

    • SimpleOdometry2d

      public SimpleOdometry2d()
      Creates an empty odometry object with a position and rotation of 0.
    • SimpleOdometry2d

      public SimpleOdometry2d(Vector2d position, Rotation2d rotation)
      Creates an odometry object with a given position and rotation.
      Parameters:
      position - The position of the odometry object.
      rotation - The rotation of the odometry object.
  • Method Details

    • setStartPosition

      public SimpleOdometry2d setStartPosition(Vector2d startPosition)
      Sets the starting position of the odometry object.
      Parameters:
      startPosition - The starting position of the odometry object. This is useful for resetting the odometry object.
      Returns:
      The odometry object.
      See Also:
    • setStartRotation

      public SimpleOdometry2d setStartRotation(Rotation2d startRotation)
      Sets the starting rotation of the odometry object.
      Parameters:
      startRotation - The starting rotation of the odometry object. This is useful for resetting the odometry object.
      Returns:
      The odometry object.
      See Also:
    • reset

      public SimpleOdometry2d reset()
      Resets the odometry object to the starting position and rotation.
      Returns:
      The odometry object.
    • getPosition

      public Vector2d getPosition()
      Gets the current position of the odometry object.
      Returns:
      The current position of the odometry object.
    • getRotation

      public Rotation2d getRotation()
      Gets the current rotation of the odometry object.
      Returns:
      The current rotation of the odometry object.
    • rotate

      public void rotate(Rotation2d rotation)
      Rotates the odometry object by a given rotation.
      Parameters:
      rotation - The rotation to rotate the odometry object by.
    • move

      public void move(Vector2d movement)
      Moves the odometry object by a given movement.
      Parameters:
      movement - The movement to move the odometry object by.