-
Notifications
You must be signed in to change notification settings - Fork 1
#fried #WhatAmIDoing #NotSureIfTheErrorsAreMyComputerBeingDifficultOr… #1
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,43 @@ | ||
| // // Copyright (c) FIRST and other WPILib contributors. | ||
| // // Open Source Software; you can modify and/or share it under the terms of | ||
| // // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| // package frc.robot.commands; | ||
|
|
||
| // import frc.robot.subsystems.ExampleSubsystem; | ||
| // import edu.wpi.first.wpilibj2.command.Command; | ||
|
|
||
| // /** An example command that uses an example subsystem. */ | ||
| // public class ExampleCommand extends Command { | ||
| // @SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"}) | ||
| // private final ExampleSubsystem m_subsystem; | ||
|
|
||
| // /** | ||
| // * Creates a new ExampleCommand. | ||
| // * | ||
| // * @param subsystem The subsystem used by this command. | ||
| // */ | ||
| // public ExampleCommand(ExampleSubsystem subsystem) { | ||
| // m_subsystem = subsystem; | ||
| // // Use addRequirements() here to declare subsystem dependencies. | ||
| // addRequirements(subsystem); | ||
| // } | ||
|
|
||
| // // Called when the command is initially scheduled. | ||
| // @Override | ||
| // public void initialize() {} | ||
|
|
||
| // // Called every time the scheduler runs while the command is scheduled. | ||
| // @Override | ||
| // public void execute() {} | ||
|
|
||
| // // Called once the command ends or is interrupted. | ||
| // @Override | ||
| // public void end(boolean interrupted) {} | ||
|
|
||
| // // Returns true when the command should end. | ||
| // @Override | ||
| // public boolean isFinished() { | ||
| // return false; | ||
| // } | ||
| // } | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
| // Open Source Software; you can modify and/or share it under the terms of | ||
| // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| package frc.robot.commands; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import frc.robot.subsystems.Shooter; | ||
|
|
||
| /** An example command that uses an example subsystem. */ | ||
| public class ExampleCommand extends Command { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commands might be a little out of scope, but you can see some example commands that were used on Reefscape here: https://github.com/FRC-Team-1160/2025-Reefscape/blob/main/src/main/java/frc/robot/SubsystemManager.java They didn't seem to create their own Command classes, but they combined a set of commands that changed and/or tracked some of the robot's states until it met certain objectives so they could use them for the pathplanner auto. |
||
| @SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"}) | ||
| private final Shooter m_subsystem; | ||
|
|
||
| /** | ||
| * Creates a new ExampleCommand. | ||
| * | ||
| * @param subsystem The subsystem used by this command. | ||
| */ | ||
| public ExampleCommand(Shooter subsystem) { | ||
| m_subsystem = subsystem; | ||
| // Use addRequirements() here to declare subsystem dependencies. | ||
| addRequirements(subsystem); | ||
| } | ||
|
|
||
| // Called when the command is initially scheduled. | ||
| @Override | ||
| public void initialize() {} | ||
|
|
||
| // Called every time the scheduler runs while the command is scheduled. | ||
| @Override | ||
| public void execute() {} | ||
|
|
||
| // Called once the command ends or is interrupted. | ||
| @Override | ||
| public void end(boolean interrupted) {} | ||
|
|
||
| // Returns true when the command should end. | ||
| @Override | ||
| public boolean isFinished() { | ||
| return false; | ||
| } | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is probably freaking out because it's not |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package frc.robot.subsystems; | ||
|
|
||
| import com.ctre.phoenix6.controls.VoltageOut; | ||
| import com.ctre.phoenix6.hardware.TalonFX; | ||
| import com.revrobotics.spark.SparkMax; | ||
| import com.revrobotics.spark.SparkLowLevel.MotorType; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
|
|
||
| public class Climber extends SubsystemBase { | ||
|
|
||
| TalonFX motor_one, motor_two; | ||
|
|
||
| public Climber() { | ||
| motor_one = new TalonFx(27, /*idk what type our motors are*/); | ||
| motor_two = new TalonFX(28, /*idk what type our motors are*/ ); | ||
|
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know either :) |
||
| } | ||
|
|
||
| public void grabUp(double volts) { | ||
| motor_one.set(volts); | ||
| motor_two.set(volts); | ||
| } | ||
|
|
||
| public void afk(){ | ||
| motor_one.set(0.5); | ||
| motor_two.set(0.5) | ||
| } | ||
|
|
||
| public void grabDown(double volts) { | ||
| motor_one.set(-volts); | ||
| motor_two.set(-volts); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| package frc.robot.subsystems; | ||
|
|
||
| import com.ctre.phoenix6.controls.VoltageOut; | ||
| import com.ctre.phoenix6.hardware.TalonFX; | ||
| import com.revrobotics.spark.SparkMax; | ||
| import com.revrobotics.spark.SparkLowLevel.MotorType; | ||
|
|
||
| import edu.wpi.first.wpilibj.motorcontrol.Talon; | ||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
|
|
||
| public class Elevator extends SubsystemBase { | ||
| TalonFx motor_one; | ||
| TalonFX motor_two; | ||
|
|
||
| //max speed is .05 | ||
|
|
||
| public Elevator(){ | ||
| //lmk if these below are errors on the team computer too because | ||
| //it might just be my computer being difficult again | ||
| motor_one; = new TalonFx(/*port*/); | ||
| motor_two; = new TalonFx(/*port*/); //side note (again ikr eyeroll) idk the ports but | ||
| //im pretty sure the ones we use are in the constants... | ||
|
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same idea here - I think since this is a totally separate project and branch, you can choose where you want to store them and name them appropriately also I think Reefscape's elevator uses just one motor so you can probably just make this one guy |
||
|
|
||
| motor_one.setPosition(0); | ||
| motor_one.set(.02); //you can change this value if its too slow | ||
| // i think... | ||
| motor_one.setPosition(0); | ||
| motor_two.set(.02); | ||
|
|
||
| //most of the stuff is encoder values i believe bc setPosition is | ||
| //using rotations | ||
| } | ||
| //grab values from actual tests from riologs? | ||
| double l4value = motor_one.getPositon(); | ||
| //assuming levels are equidistant | ||
| public double l3val = .66*l4value; | ||
| public double l2val = .33*l4value; | ||
| public double l1val = 0.01; | ||
|
Comment on lines
+34
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems fine for now. probably when you do this for reals you'll get the exact values and just set them as constants for this subsystem |
||
|
|
||
| public void runMotors(double speed) { | ||
| motor_one.set(speed); | ||
| motor_two.set(-speed); | ||
|
|
||
| } | ||
|
|
||
| //making seperate methods for each level so perchance i can set | ||
| //one button per each thing | ||
| //joystick thing was perchance too ambitious | ||
| public void l4(){ | ||
| motor_one.setPositon(l4value); | ||
| motor_two.setPosition(-l4value); | ||
| //idk if this works for sure, if the | ||
| // motors work in opposite directions th | ||
| // en do they do to the same positon but | ||
| // just like the opposite? idk. | ||
| //gemini said yes 🥹 | ||
|
Comment on lines
+52
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assuming you configure the motors facing each other and configure them the same, probably...? also |
||
|
|
||
| } | ||
|
|
||
| public void l3(){ | ||
| motor_one.setPositon(l3value); | ||
| motor_two.setPosition(-l3value); | ||
| } | ||
|
|
||
| public void l2(double l2value){ | ||
| motor_one.setPositon(l2value); | ||
| motor_two.setPosition(-l2value); | ||
| } | ||
|
|
||
|
|
||
| //i believe zeroeing out the position after each preset might | ||
| //make these work and im scared to see what would happen | ||
| //if you dont | ||
|
|
||
| public void zeroout(){ | ||
| motor_one.setPosition(0); | ||
| motor_one.setPosition(0); | ||
| } //if this line has an error for you i genuinely dont know why | ||
| //girl bye this bracket is making me go insane | ||
| //the class ISN'T supposed to end liek dawg ik | ||
| //vscode make sense challenge go!t6y54rt | ||
|
|
||
|
|
||
| //my attempt with the joysticks ✌️ | ||
| //the rest is in robot container where all the controls are | ||
| //just fry me already | ||
|
|
||
| public void generalmove(velo){ | ||
| motor_one.setVotlage(velo); | ||
| } | ||
| //this error above is related to the one on line 77... | ||
| //(insert speed gif) | ||
|
|
||
| //also gonna make an "afk" thing that applies constant voltage to perchance | ||
| //keep the elevator at the target position like how we did witht eh climber wow | ||
|
Comment on lines
+94
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can try a You'd configure the motor in the constructor to "brake" when in neutral (probably have to configure one of these) and then requesting a |
||
|
|
||
| public void afk(){ | ||
| if(motor_one.getPositon() < ) | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package frc.robot.subsystems; | ||
|
|
||
| import edu.wpi.first.wpilibj.Servo; | ||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
|
|
||
| public class Funnel extends SubsystemBase { | ||
|
|
||
| Servo motor_one, motor_two; | ||
| boolean on_off = false; | ||
|
|
||
| public Funnel() { | ||
| motor_one = new Servo(1); | ||
| motor_two = new Servo(2); | ||
| } | ||
|
|
||
| public void setBoth(double angle, double secondAngle) { | ||
| motor_one.setAngle(angle); | ||
| motor_two.setAngle(secondAngle); | ||
| } | ||
|
|
||
| public void flip() { | ||
| if (on_off) { | ||
| motor_one.setAngle(180.0); | ||
| motor_two.setAngle(0); | ||
| } else { | ||
| motor_one.setAngle(0); | ||
| motor_two.setAngle(180.0); | ||
| } | ||
| on_off = !on_off; | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok it might also be worth making like a
JoystickButtonConstantsfile so if we look at this next year, we aren't confused what button is which on the controller