Update YAGSL to handle controls better

This commit is contained in:
thenetworkgrinch
2023-04-08 12:31:07 -05:00
parent d37a38bb7b
commit 5b38929c48
123 changed files with 871 additions and 805 deletions

View File

@@ -43,10 +43,6 @@ public class ModuleJson
* The angle encoder pulse per revolution override. 1 for Neo encoder. 2048 for Falcons.
*/
public double angleEncoderPulsePerRevolution = 0;
/**
* Angle motor free speed RPM.
*/
public double angleMotorFreeSpeedRPM = 0;
/**
* The location of the swerve module from the center of the robot in inches.
*/
@@ -59,13 +55,15 @@ public class ModuleJson
* @param velocityPIDF The velocity PIDF values for the drive motor.
* @param maxSpeed The maximum speed of the robot in meters per second.
* @param physicalCharacteristics Physical characteristics of the swerve module.
* @param name Module json filename.
* @return {@link SwerveModuleConfiguration} based on the provided data and parsed data.
*/
public SwerveModuleConfiguration createModuleConfiguration(
PIDFConfig anglePIDF,
PIDFConfig velocityPIDF,
double maxSpeed,
SwerveModulePhysicalCharacteristics physicalCharacteristics)
SwerveModulePhysicalCharacteristics physicalCharacteristics,
String name)
{
SwerveMotor angleMotor = angle.createMotor(false);
SwerveAbsoluteEncoder absEncoder = encoder.createEncoder();
@@ -93,6 +91,6 @@ public class ModuleJson
inverted.angle,
angleEncoderPulsePerRevolution == 0 ? physicalCharacteristics.angleEncoderPulsePerRotation
: angleEncoderPulsePerRevolution,
angleMotorFreeSpeedRPM == 0 ? physicalCharacteristics.angleMotorFreeSpeedRPM : angleMotorFreeSpeedRPM);
name.replaceAll("\\.json", ""));
}
}