[wpilib] Replace MecanumDriveMotorVoltages with a functional interface (#6760)

This commit is contained in:
Wispy
2024-12-08 19:05:06 -06:00
committed by GitHub
parent d5edb4060d
commit cc41a0ed24
11 changed files with 453 additions and 1040 deletions

View File

@@ -1,27 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.math.kinematics.proto;
import static org.junit.jupiter.api.Assertions.assertEquals;
import edu.wpi.first.math.kinematics.MecanumDriveMotorVoltages;
import edu.wpi.first.math.proto.Kinematics.ProtobufMecanumDriveMotorVoltages;
import edu.wpi.first.wpilibj.ProtoTestBase;
@SuppressWarnings("PMD.TestClassWithoutTestCases")
class MecanumDriveMotorVoltagesProtoTest
extends ProtoTestBase<MecanumDriveMotorVoltages, ProtobufMecanumDriveMotorVoltages> {
MecanumDriveMotorVoltagesProtoTest() {
super(new MecanumDriveMotorVoltages(1.2, 3.1, 2.5, -0.1), MecanumDriveMotorVoltages.proto);
}
@Override
public void checkEquals(MecanumDriveMotorVoltages testData, MecanumDriveMotorVoltages data) {
assertEquals(testData.frontLeftVoltage, data.frontLeftVoltage);
assertEquals(testData.frontRightVoltage, data.frontRightVoltage);
assertEquals(testData.rearLeftVoltage, data.rearLeftVoltage);
assertEquals(testData.rearRightVoltage, data.rearRightVoltage);
}
}

View File

@@ -1,25 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.math.kinematics.struct;
import static org.junit.jupiter.api.Assertions.assertEquals;
import edu.wpi.first.math.kinematics.MecanumDriveMotorVoltages;
import edu.wpi.first.wpilibj.StructTestBase;
@SuppressWarnings("PMD.TestClassWithoutTestCases")
class MecanumDriveMotorVoltagesStructTest extends StructTestBase<MecanumDriveMotorVoltages> {
MecanumDriveMotorVoltagesStructTest() {
super(new MecanumDriveMotorVoltages(1.2, 3.1, 2.5, -0.1), MecanumDriveMotorVoltages.struct);
}
@Override
public void checkEquals(MecanumDriveMotorVoltages testData, MecanumDriveMotorVoltages data) {
assertEquals(testData.frontLeftVoltage, data.frontLeftVoltage);
assertEquals(testData.frontRightVoltage, data.frontRightVoltage);
assertEquals(testData.rearLeftVoltage, data.rearLeftVoltage);
assertEquals(testData.rearRightVoltage, data.rearRightVoltage);
}
}