Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@
"y": 5.5595860927152305
},
"prevControl": {
"x": 5.282624057650272,
"y": 5.542529628143782
"x": 5.282506242801578,
"y": 5.532923467094039
},
"nextControl": {
"x": 1.9828973509933765,
"y": 5.574105960264898
"x": 1.1925534950071324,
"y": 5.594108416547789
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.9339486754966884,
"y": 5.051390728476821
"x": 2.809885877318117,
"y": 5.076562054208274
},
"prevControl": {
"x": 2.360413907284768,
"y": 5.305488410596026
"x": 2.2363511091061965,
"y": 5.33065973632748
},
"nextControl": null,
"isLocked": false,
Expand All @@ -112,7 +112,7 @@
],
"constraintZones": [
{
"name": "Constraints Zone",
"name": "Slow Intake",
"minWaypointRelativePos": 0.19021739130434828,
"maxWaypointRelativePos": 1.8688693856479086,
"constraints": {
Expand All @@ -123,6 +123,19 @@
"nominalVoltage": 12.0,
"unlimited": false
}
},
{
"name": "Faster Over Bump",
"minWaypointRelativePos": 2.764105642256889,
"maxWaypointRelativePos": 3.880552220888336,
"constraints": {
"maxVelocity": 8.0,
"maxAcceleration": 5.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
}
}
],
"pointTowardsZones": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"y": 3.018609271523179
},
"prevControl": {
"x": 2.3967135761589407,
"y": 3.2727069536423845
"x": 1.7359771754636228,
"y": 2.7993580599144083
},
"nextControl": null,
"isLocked": false,
Expand All @@ -112,8 +112,8 @@
],
"constraintZones": [
{
"name": "Constraints Zone",
"minWaypointRelativePos": 0.19798136645962736,
"name": "Slow Intake",
"minWaypointRelativePos": 0.2,
"maxWaypointRelativePos": 1.8688693856479086,
"constraints": {
"maxVelocity": 2.5,
Expand All @@ -123,6 +123,19 @@
"nominalVoltage": 12.0,
"unlimited": false
}
},
{
"name": "Faster Over Bump",
"minWaypointRelativePos": 2.76,
"maxWaypointRelativePos": 3.88,
"constraints": {
"maxVelocity": 8.0,
"maxAcceleration": 5.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
}
}
],
"pointTowardsZones": [],
Expand Down
8 changes: 4 additions & 4 deletions src/main/deploy/pathplanner/paths/left 2.5 pass.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 2.9339486754966884,
"y": 5.051390728476821
"x": 2.809885877318117,
"y": 5.076562054208274
},
"prevControl": null,
"nextControl": {
"x": 1.6643285940496975,
"y": 6.549526550648494
"x": 1.5402657958711259,
"y": 6.574697876379948
},
"isLocked": false,
"linkedName": "DRUM-Left Shot pos"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 2.9339486754966884,
"y": 5.051390728476821
"x": 2.809885877318117,
"y": 5.076562054208274
},
"prevControl": null,
"nextControl": {
"x": 2.454793046357616,
"y": 7.178551324503311
"x": 2.3307302481790444,
"y": 7.203722650234765
},
"isLocked": false,
"linkedName": "DRUM-Left Shot pos"
Expand Down Expand Up @@ -128,12 +128,12 @@
},
{
"anchor": {
"x": 2.9339486754966884,
"y": 5.051390728476821
"x": 2.809885877318117,
"y": 5.076562054208274
},
"prevControl": {
"x": 2.2587748344370855,
"y": 5.595885761589403
"x": 1.4642653352353778,
"y": 5.490599144079885
},
"nextControl": null,
"isLocked": false,
Expand Down Expand Up @@ -168,7 +168,7 @@
],
"constraintZones": [
{
"name": "Constraints Zone",
"name": "Slow Intake",
"minWaypointRelativePos": 2.6742385131646964,
"maxWaypointRelativePos": 5.2,
"constraints": {
Expand All @@ -179,6 +179,19 @@
"nominalVoltage": 12.0,
"unlimited": false
}
},
{
"name": "Faster Over Bump",
"minWaypointRelativePos": 5.7671068427370775,
"maxWaypointRelativePos": 6.84,
"constraints": {
"maxVelocity": 8.0,
"maxAcceleration": 5.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
}
}
],
"pointTowardsZones": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
"y": 3.018609271523179
},
"prevControl": {
"x": 1.844958609271523,
"y": 2.510413907284768
"x": 1.3866333808844504,
"y": 2.5923395149786024
},
"nextControl": null,
"isLocked": false,
Expand Down Expand Up @@ -168,7 +168,7 @@
],
"constraintZones": [
{
"name": "Constraints Zone",
"name": "Slow Intake",
"minWaypointRelativePos": 2.992256066081573,
"maxWaypointRelativePos": 4.9943211151264695,
"constraints": {
Expand All @@ -179,6 +179,19 @@
"nominalVoltage": 12.0,
"unlimited": false
}
},
{
"name": "Faster Over Bump",
"minWaypointRelativePos": 6.132052821128415,
"maxWaypointRelativePos": 6.842737094837935,
"constraints": {
"maxVelocity": 8.0,
"maxAcceleration": 5.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
}
}
],
"pointTowardsZones": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
public class VariableShooterCommand {
// TODO: Tweak the speeds and distance after pinnacles if we have time.
private static final AngularVelocity MIN_SPEED =
RotationsPerSecond.of(36); // 2 meters. Hub shot speed.
RotationsPerSecond.of(34); // 2 meters. Hub shot speed.
private static final AngularVelocity MAX_SPEED =
RotationsPerSecond.of(55); // 5 meters from hub speed.
RotationsPerSecond.of(52); // 5 meters from hub speed.

// Hub to square edge is 1.3 meters based on the HubStatus/Utils calculation .
// Get these values off of the /AdvantageKit/RealOutputs/HubStatus/Distance To Our Hub (Meters)
public static final Distance MIN_DIST = Meters.of(2.0);
public static final Distance MAX_DIST = Meters.of(5.0);

/**
* Calculates the speed to shoot at if between the 1.5/3.1 MIN/MAX distance.
* Calculates the speed to shoot at if between the 2.0/5.0 MIN/MAX distance.
*
* @param shooter Instance of the shooter class to apply the calculated speed to.
* @param distanceSupplier A supplier of the distance from the hub
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/team2813/subsystems/shooter/ShooterIOReal.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class ShooterIOReal implements ShooterIO {
private TalonFX upperRightShooterMotor;
private TalonFX lowerRightShooterMotor;

// private Follower rightShooterFollower;
// private Follower leftShooterFollower;

private TalonFX upperLeftShooterMotor;
private TalonFX lowerLeftShooterMotor;

Expand All @@ -31,12 +34,20 @@ public ShooterIOReal() {
.getConfigurator()
.apply(ShooterConstants.LOWER_RIGHT_SHOOTER_MOTOR_CONFIG);

// rightShooterFollower =
// new Follower(Constants.UPPER_RIGHT_SHOOTER_MOTOR_ID, MotorAlignmentValue.Aligned);
// lowerRightShooterMotor.setControl(rightShooterFollower);

upperLeftShooterMotor = new TalonFX(Constants.UPPER_LEFT_SHOOTER_MOTOR_ID);
upperLeftShooterMotor.getConfigurator().apply(ShooterConstants.UPPER_LEFT_SHOOTER_MOTOR_CONFIG);

lowerLeftShooterMotor = new TalonFX(Constants.LOWER_LEFT_SHOOTER_MOTOR_ID);
lowerLeftShooterMotor.getConfigurator().apply(ShooterConstants.LOWER_LEFT_SHOOTER_MOTOR_CONFIG);

// leftShooterFollower =
// new Follower(Constants.UPPER_LEFT_SHOOTER_MOTOR_ID, MotorAlignmentValue.Aligned);
// lowerLeftShooterMotor.setControl(leftShooterFollower);

shooterVelocityControl = new VelocityVoltage(RotationsPerSecond.of(0));
}

Expand Down Expand Up @@ -93,8 +104,10 @@ public void setShooterMotorVelocity(AngularVelocity shooterMotorVelocity) {
// AngularVelocity converting its value (i.e. Rot/s) to the base unit (rad/s)
upperRightShooterSetpoint = shooterMotorVelocity;
upperRightShooterMotor.setControl(shooterVelocityControl.withVelocity(shooterMotorVelocity));
lowerRightShooterMotor.setControl(shooterVelocityControl);
// same velocity
upperLeftShooterMotor.setControl(shooterVelocityControl);
lowerLeftShooterMotor.setControl(shooterVelocityControl);
}

@Override
Expand Down
Loading