update deprecated method calls

This commit is contained in:
C4llSiqn
2025-01-04 15:52:12 -07:00
parent 9bc2bbfd98
commit 2698afeaa9
3 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -164,7 +164,9 @@ public class Robot extends TimedRobot {
// CAN header
System.out.println(new String(Base64.getDecoder().decode("IOKWl+KWhOKWhOKWliDilpfiloTilpYg4paX4paWICDilpfilpYK4paQ4paMICAg4paQ4paMIOKWkOKWjOKWkOKWm+KWmuKWluKWkOKWjArilpDilowgICDilpDilpviloDilpzilozilpDilowg4pad4pac4paMCuKWneKWmuKWhOKWhOKWluKWkOKWjCDilpDilozilpDilowgIOKWkOKWjCh0KQ==")));
CANBusStatus canInfo = CANBus.getStatus(Constants.CANBUS_NAME);
CANBus canBus = new CANBus(Constants.CANBUS_NAME);
CANBusStatus canInfo = canBus.getStatus();
System.out.println("CANInfo BusOffCount - " + canInfo.BusOffCount);
System.out.println("CANInfo BusUtilization - " + canInfo.BusUtilization);
@@ -217,10 +217,10 @@ public class SwerveModule extends Subsystem {
* Set the speed and rotation of the SwerveModule from a SwerveModuleState object
* @param desiredState a SwerveModuleState representing the desired new state of the module
// */
public void setDesiredState(SwerveModuleState desiredState) {
public void setDesiredState(SwerveModuleState state) {
Rotation2d currentRotation = this.getAngle();
SwerveModuleState state = SwerveModuleState.optimize(desiredState, currentRotation);
state.optimize(currentRotation);//SwerveModuleState.optimize(desiredState, currentRotation);
// calculate the difference between our current rotational position and our new rotational position
Rotation2d rotationDelta = state.angle.minus(currentRotation);
+1 -1
View File
@@ -181,7 +181,7 @@ public class RobotGyro {
* Roll is within [-90,+90] degrees.
*/
private double[] getPigeonAngles() {
m_pigeon.getAngle();
//m_pigeon.getAngle(); // This appeared to not do anything?
var rotation = m_pigeon.getRotation3d();
return new double[] {RobotUnits.radiansToDegrees(rotation.getX() - rollZero), RobotUnits.radiansToDegrees(rotation.getY() - pitchZero), RobotUnits.radiansToDegrees(rotation.getZ())};