001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.math.kinematics;
006
007public class MecanumDriveWheelPositions {
008  /** Distance measured by the front left wheel. */
009  public double frontLeftMeters;
010
011  /** Distance measured by the front right wheel. */
012  public double frontRightMeters;
013
014  /** Distance measured by the rear left wheel. */
015  public double rearLeftMeters;
016
017  /** Distance measured by the rear right wheel. */
018  public double rearRightMeters;
019
020  /** Constructs a MecanumDriveWheelPositions with zeros for all member fields. */
021  public MecanumDriveWheelPositions() {}
022
023  /**
024   * Constructs a MecanumDriveWheelPositions.
025   *
026   * @param frontLeftMeters Distance measured by the front left wheel.
027   * @param frontRightMeters Distance measured by the front right wheel.
028   * @param rearLeftMeters Distance measured by the rear left wheel.
029   * @param rearRightMeters Distance measured by the rear right wheel.
030   */
031  public MecanumDriveWheelPositions(
032      double frontLeftMeters,
033      double frontRightMeters,
034      double rearLeftMeters,
035      double rearRightMeters) {
036    this.frontLeftMeters = frontLeftMeters;
037    this.frontRightMeters = frontRightMeters;
038    this.rearLeftMeters = rearLeftMeters;
039    this.rearRightMeters = rearRightMeters;
040  }
041
042  @Override
043  public String toString() {
044    return String.format(
045        "MecanumDriveWheelPositions(Front Left: %.2f m, Front Right: %.2f m, "
046            + "Rear Left: %.2f m, Rear Right: %.2f m)",
047        frontLeftMeters, frontRightMeters, rearLeftMeters, rearRightMeters);
048  }
049}