Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
320f036
Linked PID variables to SmartDashboard
DiabolusLunae Jan 20, 2024
cce6961
Changed all SmartDashboard keys to constants
DiabolusLunae Jan 20, 2024
81a1b27
Added motor objects for climber
WashEyesWithTide Jan 24, 2024
b621640
Setup basic climber code.
continuumsrc Feb 15, 2024
846dc10
Fixed climber commands.
continuumsrc Feb 15, 2024
238dfd4
stopped using ShuffleBoard for climber setpoint and added motor radiu…
TurtleMeds Feb 17, 2024
53c7871
Applied Spotless
TurtleMeds Feb 17, 2024
bed7645
shooter fixes
Irishumanoid Mar 1, 2024
69a9856
integrated pivot
Irishumanoid Mar 1, 2024
071357b
fixed ids
Irishumanoid Mar 1, 2024
6c5e41d
pulled latest remote
Irishumanoid Mar 2, 2024
5236694
pulled in dev on top shooter pivot changes
Irishumanoid Mar 2, 2024
30fe31d
added absolute encoder + constant types
Irishumanoid Mar 2, 2024
7414d62
shooter commands
Irishumanoid Mar 2, 2024
c8e36bb
pivot commands
Irishumanoid Mar 2, 2024
b148e52
added variable feedforward to pivot position calcualtions
Irishumanoid Mar 3, 2024
89189f3
pulled shooter changes
Irishumanoid Mar 3, 2024
2f8e07c
integraiton
Irishumanoid Mar 3, 2024
324d72f
shooter test code
Irishumanoid Mar 3, 2024
04a0108
set break mode
Irishumanoid Mar 3, 2024
862f7f2
pivot works and tuned
Irishumanoid Mar 9, 2024
21ea345
adjusted shoot angle constants
Irishumanoid Mar 12, 2024
85c57fb
climber testing ready
Irishumanoid Mar 12, 2024
2702458
buddy climb
Irishumanoid Mar 12, 2024
05eafde
removed pid
Irishumanoid Mar 13, 2024
c95e931
practice field testing changes 3/12
Irishumanoid Mar 13, 2024
a103a4b
shooter practice field working 3/12
Irishumanoid Mar 13, 2024
6a6f19f
removed magic numbers
Irishumanoid Mar 13, 2024
f4d2cc9
Merge branch 'shooter' of https://github.com/ChainLynxRobotics/2024_S…
Irishumanoid Mar 15, 2024
7178976
pid for flywheels and removed shoot timeout
Irishumanoid Mar 15, 2024
2d952ba
used constant in followerController.setInverted()
TurtleMeds Mar 16, 2024
6b1465e
applied spotless
TurtleMeds Mar 16, 2024
e40eeea
idividual climbing
Irishumanoid Mar 16, 2024
af3a1c5
with soft stop
Irishumanoid Mar 16, 2024
c61edc6
this shooter code actually works stpo mentors
Irishumanoid Mar 17, 2024
e44b0b9
spotless
Irishumanoid Mar 17, 2024
d327d30
refactoring
Irishumanoid Mar 18, 2024
d1dc3c0
line break sensor and automated intake/shoot commands
Irishumanoid Mar 18, 2024
fa048c3
applied spotless
TurtleMeds Mar 19, 2024
409e713
removed confusing labels on triggers
TurtleMeds Mar 19, 2024
be98852
renamed variable for more clarity
TurtleMeds Mar 19, 2024
25f9684
line break to indexer subsystem
Irishumanoid Mar 20, 2024
cfcd852
spotless
Irishumanoid Mar 20, 2024
2d85d70
only climber stuff for fewer merge conflits
Irishumanoid Mar 21, 2024
0cd5977
Merge branch 'develop' into climber
Irishumanoid Mar 21, 2024
d2be4d4
resolved dev conflicts
Irishumanoid Mar 21, 2024
0edbb81
drive practice changes 3/19
Irishumanoid Mar 21, 2024
bbe3eb7
Script to delete pathplanner folder on robot
Irishumanoid Mar 21, 2024
c6865d9
Merge branch 'shooter' of https://github.com/ChainLynxRobotics/2024_S…
Irishumanoid Mar 21, 2024
bf16f98
Merge pull request #46 from ChainLynxRobotics/shooter
Irishumanoid Mar 22, 2024
a559e22
Merge branch 'develop' into climber
Irishumanoid Mar 22, 2024
61f7b06
applied spotless, resolved conflicts with dev after shooter pr
Irishumanoid Mar 22, 2024
6bba5e4
climber changes
Irishumanoid Mar 23, 2024
19903ca
limit switches et al
Irishumanoid Mar 23, 2024
2f8b5c0
Fixed climber
Irishumanoid Mar 23, 2024
d5e1ac2
applied spotless
Irishumanoid Mar 23, 2024
ce07efe
Merge pull request #47 from ChainLynxRobotics/climber
AndrewS-123 Mar 23, 2024
798b7e7
climber tuning
Irishumanoid Mar 24, 2024
28537f9
working
Irishumanoid Oct 12, 2024
364dc41
girls gen changes
Irishumanoid Oct 13, 2024
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
11 changes: 11 additions & 0 deletions clear_pathplanner_folder.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

set user="admin"
set hostname="roboRIO-8248-frc.local"
set autos_path="/home/lvuser/deploy/pathplanner"

echo Connecting to %user%@%hostname%
echo --------------------------------------
ssh %user%@%hostname% "rm -rf %autos_path%;echo %autos_path% has been cleared"
echo --------------------------------------
pause
8 changes: 4 additions & 4 deletions src/main/deploy/pathplanner/paths/leave 1.path
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
{
"anchor": {
"x": 7.449326898653798,
"y": 7.0
"x": 3.541181596252082,
"y": 7.124496534707355
},
"prevControl": {
"x": 5.499618999237998,
"y": 7.0
"x": 1.5914736968362821,
"y": 7.124496534707355
},
"nextControl": null,
"isLocked": false,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package frc.robot;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;

Expand All @@ -16,11 +18,13 @@ public class Robot extends TimedRobot {
@Override
public void robotInit() {
m_robotContainer = new RobotContainer();
SmartDashboard.putNumber("Match Time Left", 0);
}

@Override
public void robotPeriodic() {
CommandScheduler.getInstance().run();
SmartDashboard.putNumber("Match Time Left", Timer.getMatchTime());
}

@Override
Expand Down
111 changes: 80 additions & 31 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,25 @@
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.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.button.POVButton;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.commands.BasicDriveCommand;
import frc.robot.commands.climber.Climb;
import frc.robot.commands.climber.IndividualClimb;
import frc.robot.commands.intake.RunIntake;
import frc.robot.commands.shooter.ActuateShield;
import frc.robot.commands.shooter.Aim;
import frc.robot.commands.shooter.PivotMove;
import frc.robot.commands.shooter.Shoot;
import frc.robot.commands.shooter.SpinFlywheels;
import frc.robot.commands.shooter.StowShooter;
import frc.robot.constants.RobotConfig;
import frc.robot.constants.RobotConfig.FieldElement;
import frc.robot.constants.RobotConstants.Bindings;
import frc.robot.constants.RobotConstants.DriveConstants.OIConstants;
import frc.robot.subsystems.climber.Climber;
import frc.robot.subsystems.drive.Drivetrain;
import frc.robot.subsystems.indexer.Indexer;
import frc.robot.subsystems.intake.Intake;
Expand All @@ -33,6 +39,7 @@ public class RobotContainer {
private POVButton m_autoAim;
private POVButton m_trapAim;

private Climber m_climber;
private Shooter m_shooter;
private Intake m_intake;
private Drivetrain m_robotDrive;
Expand All @@ -46,6 +53,7 @@ public class RobotContainer {
private Vector rightInputVec;

public RobotContainer() {
m_climber = new Climber();
m_shooter = new Shooter();
m_intake = new Intake();
m_robotDrive = new Drivetrain();
Expand All @@ -62,8 +70,13 @@ public RobotContainer() {
autoChooser = AutoBuilder.buildAutoChooser();
configureBindings();

/*m_shooter.setDefaultCommand(
new RunCommand(() -> m_shooter.runFlywheel(ShooterConfig.kDefaultFlywheelRPM), m_shooter));*/
autoChooser.setDefaultOption("shoot and leave ",
new SequentialCommandGroup(
NamedCommands.getCommand("shootSpeaker"),
new RunCommand(() -> m_robotDrive.drive(new Vector(-0.2, 0), new Vector(), false, false), m_robotDrive).withTimeout(3)));

autoChooser.addOption("Leave Top", AutoBuilder.buildAuto("LeaveFromTop"));
SmartDashboard.putData("Auto Chooser", autoChooser);
}

private void configureBindings() {
Expand All @@ -90,30 +103,53 @@ private void configureBindings() {
.whileTrue(new BasicDriveCommand(m_robotDrive, m_driverController));

// RunIntake constructor boolean is whether or not the intake should run reversed.
new Trigger(this::getIntakeButton).whileTrue(new RunIntake(m_intake, false));
new Trigger(this::getReverseIntakeButton).whileTrue(new RunIntake(m_intake, true));
new Trigger(this::getIntakeButton).whileTrue(new RunIntake(m_intake, m_indexer, false));
new Trigger(this::getReverseIntakeButton).whileTrue(new RunIntake(m_intake, m_indexer, true));
// just shoot on trigger
new Trigger(() -> m_operatorController.getRawButton(Bindings.kShoot))
.whileTrue(new Shoot(m_indexer, false));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kShootReverse))
.whileTrue(new Shoot(m_indexer, true));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kAimAmp))
.whileTrue(new Aim(m_shooter, FieldElement.AMP));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kAimSpeaker))
.whileTrue(new Aim(m_shooter, FieldElement.SPEAKER));

m_trapAim.whileTrue(new Aim(m_shooter, FieldElement.TRAP));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kFlywheelAmp))
.whileTrue(
new SequentialCommandGroup(
new SpinFlywheels(m_shooter, FieldElement.AMP).withTimeout(1.5),
new ParallelCommandGroup(
new Shoot(m_indexer, false), new SpinFlywheels(m_shooter, FieldElement.AMP))));

new Trigger(() -> m_operatorController.getRawButton(Bindings.kFlywheelSpeaker))
.whileTrue(
new SequentialCommandGroup(
new SpinFlywheels(m_shooter, FieldElement.SPEAKER).withTimeout(1.5),
new ParallelCommandGroup(
new Shoot(m_indexer, false),
new SpinFlywheels(m_shooter, FieldElement.SPEAKER))));

m_trapAim.whileTrue(new SpinFlywheels(m_shooter, FieldElement.TRAP));

new Trigger(() -> m_operatorController.getRawButton(Bindings.kRightClimberUp))
.whileTrue(new IndividualClimb(m_climber, true, true));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kRightClimberDown))
.whileTrue(new IndividualClimb(m_climber, true, false));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kLeftClimberUp))
.whileTrue(new IndividualClimb(m_climber, false, true));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kLeftClimberDown))
.whileTrue(new IndividualClimb(m_climber, false, false));

new Trigger(() -> m_operatorController.getRawButton(Bindings.kBothClimbersUp))
.whileTrue(new Climb(m_climber, true));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kBothClimbersDown))
.whileTrue(new Climb(m_climber, false));

new Trigger(() -> m_operatorController.getRawButton(Bindings.kStowShooter))
.whileTrue(new StowShooter(m_shooter));

// triggers for extending and retracting shield manually
// don't extend shield
new Trigger(() -> m_operatorController.getRawButton(Bindings.kExtendShield))
.onTrue(new ActuateShield(m_shooter, false));
// extend shield
new Trigger(() -> m_operatorController.getRawButton(Bindings.kRetractShield))
.onTrue(new ActuateShield(m_shooter, true));
new Trigger(() -> m_operatorController.getRawButton(Bindings.kAimSpeaker))
.whileTrue(new PivotMove(m_shooter, 0.3));

autoChooser.setDefaultOption("Leave Top", AutoBuilder.buildAuto("LeaveFromTop"));
SmartDashboard.putData("Auto Chooser", autoChooser);
new Trigger(() -> m_operatorController.getRawButton(Bindings.kAimAmp))
.whileTrue(new PivotMove(m_shooter, 0.69));
}

private void updateInput() {
Expand All @@ -129,13 +165,27 @@ private void updateInput() {

// TODO: fill in placeholder commands with actual functionality
private void registerCommands() {
NamedCommands.registerCommand("intakeFromFloor", new RunIntake(m_intake, false));
NamedCommands.registerCommand("scoreAmp", doNothing());
NamedCommands.registerCommand("aimAndScoreSpeaker", doNothing());
}

private Command doNothing() {
return Commands.none();
// timeout doesn't need to be set because it is in a race group with the intake path in the
// .path file
NamedCommands.registerCommand("intakeFromFloor", new RunIntake(m_intake, m_indexer, false));

NamedCommands.registerCommand(
"shootSpeaker",
new SequentialCommandGroup(
new PivotMove(m_shooter, 0.3).withTimeout(1),
new SpinFlywheels(m_shooter, FieldElement.SPEAKER).withTimeout(1.5),
new ParallelRaceGroup(
new SpinFlywheels(m_shooter, FieldElement.SPEAKER), new Shoot(m_indexer, false))
.withTimeout(3)));

NamedCommands.registerCommand(
"shootAmp",
new SequentialCommandGroup(
new PivotMove(m_shooter, 0.69).withTimeout(1),
new SpinFlywheels(m_shooter, FieldElement.AMP).withTimeout(1.5),
new ParallelRaceGroup(
new SpinFlywheels(m_shooter, FieldElement.AMP), new Shoot(m_indexer, false))
.withTimeout(3)));
}

/**
Expand All @@ -144,7 +194,7 @@ private Command doNothing() {
* @see RobotConfig.IntakeConfig.Bindings.kIntakeNote
*/
public boolean getIntakeButton() {
return m_operatorController.getRawButton(RobotConfig.IntakeConfig.Bindings.kIntakeNoteButtonID);
return m_operatorController.getRawButton(Bindings.kIntakeNoteButtonID);
}

/**
Expand All @@ -153,8 +203,7 @@ public boolean getIntakeButton() {
* @see RobotConfig.IntakeConfig.Bindings.kReverseIntakeButtonID
*/
public boolean getReverseIntakeButton() {
return m_operatorController.getRawButton(
RobotConfig.IntakeConfig.Bindings.kReverseIntakeButtonID);
return m_operatorController.getRawButton(Bindings.kReverseIntakeButtonID);
}

public boolean triggerPressed() {
Expand Down
67 changes: 0 additions & 67 deletions src/main/java/frc/robot/commands/VisionTranslateCommand.java

This file was deleted.

61 changes: 0 additions & 61 deletions src/main/java/frc/robot/commands/VisionTurnCommand.java

This file was deleted.

Loading