Skip to content

Commit

Permalink
Merge branch 'main' into Steggo-SwervePIDTuning
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/frc/robot/Constants.java
  • Loading branch information
GearBoxFox committed Feb 9, 2024
2 parents 73047d1 + 1187cc0 commit b9588bc
Show file tree
Hide file tree
Showing 32 changed files with 1,649 additions and 150 deletions.
24 changes: 24 additions & 0 deletions .run/Build & Deploy Robot for Debugging.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build &amp; Deploy Robot for Debugging" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-PdebugMode=true" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="deploy" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions .run/Build & Deploy Robot.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build &amp; Deploy Robot" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="deploy" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions .run/Build & Run Simulate Java.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build &amp; Run Simulate Java" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="simulateJava" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions .run/Build Robot.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build Robot" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="build" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions .run/Clean Build & Deploy Robot for Debugging.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean Build &amp; Deploy Robot for Debugging" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-PdebugMode=true" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="deploy" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions .run/Clean Build & Deploy Robot.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean Build &amp; Deploy Robot" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="deploy" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions .run/Clean Build & Run Simulate Java.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean Build &amp; Run Simulate Java" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="simulateJava" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions .run/Clean Build Robot.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean Build Robot" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="build" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions .run/Clean.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Debug Robot via IP.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Debug Robot via IP" type="Remote">
<module name="2024Crescendo.main" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="10.44.67.2" />
<option name="PORT" value="8349" />
<option name="AUTO_RESTART" value="false" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Debug Robot via USB.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Debug Robot via USB" type="Remote">
<module name="2024Crescendo.main" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="172.22.11.2" />
<option name="PORT" value="8349" />
<option name="AUTO_RESTART" value="false" />
<method v="2" />
</configuration>
</component>
7 changes: 7 additions & 0 deletions .run/Launch Shuffleboard.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launch Shuffleboard" type="JarApplication" activateToolWindowBeforeRun="false">
<option name="JAR_PATH" value="C:\Users\Public\wpilib\2024\tools\artifacts\Shuffleboard-2024.1.1-beta-1-winx64.jar" />
<module name="2024Crescendo.main" />
<method v="2" />
</configuration>
</component>
7 changes: 7 additions & 0 deletions .run/Launch SmartDashboard.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launch SmartDashboard" type="JarApplication" activateToolWindowBeforeRun="false">
<option name="JAR_PATH" value="C:\Users\Public\wpilib\2024\tools\artifacts\SmartDashboard-2024.1.1-beta-1-winx64.jar" />
<module name="2024Crescendo.main" />
<method v="2" />
</configuration>
</component>
48 changes: 47 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ public final class Constants {
private Constants() {
throw new IllegalStateException("Constants class should not be constructed");
}
public static final Mode currentMode = Mode.SIM;
public static final Mode currentMode = Mode.PROTO_ARM;

public enum Mode {
/** Running on a real robot. */
REAL,
PROTO_ARM,

PROTO_SHOOTER,

/** Running a physics simulator. */
SIM,
Expand Down Expand Up @@ -100,6 +103,49 @@ private DriveConstants() {
);
}


public static class ArmConstants {
private ArmConstants() {}

public static int WRIST_ID = 0;
public static int SHOULDER_ID = 0;

public static double WRIST_KP = 0.0;
public static double WRIST_KI = 0.0;
public static double WRIST_KD = 0.0;
public static double WRIST_KS = 0.0;
public static double WRIST_KV = 0.0;
public static double WRIST_KG = 0.0;

public static double SHOULDER_KP = 0.0;
public static double SHOULDER_KI = 0.0;
public static double SHOULDER_KD = 0.0;
public static double SHOULDER_KS = 0.0;
public static double SHOULDER_KV = 0.0;
public static double SHOULDER_KG = 0.0;
}
public static class ShooterConstants {
private ShooterConstants() {
throw new IllegalStateException("Static classes should not be constructed");
}
public static final int TOP_LEFT_ID = 13;
public static final int TOP_RIGHT_ID = 14;
public static final int BOTTOM_LEFT_ID = 15;
public static final int BOTTOM_RIGHT_ID = 16;
public static final int KICKER_ID = 17;

public static final double SHOOTER_KP = 0.000061;
public static final double SHOOTER_KI = 0.0;
public static final double SHOOTER_KD = 0.005;
public static final double SHOOTER_KF = 0.000152;

public static final boolean TOP_LEFT_INVERTED = false;
public static final boolean TOP_RIGHT_INVERTED = true;
public static final boolean BOTTOM_LEFT_INVERTED = true;
public static final boolean BOTTOM_RIGHT_INVERTED = false;
public static final boolean KICKER_INVERTED = true;
}

public class ClimberConstants {
private ClimberConstants() {
throw new IllegalStateException("Static class should not be constructed");
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package frc.robot;

import com.gos.lib.properties.PropertyManager;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import org.littletonrobotics.junction.LogFileUtil;
Expand All @@ -38,6 +39,8 @@ public class Robot extends LoggedRobot {
*/
@Override
public void robotInit() {
// Clear dead properties
PropertyManager.purgeExtraKeys();
// Record metadata
Logger.recordMetadata("ProjectName", BuildConstants.MAVEN_NAME);
Logger.recordMetadata("BuildDate", BuildConstants.BUILD_DATE);
Expand All @@ -59,7 +62,8 @@ public void robotInit() {

// Set up data receivers & replay source
switch (Constants.currentMode) {
case REAL:
case PROTO_ARM:
case REAL, PROTO_SHOOTER:
// Running on a real robot, log to a USB stick ("/U/logs")
Logger.addDataReceiver(new WPILOGWriter());
Logger.addDataReceiver(new NT4Publisher());
Expand Down
Loading

0 comments on commit b9588bc

Please sign in to comment.