Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worlds #25

Merged
merged 22 commits into from
Apr 21, 2024
Merged
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
2 changes: 1 addition & 1 deletion elastic-layout.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
{
"type": "path",
"data": {
"pathName": "Path 1 - Front Special"
"pathName": "Path 1 - Front 43"
}
},
{
"type": "path",
"data": {
"pathName": "Path 2 - Front Special"
"pathName": "Path 2 - Front 43"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
{
"type": "path",
"data": {
"pathName": "Path 1 - Front Rush"
"pathName": "Path 1 - Front Rush 12"
}
},
{
"type": "path",
"data": {
"pathName": "Path 2 - Front Rush"
"pathName": "Path 2 - Front Rush 12"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/autos/Front Rush 13.auto
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
{
"type": "path",
"data": {
"pathName": "Path 1 - Front Rush"
"pathName": "Path 1 - Front Rush 12"
}
},
{
"type": "path",
"data": {
"pathName": "Path 2 - Front Rush Alt"
"pathName": "Path 2 - Front Rush 23"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
{
"type": "path",
"data": {
"pathName": "Path 1 - Front Rush Alt"
"pathName": "Path 1 - Front Rush 23"
}
},
{
"type": "path",
"data": {
"pathName": "Path 2 - Front Rush Alt"
"pathName": "Path 2 - Front Rush 23"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
{
"anchor": {
"x": 7.98,
"y": 2.47
"y": 2.5
},
"prevControl": {
"x": 7.0403073792140916,
"y": 2.8120201433256695
"y": 2.8420201433256693
},
"nextControl": {
"x": 8.40286167935366,
"y": 2.316090935503449
"y": 2.3460909355034487
},
"isLocked": false,
"linkedName": null
Expand Down Expand Up @@ -94,13 +94,13 @@
],
"rotationTargets": [
{
"waypointRelativePos": 2.0,
"rotationDegrees": 150.0,
"waypointRelativePos": 1.1500000000000001,
"rotationDegrees": 180.0,
"rotateFast": false
},
{
"waypointRelativePos": 1.0,
"rotationDegrees": 180.0,
"waypointRelativePos": 2.0,
"rotationDegrees": 150.0,
"rotateFast": false
},
{
Expand Down Expand Up @@ -324,7 +324,7 @@
},
"goalEndState": {
"velocity": 0,
"rotation": 170.0,
"rotation": 171.0,
"rotateFast": false
},
"reversed": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
{
"anchor": {
"x": 7.88,
"y": 7.2
"y": 7.3
},
"prevControl": {
"x": 6.11312527048199,
"y": 6.413336687071822
"y": 6.5133366870718215
},
"nextControl": {
"x": 8.793545457642605,
"y": 7.606736643075799
"y": 7.706736643075799
},
"isLocked": false,
"linkedName": null
Expand Down
20 changes: 10 additions & 10 deletions src/main/deploy/pathplanner/paths/Path 1 - Front Rush 23 Spit.path
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@
},
{
"anchor": {
"x": 7.8,
"y": 4.42
"x": 7.97,
"y": 4.4
},
"prevControl": {
"x": 7.867652539411058,
"y": 4.738280173895938
"x": 8.107516069903477,
"y": 4.694904163589285
},
"nextControl": {
"x": 7.59208830918224,
"y": 3.4418523992661934
"x": 7.5473817382593,
"y": 3.4936922129633494
},
"isLocked": false,
"linkedName": null
Expand All @@ -68,8 +68,8 @@
"y": 5.55
},
"prevControl": {
"x": 4.028622492154736,
"y": 4.5190633199768495
"x": 4.010443041047346,
"y": 4.497777917535599
},
"nextControl": null,
"isLocked": false,
Expand All @@ -84,12 +84,12 @@
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 135.0,
"rotationDegrees": 130.0,
"rotateFast": false
},
{
"waypointRelativePos": 2.9,
"rotationDegrees": 135.0,
"rotationDegrees": 115.0,
"rotateFast": false
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
{
"anchor": {
"x": 7.92,
"y": 5.75
"y": 5.82
},
"prevControl": {
"x": 6.772847127297909,
"y": 7.388304088577982
"y": 7.458304088577982
},
"nextControl": {
"x": 8.493576436351045,
"y": 4.93084795571101
"y": 5.00084795571101
},
"isLocked": false,
"linkedName": null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
},
"prevControl": null,
"nextControl": {
"x": 4.465477382580045,
"y": 4.089414403070517
"x": 4.065702763046164,
"y": 4.23837451600708
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 4.85,
"y": 3.8
"y": 3.75
},
"prevControl": {
"x": 4.578463926583921,
"y": 4.004617107871699
"y": 3.954617107871699
},
"nextControl": {
"x": 6.034724121725668,
"y": 2.907246339819146
"y": 2.857246339819146
},
"isLocked": false,
"linkedName": null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
{
"anchor": {
"x": 8.0,
"y": 5.7
"y": 5.75
},
"prevControl": {
"x": 7.049456015029355,
"y": 5.990610460281506
"y": 6.040610460281505
},
"nextControl": {
"x": 8.669413329174128,
"y": 5.4953398066940835
"y": 5.545339806694083
},
"isLocked": false,
"linkedName": null
Expand Down Expand Up @@ -113,7 +113,7 @@
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0,
"rotation": -178.0,
"rotateFast": false
},
"reversed": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@
{
"anchor": {
"x": 6.86222408927512,
"y": 6.1548053498352076
"y": 6.1
},
"prevControl": {
"x": 6.343882472610596,
"y": 6.69635629261904
"y": 6.641550942783832
},
"nextControl": {
"x": 7.484535325632098,
"y": 5.504629431253289
"y": 5.449824081418081
},
"isLocked": false,
"linkedName": null
Expand Down Expand Up @@ -105,7 +105,7 @@
},
{
"waypointRelativePos": 4.0,
"rotationDegrees": 150.0,
"rotationDegrees": 160.0,
"rotateFast": false
}
],
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ public void teleopInit() {
? 0
: 180));

// if(DriverStation.isFMSAttached()) {
// ClimberCommands.safeClimb().withTimeout(2).schedule();
// }
RobotTelemetry.print("!!! Teleop Init Complete !!! ");
} catch (Throwable t) {
// intercept error and log it
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/RobotCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ public static Command autoClimb() {

public static Command manualSource() {
return LauncherCommands.manualSource()
.alongWith(FeederCommands.manualSource(), PivotCommands.subwoofer())
.alongWith(
FeederCommands.manualSource(),
PivotCommands.subwoofer(),
LEDsCommands.manualSourceStrobe())
.withName("RobotCommands.manualSource");
}

Expand Down
11 changes: 7 additions & 4 deletions src/main/java/frc/robot/auton/Auton.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.PrintCommand;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Robot;
Expand Down Expand Up @@ -41,13 +42,13 @@ public static void setupSelectors() {
autonChooser.addOption(
"Front Alt 6 Auto", new PathPlannerAuto("Front Alt 6")); // Runs full Auto

autonChooser.addOption(
"Front Special", new PathPlannerAuto("Front Special")); // Runs full Auto
autonChooser.addOption("Front 43", new PathPlannerAuto("Front 43")); // Runs full Auto

autonChooser.addOption("Front Rush", new PathPlannerAuto("Front Rush")); // Runs full Auto
autonChooser.addOption(
"Front Rush 12", new PathPlannerAuto("Front Rush 12")); // Runs full Auto

autonChooser.addOption(
"Front Rush Alt", new PathPlannerAuto("Front Rush Alt")); // Runs full Auto
"Front Rush 23", new PathPlannerAuto("Front Rush 23")); // Runs full Auto
autonChooser.addOption(
"Front Rush 13", new PathPlannerAuto("Front Rush 13")); // Runs full Auto
autonChooser.addOption(
Expand All @@ -66,6 +67,8 @@ public static void setupSelectors() {

autonChooser.addOption("Subwoofer", new PathPlannerAuto("Subwoofer")); // Runs full Auto

autonChooser.addOption("Do Nothing", Commands.print("Do Nothing Auto ran"));

SmartDashboard.putData("Auto Chooser", autonChooser);
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/leds/LEDsCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public static Command launchReadyStrobe() {
.withName("LEDs.launchReadyStrobe");
}

public static Command manualSourceStrobe() {
return customStrobe(Section.FULL, Color.kRed, 3, 20).withName("LEDs.manualSourceStrobe");
}

public static Command intakeReadyStrobe() {
return customStrobe(Section.FULL, Color.kGreen, 5, 10).withName("LEDs.intakeReadyStrobe");
}
Expand Down
22 changes: 21 additions & 1 deletion src/main/java/frc/robot/mechanisms/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.FunctionalCommand;
import frc.robot.RobotConfig;
import frc.spectrumLib.mechanism.Mechanism;
import frc.spectrumLib.mechanism.TalonFXFactory;
Expand All @@ -23,7 +24,7 @@ public class IntakeConfig extends Config {

/* Intake config values */
public double currentLimit = 30;
public double torqueCurrentLimit = 100;
public double torqueCurrentLimit = 120;
public double threshold = 40;
public double velocityKp = 12; // 0.156152;
public double velocityKv = 0.2; // 0.12;
Expand Down Expand Up @@ -117,6 +118,25 @@ public Command ensureBrakeMode() {
.ignoringDisable(true);
}

public Command intakeWithoutCurrentLimit() {
return new FunctionalCommand(
() ->
toggleTorqueCurrentLimit(
config.torqueCurrentLimit,
false), // init -- turn off current limits
() ->
setVelocityTorqueCurrentFOC(
config.intake), // execute -- run at intake velocity
(b) -> {
toggleTorqueCurrentLimit(
config.torqueCurrentLimit,
true); // end -- reenable current limits
},
() -> false, // isFinished
this) // requirement
.withName("Intake.intakeWithoutCurrentLimit");
}

/**
* Stops the intake motor.
*
Expand Down
Loading