-
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.
Finished Herman's and Kedem's CR expect unanswered questions and I ne…
…ed to Log some stuff. Splitted the ElbowConstants class to neo and sim, added constructor to Elbow that uses the factory and added some more functions.
- Loading branch information
Showing
8 changed files
with
131 additions
and
103 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
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
74 changes: 1 addition & 73 deletions
74
src/main/java/training/subsystems/Arm/Elbow/ElbowConstants.java
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 |
---|---|---|
@@ -1,78 +1,6 @@ | ||
package training.subsystems.Arm.Elbow; | ||
|
||
import edu.wpi.first.math.controller.ArmFeedforward; | ||
import edu.wpi.first.math.geometry.Rotation2d; | ||
|
||
public class ElbowConstants { | ||
|
||
protected static final int MOTOR_ID = 0; | ||
|
||
protected static final double TOLERANCE = 5; | ||
|
||
protected static final Rotation2d ELBOW_START_POSITION = Rotation2d.fromDegrees(0); | ||
|
||
protected static final Rotation2d ELBOW_CLIMBING_POSITION = Rotation2d.fromDegrees(180); | ||
|
||
protected static final ArmFeedforward ARM_FEEDFORWARD = new ArmFeedforward( | ||
ElbowConstants.KS, | ||
ElbowConstants.KG, | ||
ElbowConstants.KV, | ||
ElbowConstants.KA | ||
); | ||
|
||
protected static final int PID_SLOT = 0; | ||
|
||
protected static final double P = 89; | ||
|
||
protected static final double I = 76; | ||
|
||
protected static final double D = 45; | ||
|
||
protected static final double KS = 0; | ||
|
||
protected static final double KG = 0.12; | ||
|
||
protected static final double KV = 0; | ||
|
||
protected static final double KA = 0; | ||
|
||
|
||
public static final double ELBOW_GEAR_RATIO = (1 / (28.0 * (60.0 / 16.0))); | ||
|
||
|
||
public static final int NUMBER_OF_MOTORS = 1; | ||
|
||
public enum PresetPositions { | ||
|
||
SAFE(Rotation2d.fromDegrees(-67)), | ||
INTAKE(Rotation2d.fromDegrees(-76)), | ||
SCORE(Rotation2d.fromDegrees(55)), | ||
STARTING(Rotation2d.fromDegrees(0)), | ||
TRANSFER(Rotation2d.fromDegrees(-80)); | ||
|
||
public final Rotation2d ANGLE; | ||
|
||
PresetPositions(Rotation2d angle) { | ||
this.ANGLE = angle; | ||
} | ||
|
||
} | ||
|
||
public static final Rotation2d MINIMUM_ANGLE = Rotation2d.fromDegrees(-82); | ||
|
||
public static final double ARM_LENGTH = 0.44; | ||
|
||
public static final double ARM_DISTANCE_FROM_CENTER = 0.1; | ||
|
||
public static final double ARM_MASS_KG = 0.44; | ||
|
||
public static final Rotation2d BACKWARD_ANGLE_LIMIT = Rotation2d.fromDegrees(-81); | ||
|
||
public static final Rotation2d FORWARD_ANGLE_LIMIT = Rotation2d.fromDegrees(90); | ||
|
||
|
||
public static final double GEAR_RATIO = 1 / (28.0 * (60.0 / 16.0)); | ||
|
||
public static final int CURRENT_LIMIT = 40; | ||
|
||
protected static final double TOLERANCE = 5; | ||
} |
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
41 changes: 41 additions & 0 deletions
41
src/main/java/training/subsystems/Arm/Elbow/NeoElbowConstants.java
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,41 @@ | ||
package training.subsystems.Arm.Elbow; | ||
|
||
import edu.wpi.first.math.controller.ArmFeedforward; | ||
import edu.wpi.first.math.geometry.Rotation2d; | ||
|
||
public class NeoElbowConstants { | ||
|
||
protected static final int MOTOR_ID = 0; | ||
|
||
protected static final double TOLERANCE = 5; | ||
|
||
protected static final Rotation2d ELBOW_START_POSITION = Rotation2d.fromDegrees(0); | ||
|
||
protected static final Rotation2d ELBOW_CLIMBING_POSITION = Rotation2d.fromDegrees(180); | ||
|
||
protected static final ArmFeedforward ARM_FEEDFORWARD = new ArmFeedforward( | ||
NeoElbowConstants.KS, | ||
NeoElbowConstants.KG, | ||
NeoElbowConstants.KV, | ||
NeoElbowConstants.KA | ||
); | ||
|
||
protected static final int PID_SLOT = 0; | ||
|
||
protected static final double P = 89; | ||
|
||
protected static final double I = 76; | ||
|
||
protected static final double D = 45; | ||
|
||
protected static final double KS = 0; | ||
|
||
protected static final double KG = 0.12; | ||
|
||
protected static final double KV = 0; | ||
|
||
protected static final double KA = 0; | ||
|
||
public static final double ELBOW_GEAR_RATIO = (1 / (28.0 * (60.0 / 16.0))); | ||
|
||
} |
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
52 changes: 52 additions & 0 deletions
52
src/main/java/training/subsystems/Arm/Elbow/SimulationElbowConstants.java
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,52 @@ | ||
package training.subsystems.Arm.Elbow; | ||
|
||
import edu.wpi.first.math.geometry.Rotation2d; | ||
|
||
public class SimulationElbowConstants { | ||
|
||
protected static final double P = 89; | ||
|
||
protected static final double I = 76; | ||
|
||
protected static final double D = 45; | ||
|
||
protected static final double TOLERANCE = 5; | ||
|
||
|
||
|
||
|
||
public static final int NUMBER_OF_MOTORS = 1; | ||
|
||
public enum PresetPositions { | ||
|
||
SAFE(Rotation2d.fromDegrees(-67)), | ||
INTAKE(Rotation2d.fromDegrees(-76)), | ||
SCORE(Rotation2d.fromDegrees(55)), | ||
STARTING(Rotation2d.fromDegrees(0)), | ||
TRANSFER(Rotation2d.fromDegrees(-80)); | ||
|
||
public final Rotation2d ANGLE; | ||
|
||
PresetPositions(Rotation2d angle) { | ||
this.ANGLE = angle; | ||
} | ||
|
||
} | ||
|
||
public static final Rotation2d MINIMUM_ANGLE = Rotation2d.fromDegrees(-82); | ||
|
||
public static final double ARM_LENGTH = 0.44; | ||
|
||
public static final double ARM_DISTANCE_FROM_CENTER = 0.1; | ||
|
||
public static final double ARM_MASS_KG = 0.44; | ||
|
||
public static final Rotation2d BACKWARD_ANGLE_LIMIT = Rotation2d.fromDegrees(-81); | ||
|
||
public static final Rotation2d FORWARD_ANGLE_LIMIT = Rotation2d.fromDegrees(90); | ||
|
||
|
||
public static final double GEAR_RATIO = 1 / (28.0 * (60.0 / 16.0)); | ||
|
||
public static final int CURRENT_LIMIT = 40; | ||
} |
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