New name for module locations, some fixes

This commit is contained in:
thenetworkgrinch
2023-03-09 21:48:47 -06:00
parent ec958aecaa
commit ac920249ac
119 changed files with 344 additions and 267 deletions

View File

@@ -263,7 +263,7 @@ public class SwerveDrive
// Sets states
for (SwerveModule module : swerveModules)
{
module.setDesiredState(desiredStates[module.moduleNumber], isOpenLoop);
module.setDesiredState(desiredStates[module.moduleNumber], isOpenLoop, false);
if (SwerveDriveTelemetry.verbosity.ordinal() >= TelemetryVerbosity.HIGH.ordinal())
{
@@ -536,7 +536,7 @@ public class SwerveDrive
SwerveDriveTelemetry.desiredStates[(swerveModule.moduleNumber * 2) + 1] =
desiredState.speedMetersPerSecond;
}
swerveModule.setDesiredState(desiredState, false);
swerveModule.setDesiredState(desiredState, false, true);
}
}
@@ -700,4 +700,16 @@ public class SwerveDrive
imu.setOffset(gyro);
}
/**
* Reset the drive encoders on the robot, useful when manually resetting the robot without a reboot, like in
* autonomous.
*/
public void resetEncoders()
{
for (SwerveModule module : swerveModules)
{
module.configuration.driveMotor.setPosition(0);
}
}
}