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
007/** Represents the motor voltages for a mecanum drive drivetrain. */
008@SuppressWarnings("MemberName")
009public class MecanumDriveMotorVoltages {
010  /** Voltage of the front left motor. */
011  public double frontLeftVoltage;
012
013  /** Voltage of the front right motor. */
014  public double frontRightVoltage;
015
016  /** Voltage of the rear left motor. */
017  public double rearLeftVoltage;
018
019  /** Voltage of the rear right motor. */
020  public double rearRightVoltage;
021
022  /** Constructs a MecanumDriveMotorVoltages with zeros for all member fields. */
023  public MecanumDriveMotorVoltages() {}
024
025  /**
026   * Constructs a MecanumDriveMotorVoltages.
027   *
028   * @param frontLeftVoltage Voltage of the front left motor.
029   * @param frontRightVoltage Voltage of the front right motor.
030   * @param rearLeftVoltage Voltage of the rear left motor.
031   * @param rearRightVoltage Voltage of the rear right motor.
032   */
033  public MecanumDriveMotorVoltages(
034      double frontLeftVoltage,
035      double frontRightVoltage,
036      double rearLeftVoltage,
037      double rearRightVoltage) {
038    this.frontLeftVoltage = frontLeftVoltage;
039    this.frontRightVoltage = frontRightVoltage;
040    this.rearLeftVoltage = rearLeftVoltage;
041    this.rearRightVoltage = rearRightVoltage;
042  }
043
044  @Override
045  public String toString() {
046    return String.format(
047        "MecanumDriveMotorVoltages(Front Left: %.2f V, Front Right: %.2f V, "
048            + "Rear Left: %.2f V, Rear Right: %.2f V)",
049        frontLeftVoltage, frontRightVoltage, rearLeftVoltage, rearRightVoltage);
050  }
051}