Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
632b30a
Create basic trajectory following for the autonomous period. Just tes…
Danx3mer Apr 27, 2025
5f14c25
Fixing Pivot Scoring and Autons
Apetrock24 May 1, 2025
960d064
fix remaining autons (#58)
dfn-slxxp May 2, 2025
7a636af
Adding Pivot golf tee intake
Apetrock24 May 6, 2025
6bdc334
A LOT of testing changes, mainly to coral scoring and single coral auton
Danx3mer May 6, 2025
50bb16f
Merge branch 'Se/Auton' of https://github.com/StuyPulse/EVERYBOT-2025…
Danx3mer May 6, 2025
4b85aa4
everything broken so this is for drivetrain and auton testing
dfn-slxxp May 6, 2025
0e5b38c
uncomment
dfn-slxxp May 6, 2025
0ac2a86
Changes listed below:
dfn-slxxp May 7, 2025
7d04cd5
Remove LEDs from Readme because we will likely not have them
dfn-slxxp May 7, 2025
6001e0e
Update Algae Intake/Outtake Speeds
dfn-slxxp May 8, 2025
8074459
Add vision drive to nearest april tag, fix pivot stall detection pre-…
Danx3mer May 9, 2025
3f2c28c
Merge branch 'Se/Auton' of https://github.com/StuyPulse/EVERYBOT-2025…
Danx3mer May 9, 2025
669f47d
5/9 p7 auton work`
dfn-slxxp May 9, 2025
e26d83f
Merge branch 'Se/Auton' of https://github.com/StuyPulse/EVERYBOT-2025…
dfn-slxxp May 9, 2025
fb57fc6
adding limelight pose
Apetrock24 May 9, 2025
dc39a41
Add throughbore functionality (untested)
Danx3mer May 13, 2025
758a5a6
the following:
dfn-slxxp May 13, 2025
daa2792
resolve conflicts probably
Danx3mer May 14, 2025
33848ed
resolve conflicts probably
Danx3mer May 14, 2025
14d1bba
resolve conflicts and clean up imports
dfn-slxxp May 14, 2025
ae91f8c
remove one unused import
dfn-slxxp May 14, 2025
180dc76
fix readme because merge errors
dfn-slxxp May 14, 2025
ca5d57c
clean up imports
dfn-slxxp May 14, 2025
2887730
Minor changes on sysid
Danx3mer May 14, 2025
bf9f02a
Fix coral scoring
dfn-slxxp May 14, 2025
92d7f18
Apply throughbore completely.
Danx3mer May 14, 2025
8dd2eeb
the following:
dfn-slxxp May 14, 2025
bf5e0ba
make algae implemented more correctly + implement algae hold
dfn-slxxp May 15, 2025
cb93fa4
the following:
dfn-slxxp May 15, 2025
90f37ca
Period 4 vision + refactoring
Danx3mer May 15, 2025
e008bec
Changed bus voltage to getAppliedOutput
CinoDelta May 15, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,6 @@ bin/
# Logs
*.wpilog
*.log

# SYSID 2022 CONFIG
config.json
4 changes: 4 additions & 0 deletions src/main/java/com/stuypulse/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.stuypulse.robot.commands.leds.LEDApplyPattern;

import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.units.Units;
import edu.wpi.first.wpilibj.LEDPattern;
import edu.wpi.first.wpilibj.TimedRobot;
Expand All @@ -30,6 +31,9 @@ public void robotInit() {
@Override
public void robotPeriodic() {
CommandScheduler.getInstance().run();

//TODO: REMOVE THE LINE BELOW DURING COMPETITIONS TO ENSURE NO LAG OCCURS, THIS IS HERE FOR LIMELIGHT TESTING
NetworkTableInstance.getDefault().flush();
}

/*********************/
Expand Down
87 changes: 54 additions & 33 deletions src/main/java/com/stuypulse/robot/RobotContainer.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
package com.stuypulse.robot;

import com.stuypulse.robot.commands.auton.combinations.CoralgaeAuton;
import com.stuypulse.robot.commands.auton.combinations.PushBackwardsCoralAuton;
import com.stuypulse.robot.commands.auton.coral.DoubleCoralAuton;
import com.stuypulse.robot.commands.auton.coral.DoubleCenterCoralAuton;
import com.stuypulse.robot.commands.auton.coral.SingleCoralAuton;
import com.stuypulse.robot.commands.auton.misc.DoNothingAuton;
import com.stuypulse.robot.commands.auton.misc.MobilityAuton;
import com.stuypulse.robot.commands.auton.push.PushBackwardsAuton;
import com.stuypulse.robot.commands.auton.push.PushForwardsAuton;
import com.stuypulse.robot.commands.climb.ClimbToClimb;
import com.stuypulse.robot.commands.climb.ClimbToStow;
import com.stuypulse.robot.commands.drive.DriveArcade;
import com.stuypulse.robot.commands.drive.DriveDefault;
import com.stuypulse.robot.commands.leds.LEDApplyPattern;
import com.stuypulse.robot.commands.leds.LEDDeafultCommand;
import com.stuypulse.robot.commands.pivot.PivotLower;
import com.stuypulse.robot.commands.pivot.PivotRaise;
import com.stuypulse.robot.commands.pivot.PivotReseatCoral;
import com.stuypulse.robot.commands.pivot.PivotResetAngle;
import com.stuypulse.robot.commands.pivot.PivotStop;
import com.stuypulse.robot.commands.pivot.PivotToAlgaeIntake;
import com.stuypulse.robot.commands.pivot.PivotToAlgaeStow;
import com.stuypulse.robot.commands.pivot.PivotToCoralStow;
import com.stuypulse.robot.commands.pivot.PivotToDirection;
import com.stuypulse.robot.commands.pivot.SetPivotControlMode;
import com.stuypulse.robot.commands.pivot.PivotCombos.PivotCoralScore;
import com.stuypulse.robot.commands.pivot.PivotCombos.PivotLolipopAlgeaIntake;
import com.stuypulse.robot.commands.pivot.roller.PivotAlgaeHold;
import com.stuypulse.robot.commands.pivot.roller.PivotAlgaeIntake;
import com.stuypulse.robot.commands.pivot.roller.PivotAlgaeOuttake;
import com.stuypulse.robot.commands.pivot.roller.PivotCoralOuttake;
import com.stuypulse.robot.commands.pivot.roller.PivotHoldCoral;
import com.stuypulse.robot.commands.pivot.roller.PivotRollerStop;

import com.stuypulse.robot.commands.vision.VisionDriveToNearestApriltag;
import com.stuypulse.robot.subsystems.drivetrain.Drivetrain;
import com.stuypulse.robot.subsystems.leds.LEDController;
import com.stuypulse.robot.subsystems.pivot.Pivot;
import com.stuypulse.robot.subsystems.pivot.Pivot.PivotControlMode;
import com.stuypulse.robot.subsystems.vision.LimelightVision;
import com.stuypulse.robot.constants.Ports;

import com.stuypulse.stuylib.input.Gamepad;
Expand All @@ -50,6 +53,7 @@ public class RobotContainer {
private final LEDController ledSubsystem = LEDController.getInstance();
private final Drivetrain driveSubsystem = Drivetrain.getInstance();
private final Pivot pivot = Pivot.getInstance();
private final LimelightVision limelightVision = LimelightVision.getInstance();

// Autons
private static SendableChooser<Command> autonChooser = new SendableChooser<>();
Expand Down Expand Up @@ -78,66 +82,83 @@ private void configureDefaultCommands() {

private void configureButtonBindings() {
// BUTTONS
driver.getTopButton()
.whileTrue(new PivotRollerStop())
.whileTrue(new PivotCoralOuttake())
driver.getTopButton() // Coral Score
.onTrue(new SetPivotControlMode(PivotControlMode.USING_STATES))
.whileTrue(new PivotCoralScore())
.onFalse(new PivotToCoralStow())
.onFalse(new PivotHoldCoral());
driver.getLeftButton()
driver.getLeftButton() // Climb
.whileTrue(new ClimbToClimb());
driver.getRightButton()
driver.getRightButton() // Stow Climb
.whileTrue(new ClimbToStow());
driver.getBottomButton()
driver.getBottomButton()
.whileTrue(new PivotAlgaeOuttake())
.onFalse(new PivotRollerStop());
// driver.getBottomButton()
// .whileTrue(new VisionAlignToReef())
.onFalse(new PivotHoldCoral());

// TRIGGERS
driver.getRightTriggerButton()
driver.getRightTriggerButton() // Pivot Up
.onTrue(new SetPivotControlMode(PivotControlMode.MANUAL))
.whileTrue(new PivotRaise())
.onFalse(new PivotStop());
driver.getLeftTriggerButton()
driver.getLeftTriggerButton() // Pivot Down
.onTrue(new SetPivotControlMode(PivotControlMode.MANUAL))
.whileTrue(new PivotLower())
.onFalse(new PivotStop());

// BUMPERS
driver.getRightBumper()
.whileTrue(new PivotAlgaeOuttake())
.onFalse(new PivotHoldCoral());
driver.getLeftBumper()
.whileTrue(new PivotAlgaeIntake())
.onFalse(new PivotRollerStop());
driver.getRightBumper() // Algae Outtake
.whileTrue(new PivotAlgaeOuttake())
.onFalse(new PivotHoldCoral());
driver.getLeftBumper() // Algae Intake
.whileTrue(new PivotAlgaeIntake())
.onFalse(new PivotAlgaeHold());

// DPAD
driver.getDPadRight()
driver.getDPadRight() // Pivot to Hold Algae
.onTrue(new SetPivotControlMode(PivotControlMode.USING_STATES))
.onTrue(new PivotToAlgaeStow());
driver.getDPadDown()
.onTrue(new PivotToAlgaeStow())
.onTrue(new PivotAlgaeHold());
driver.getDPadDown() // Pivot to Intake Algae
.onTrue(new SetPivotControlMode(PivotControlMode.USING_STATES))
.onTrue(new PivotToAlgaeIntake());

driver.getDPadLeft() // Pivot to Lollipop Intake
.onTrue(new SetPivotControlMode(Pivot.PivotControlMode.USING_STATES))
.onTrue(new PivotLolipopAlgeaIntake())
.onFalse(new PivotRollerStop())
.onFalse(new PivotToAlgaeStow());

// MENU BUTTONS
driver.getRightMenuButton()
driver.getRightMenuButton() // Reset Relative Encoder
.onTrue(new PivotResetAngle());
driver.getLeftMenuButton() // Reseat Coral
.onTrue(new PivotReseatCoral());

//JOYSTICK BUTTONS
driver.getLeftStickButton() // Drive to Nearest April Tag
.whileTrue(new VisionDriveToNearestApriltag())
.onFalse(new DriveArcade(0, 0, true));
}

/**************/
/*** AUTONS ***/
/**************/

public void configureAutons() {
autonChooser.setDefaultOption("Misc - Mobility", new MobilityAuton());
// Coral
autonChooser.setDefaultOption("Coral Only - Single", new SingleCoralAuton());
autonChooser.addOption("Coral Only - Center Double", new DoubleCenterCoralAuton());

// Misc
autonChooser.addOption("Misc - Do Nothing", new DoNothingAuton());

autonChooser.addOption("Coral Only - Single", new SingleCoralAuton());
autonChooser.addOption("Coral Only - Double", new DoubleCoralAuton());

autonChooser.addOption("Misc - Mobility", new MobilityAuton());

// Push
autonChooser.addOption("Push Only - Forwards", new PushForwardsAuton());
autonChooser.addOption("Push Only - Backwards", new PushBackwardsAuton());


autonChooser.addOption("Combination - Coral w/ Push", new PushBackwardsCoralAuton());
autonChooser.addOption("Combination - Coralgae", new CoralgaeAuton());

SmartDashboard.putData("Autonomous", autonChooser);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.stuypulse.robot.commands.auton.combinations;

import com.stuypulse.robot.commands.drive.DriveTank;
import com.stuypulse.robot.commands.pivot.PivotCombos.PivotCoralScore;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;

/**
* attempt to score two coral
*
* @author Sebastian Waldman
*/
public class CoralgaeAuton extends SequentialCommandGroup {
public CoralgaeAuton() {
addCommands(
new DriveTank(-.45, -.45, true)
.withTimeout(2.2),
new DriveTank(0, 0, false)
.withTimeout(0.1),
new PivotCoralScore()
.withTimeout(2.0),
new DriveTank(.5,.5,true)
.withTimeout(.5),
new DriveTank(.7,.3,true)
.withTimeout(.45),
new DriveTank(-.7,-.7,true)
.withTimeout(1.15),
new DriveTank(-.7,-.3,true)
.withTimeout(.5)

);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.stuypulse.robot.commands.auton.combinations;

import com.stuypulse.robot.commands.drive.DriveTank;
import com.stuypulse.robot.commands.leds.LEDApplyPattern;
import com.stuypulse.robot.commands.pivot.roller.PivotCoralOuttake;
import com.stuypulse.robot.commands.pivot.roller.PivotRollerStop;
import com.stuypulse.robot.constants.Settings.LEDPatterns;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.WaitUntilCommand;

/**
* Push alliance partner's robot backwards then score a coral
Expand All @@ -17,15 +14,16 @@
public class PushBackwardsCoralAuton extends SequentialCommandGroup {
public PushBackwardsCoralAuton() {
addCommands(
new LEDApplyPattern(LEDPatterns.PUSH_BACKWARDS_SINGLE_L1_AUTON),
new DriveTank(-.75, -.75, true),
new WaitUntilCommand(2.00),
new DriveTank(.3, .3, true),
new WaitUntilCommand(10),
new DriveTank(0, 0, true),
new PivotCoralOuttake(),
new WaitUntilCommand(1),
new DriveTank(.75, .75, true)
.withTimeout(2),
new DriveTank(-.3, -.3, true)
.withTimeout(10),
new DriveTank(0, 0, true)
.withTimeout(0.1),
new PivotCoralOuttake()
.withTimeout(3),
new PivotRollerStop()
.withTimeout(0.1)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.stuypulse.robot.commands.auton.coral;

import com.stuypulse.robot.commands.drive.DriveTank;
import com.stuypulse.robot.commands.pivot.PivotCombos.PivotCoralScore;
import com.stuypulse.robot.commands.pivot.roller.PivotHoldCoral;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;

/**
* attempt to score two coral
*
* @author Sebastian Waldman
*/
public class DoubleCenterCoralAuton extends SequentialCommandGroup {
public DoubleCenterCoralAuton() {
addCommands(
new DriveTank(-.45, -.45, true)
.withTimeout(2.2),
new DriveTank(0, 0, false)
.withTimeout(0.1),
new PivotCoralScore()
.withTimeout(2),
new PivotHoldCoral()
.withTimeout(0.1),
new DriveTank(.5,.5,true)
.withTimeout(.5),
new DriveTank(.7,.3,true)
.withTimeout(.445),
new DriveTank(-.7,-.7,true)
.withTimeout(0.95),
new DriveTank(-.7,-.3,true)
.withTimeout(.65),
new DriveTank(-.7,-.7,true)
.withTimeout(1.2),
new DriveTank(-.3,-.7,true)
.withTimeout(.535),
new DriveTank(-.5,-.5,true)
.withTimeout(1.65),
new DriveTank(0,0,true)
.withTimeout(1.2),
new DriveTank(0.6,0.6,true)
.withTimeout(0.4),
new DriveTank(.5,-.7,true)
.withTimeout(0.75),
new DriveTank(-.6,-.6,true)
.withTimeout(0.2)

);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
/**************************************************************/
package com.stuypulse.robot.commands.auton.coral;

import edu.wpi.first.wpilibj2.command.WaitUntilCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;

import com.stuypulse.robot.commands.drive.DriveTank;
import com.stuypulse.robot.commands.leds.LEDApplyPattern;
import com.stuypulse.robot.commands.pivot.roller.PivotCoralOuttake;
import com.stuypulse.robot.constants.Settings.LEDPatterns;
import com.stuypulse.robot.commands.pivot.PivotCombos.PivotCoralScore;

/**
* attempts to score one coral
Expand All @@ -21,11 +18,12 @@
public class SingleCoralAuton extends SequentialCommandGroup {
public SingleCoralAuton() {
addCommands(
new LEDApplyPattern(LEDPatterns.SINGLE_L1_AUTON),
new DriveTank(.25, .25, true),
new WaitUntilCommand(7.00),
new DriveTank(0, 0, true),
new PivotCoralOuttake()
new DriveTank(-.45, -.45, true)
.withTimeout(2.5),
new DriveTank(0, 0, false)
.withTimeout(0.1),
new PivotCoralScore()
.withTimeout(5.0)
);
}
}
Loading