Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into Upstream_Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedHearth committed Mar 29, 2024
2 parents bd000c8 + a878629 commit 96cda2f
Show file tree
Hide file tree
Showing 73 changed files with 373 additions and 1,280 deletions.
29 changes: 24 additions & 5 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
# DEVELOPING #

## Useful links ##
- (Apriltag PDF Generator)[https://tools.limelightvision.io/apriltag-generator]
These are just various development-related notes. <!-- Fun to play around with markdown formatting too! -->

## AdvantageKit Notes ##
In order to utilize AdvantageKit properly, different _Logger_ classes need to replace the hardware I/O to record data. For example:
- SendableChooser() -> LoggedDashboardChooser()
- s
In order to utilize AdvantageKit properly, different _Logger_ classes need be placed in between hardware I/O and user input to record data. For example, to log which option of a SmartDashboard _SendableChooser_ was chosen for an Autonomous routine, you would do something like this:
```java
SendableChooser<Command> chooser = new SendableChooser<>();
// Adding all the options for the SendableChooser goes here.
LoggedDashboardChooser<Command> autoChooser;
autoChooser = new LoggedDashboardChooser<>("Autonomous Choices", chooser);
```

## Limelight Notes ##
The static IP for the Limelight 2 is **10.58.29.18**.
The static IP for the Limelight 3G is **10.58.29.11**.
When physically connected by Ethernet, it can be found at at _limelight.local_, port **5801** for the configuration panel,
port **5800** for the camera stream.
> Note that the limelight relative to the center of the robot is roughly: 10 inches to the left, 20 inches up, and 2 inches forward.
> Nevermind, no longer true. Check again.
## Watch for changes upstream ##
- **Main template:** [Mechanical-Advantage/AdvantageKit/commits/main/example_projects/advanced_swerve_drive/src/main](https://github.com/Mechanical-Advantage/AdvantageKit/commits/main/example_projects/advanced_swerve_drive/src/main)
- **Limelight/AprilTag subsystem code:** [Hemlock5712/AdvantageKitSwerveTemplate/commits/main/src/main/java/frc/robot](https://github.com/Hemlock5712/AdvantageKitSwerveTemplate/commits/main/src/main/java/frc/robot)
- **LimelightHelper library:** [LimelightVision/limelightlib-wpijava/commits/main/](https://github.com/LimelightVision/limelightlib-wpijava/commits/main/)

## Useful links ##
- [Apriltag PDF Generator](https://tools.limelightvision.io/apriltag-generator)
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# FRC-2024
[![Build](https://github.com/awtybots/FRC-2024/actions/workflows/build.yml/badge.svg)](https://github.com/awtybots/FRC-2024/actions/workflows/build.yml)
[![Spotless](https://github.com/awtybots/FRC-2024/actions/workflows/spotless.yml/badge.svg)](https://github.com/awtybots/FRC-2024/actions/workflows/spotless.yml)

The code for the 2024 FRC season robot for Awtybots 5829.
The code for the 2024 FRC season robot for Awtybots 5829. Uses PathPlanner, AdvantageKit, SparkMax swerve and motors, Limelight camera, and a NavX gyro as its main technologies (along with WPILIB, of course). Uses Gradle and Spotless.

## Credits

Thank you FRC 6328 and FRC 3015!
Thank you FRC 6328, FRC 5172, and FRC 3015!
61 changes: 0 additions & 61 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,51 +149,10 @@ public static final class ArmConstants {
// public static final double initialAngle = 0.0; // Not sure what this is for
}

public static final class ArmElevatorConstants {
public static final int kArmElevatorMotorId = 17; // ! Change before testing

public static final int kCurrentLimit = 30;

public static final int initialExtension = 0;
public static double minExtension = 0;
public static double maxExtension = 2.6; // Inches

// public static final double armElevatorConversion = 1;

// Arm Elevator PID constants
public static final double kP = 1;
public static final double kI = 0;
public static final double kD = 0.0;

// Arm Elevator Feedforward characterization constants
public static final double ks = 0;
public static final double kv = 0;
}

public static final class Presets {
public static final double ArmThreshold = 0.1;
}

public static final class WristConstants {
public static final int kWristMotorId = 60; // ! Change before testing

public static final int kCurrentLimit = 30;

public static final int initialAngle = 0; // radians

public static final int minAngle = -1; // radians
public static final int maxAngle = 1; // radians

// Wrist PID constants
public static final double kP = 0.1;
public static final double kI = 0.0;
public static final double kD = 0.0;

// Wrist Feedforward characterization constants
public static final double ks = 0.10;
public static final double kv = 0.05;
}

public static final class ClimberConstants {
public static final int kLeftClimberMotorId = 16;
public static final int kRightClimberMotorId = 15;
Expand All @@ -218,24 +177,4 @@ public static final class ClimberConstants {
public static final double ks = 0.10;
public static final double kv = 0.05;
}

public static final class SticksConstants {
public static final int kSticksMotorId = 10000; // ! Change before testing

public static final int kCurrentLimit = 30;

public static final int initialAngle = 0; // radians

public static final int minAngle = 0; // radians
public static final int maxAngle = 1; // radians

// Sticks PID constants
public static final double kP = 0.1;
public static final double kI = 0.0;
public static final double kD = 0.0;

// Sticks Feedforward characterization constants
// public static final double ks = 0.10;
// public static final double kv = 0.05;
}
}
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Awtybots 5829 2024 Codebase
// Thank you FRC 6328 and FRC 3015!
// Copyright 2016-2024 FRC 5829
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down
53 changes: 4 additions & 49 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2021-2024 FRC 6328, FRC 5829
// http://github.com/Mechanical-Advantage
// Copyright 2016-2024 FRC 5829, FRC 6328
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -44,10 +43,6 @@
import frc.robot.subsystems.arm.ArmIO;
import frc.robot.subsystems.arm.ArmIOSim;
import frc.robot.subsystems.arm.ArmIOSparkMax;
import frc.robot.subsystems.armElevator.ArmElevator;
import frc.robot.subsystems.armElevator.ArmElevatorIO;
import frc.robot.subsystems.armElevator.ArmElevatorIOSim;
import frc.robot.subsystems.armElevator.ArmElevatorIOSparkMax;
import frc.robot.subsystems.climber.Climber;
import frc.robot.subsystems.climber.ClimberIO;
import frc.robot.subsystems.climber.ClimberIOSim;
Expand All @@ -66,15 +61,7 @@
import frc.robot.subsystems.intake.IntakeIO;
import frc.robot.subsystems.intake.IntakeIOSim;
import frc.robot.subsystems.intake.IntakeIOSparkMax;
// import frc.robot.subsystems.sticks.Sticks;
// import frc.robot.subsystems.sticks.SticksIO;
// import frc.robot.subsystems.sticks.SticksIOSim;
// import frc.robot.subsystems.sticks.SticksIOSparkMax;
import frc.robot.subsystems.intake.ProximitySensorIOV3;
import frc.robot.subsystems.wrist.Wrist;
import frc.robot.subsystems.wrist.WristIO;
import frc.robot.subsystems.wrist.WristIOSim;
import frc.robot.subsystems.wrist.WristIOSparkMax;
import java.util.ArrayList;
import java.util.List;
import org.littletonrobotics.junction.networktables.LoggedDashboardChooser;
Expand All @@ -92,11 +79,8 @@ public class RobotContainer {
private final Flywheel sFlywheel;
private final Intake sIntake;
private final Arm sArm;
private final ArmElevator sArmElevator;
private final Wrist sWrist;
private final Climber sClimber;
private final LedSubsystem ledSubsystem;
// private final Sticks sSticks;

// Controllers
private final CommandXboxController driverController = new CommandXboxController(0);
Expand Down Expand Up @@ -126,10 +110,7 @@ public RobotContainer() {
sFlywheel = new Flywheel(new FlywheelIOSparkMax());
sIntake = new Intake(new IntakeIOSparkMax() {}, new ProximitySensorIOV3() {});
sArm = new Arm(new ArmIOSparkMax() {});
sArmElevator = new ArmElevator(new ArmElevatorIOSparkMax() {});
sWrist = new Wrist(new WristIOSparkMax() {});
sClimber = new Climber(new ClimberIOSparkMax() {});
// sSticks = new Sticks(new SticksIOSparkMax() {});

break;

Expand All @@ -147,10 +128,7 @@ public RobotContainer() {
sFlywheel = new Flywheel(new FlywheelIOSim());
sIntake = new Intake(new IntakeIOSim() {}, new ProximitySensorIOV3() {});
sArm = new Arm(new ArmIOSim() {});
sArmElevator = new ArmElevator(new ArmElevatorIOSim() {});
sWrist = new Wrist(new WristIOSim() {});
sClimber = new Climber(new ClimberIOSim() {});
// sSticks = new Sticks(new SticksIOSim() {});

break;

Expand All @@ -166,10 +144,7 @@ public RobotContainer() {
sFlywheel = new Flywheel(new FlywheelIO() {});
sIntake = new Intake(new IntakeIO() {}, new ProximitySensorIOV3() {});
sArm = new Arm(new ArmIO() {});
sArmElevator = new ArmElevator(new ArmElevatorIO() {});
sWrist = new Wrist(new WristIO() {});
sClimber = new Climber(new ClimberIO() {});
// sSticks = new Sticks(new SticksIO() {});

break;
}
Expand Down Expand Up @@ -220,9 +195,7 @@ public RobotContainer() {

// In testing
NamedCommands.registerCommand(
"SpeakerShot",
SpeakerShot.run(1, sArm, sArmElevator, sWrist)
.withTimeout(5.0)); // TODO Replace SpeakerDistance
"SpeakerShot", SpeakerShot.run(1, sArm).withTimeout(5.0)); // TODO Replace SpeakerDistance

// Build SmartDashboard auto chooser
if (!AutoBuilder.isConfigured()) {
Expand Down Expand Up @@ -434,15 +407,6 @@ private void configureButtonBindings() {
// Operator controller configurations
sArm.setDefaultCommand(ArmCommands.joystickDrive(sArm, () -> -operatorController.getRightY()));

// sWrist.setDefaultCommand(
// WristCommands.joystickDrive(sWrist, () -> operatorController.getLeftY()));

// sArmElevator.setDefaultCommand(
// ArmElevatorCommands.triggerDrive(
// sArmElevator,
// () -> operatorController.getLeftTriggerAxis(),
// () -> operatorController.getRightTriggerAxis()));

sIntake.setDefaultCommand(
IntakeShooterControls.intakeShooterDrive(
sIntake,
Expand Down Expand Up @@ -491,21 +455,12 @@ private void configureButtonBindings() {
// operatorController.y().whileTrue(new ShootNote(sIntake, sArm, sFlywheel));

// run straight forwards position when x is pressed
operatorController.x().whileTrue(AmpShot.run(sArm, sArmElevator, sWrist));
operatorController.x().whileTrue(AmpShot.run(sArm));
// operatorController.x().whileTrue(new AdjustNote(sIntake, sArm, sFlywheel));

operatorController.a().whileTrue(FloorPickup.run(sArm));

operatorController.b().whileTrue(StowPosition.run(sArm, sArmElevator, sWrist));

// operatorController
// .x()
// .whileTrue(Commands.startEnd(() -> sSticks.runTargetAngle(0.0), sSticks::stop, sSticks));
// operatorController
// .y()
// .whileTrue(
// Commands.startEnd(
// () -> sSticks.runTargetAngle(0.5), sSticks::stop, sSticks)); // !Testing numbers
operatorController.b().whileTrue(StowPosition.run(sArm));
}

/**
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/frc/robot/commands/AdjustNote.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
// Copyright 2016-2024 FRC 5829
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 3 as published by the Free Software Foundation or
// available in the root directory of this project.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.commands;

import edu.wpi.first.wpilibj2.command.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2021-2024 FRC 6328, FRC 5829
// http://github.com/Mechanical-Advantage
// Copyright 2016-2024 FRC 5829
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2021-2024 FRC 6328
// http://github.com/Mechanical-Advantage
// Copyright 2016-2024 FRC 6328, FRC 5829
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2021-2024 FRC 6328, FRC 5829
// http://github.com/Mechanical-Advantage
// Copyright 2016-2024 FRC 5829
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down

This file was deleted.

Loading

0 comments on commit 96cda2f

Please sign in to comment.