This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(superstructure): Improve superstructure.
- Loading branch information
1 parent
368b47d
commit d6d1d9b
Showing
14 changed files
with
254 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,8 +63,7 @@ | |
}, | ||
"Velocities": { | ||
"open": true | ||
}, | ||
"open": true | ||
} | ||
}, | ||
"Climber": { | ||
"East": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package frc.robot.arm; | ||
|
||
import java.util.Objects; | ||
|
||
import edu.wpi.first.math.MathUtil; | ||
import edu.wpi.first.math.geometry.Rotation2d; | ||
import edu.wpi.first.math.trajectory.TrapezoidProfile.State; | ||
import frc.robot.arm.ArmConstants.ShoulderConstants; | ||
|
||
public record ArmState(State shoulderRotations) { | ||
|
||
public ArmState { | ||
Objects.requireNonNull(shoulderRotations); | ||
} | ||
|
||
public ArmState(Rotation2d shoulder) { | ||
this(new State(shoulder.getRotations(), 0)); | ||
} | ||
|
||
public boolean at(ArmState other) { | ||
return MathUtil.isNear( | ||
shoulderRotations.position, | ||
other.shoulderRotations.position, | ||
ShoulderConstants.TOLERANCE.getRotations()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package frc.robot.intake; | ||
|
||
import java.util.Objects; | ||
|
||
import edu.wpi.first.math.MathUtil; | ||
import frc.robot.intake.IntakeConstants.RollerConstants; | ||
|
||
public record IntakeState(double frontRollerVelocityRotationsPerSecond, double backRollerVelocityRotationsPerSecond) { | ||
|
||
public IntakeState { | ||
Objects.requireNonNull(frontRollerVelocityRotationsPerSecond); | ||
Objects.requireNonNull(backRollerVelocityRotationsPerSecond); | ||
} | ||
|
||
public boolean at(IntakeState other) { | ||
return MathUtil.isNear( | ||
frontRollerVelocityRotationsPerSecond, | ||
other.frontRollerVelocityRotationsPerSecond, | ||
RollerConstants.SPEED_TOLERANCE) | ||
&& MathUtil.isNear( | ||
backRollerVelocityRotationsPerSecond, | ||
other.backRollerVelocityRotationsPerSecond, | ||
RollerConstants.SPEED_TOLERANCE); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package frc.robot.shooter; | ||
|
||
import java.util.Objects; | ||
|
||
import edu.wpi.first.math.MathUtil; | ||
import frc.robot.shooter.ShooterConstants.FlywheelConstants; | ||
import frc.robot.shooter.ShooterConstants.SerializerConstants; | ||
|
||
public record ShooterState(double flywheelVelocityRotationsPerSecond, double serializerVelocityRotationsPerSecond) { | ||
|
||
public ShooterState { | ||
Objects.requireNonNull(flywheelVelocityRotationsPerSecond); | ||
Objects.requireNonNull(serializerVelocityRotationsPerSecond); | ||
} | ||
|
||
public boolean at(ShooterState other) { | ||
return MathUtil.isNear(flywheelVelocityRotationsPerSecond, other.flywheelVelocityRotationsPerSecond, FlywheelConstants.SPEED_TOLERANCE) && MathUtil.isNear(serializerVelocityRotationsPerSecond, other.serializerVelocityRotationsPerSecond, SerializerConstants.SPEED_TOLERANCE); | ||
} | ||
|
||
} |
Oops, something went wrong.