mirror of
https://github.com/Team4388/Robot-Essentials.git
synced 2026-06-09 00:38:01 -06:00
update deprecated method calls
This commit is contained in:
@@ -164,7 +164,9 @@ public class Robot extends TimedRobot {
|
|||||||
// CAN header
|
// CAN header
|
||||||
System.out.println(new String(Base64.getDecoder().decode("IOKWl+KWhOKWhOKWliDilpfiloTilpYg4paX4paWICDilpfilpYK4paQ4paMICAg4paQ4paMIOKWkOKWjOKWkOKWm+KWmuKWluKWkOKWjArilpDilowgICDilpDilpviloDilpzilozilpDilowg4pad4pac4paMCuKWneKWmuKWhOKWhOKWluKWkOKWjCDilpDilozilpDilowgIOKWkOKWjCh0KQ==")));
|
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 BusOffCount - " + canInfo.BusOffCount);
|
||||||
System.out.println("CANInfo BusUtilization - " + canInfo.BusUtilization);
|
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
|
* Set the speed and rotation of the SwerveModule from a SwerveModuleState object
|
||||||
* @param desiredState a SwerveModuleState representing the desired new state of the module
|
* @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();
|
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
|
// calculate the difference between our current rotational position and our new rotational position
|
||||||
Rotation2d rotationDelta = state.angle.minus(currentRotation);
|
Rotation2d rotationDelta = state.angle.minus(currentRotation);
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class RobotGyro {
|
|||||||
* Roll is within [-90,+90] degrees.
|
* Roll is within [-90,+90] degrees.
|
||||||
*/
|
*/
|
||||||
private double[] getPigeonAngles() {
|
private double[] getPigeonAngles() {
|
||||||
m_pigeon.getAngle();
|
//m_pigeon.getAngle(); // This appeared to not do anything?
|
||||||
var rotation = m_pigeon.getRotation3d();
|
var rotation = m_pigeon.getRotation3d();
|
||||||
|
|
||||||
return new double[] {RobotUnits.radiansToDegrees(rotation.getX() - rollZero), RobotUnits.radiansToDegrees(rotation.getY() - pitchZero), RobotUnits.radiansToDegrees(rotation.getZ())};
|
return new double[] {RobotUnits.radiansToDegrees(rotation.getX() - rollZero), RobotUnits.radiansToDegrees(rotation.getY() - pitchZero), RobotUnits.radiansToDegrees(rotation.getZ())};
|
||||||
|
|||||||
Reference in New Issue
Block a user