Skip to content
Open
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
9 changes: 4 additions & 5 deletions src/main/java/org/carlmontrobotics/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import edu.wpi.first.wpilibj.RobotBase;
import edu.wpi.first.wpilibj.XboxController.Axis;
import edu.wpi.first.wpilibj.XboxController.Button;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import edu.wpi.first.math.util.Units;
import static org.carlmontrobotics.Config.CONFIG;

Expand Down Expand Up @@ -273,8 +272,8 @@ public static final class IntakeC {
public static final int INTAKE_ID = 24;
public static final int INTAKE_FOLLOWER_ID = 21;
public static final int CONVEYOR_ID = 22;
public static final double INTAKE_SPEED = 3000; //TODO
public static final double CONVEYOR_SPEED = 0.9; //TODO
public static final double INTAKE_SPEED = 3000;
public static final double CONVEYOR_SPEED = 0.9;
}
public static final class OuttakeC {
public static final int OUTTAKE_ID = 31;
Expand All @@ -285,8 +284,8 @@ public static final class OuttakeC {
public static final MotorConfig OUTTAKE_FOLLOWER_MOTOR_CONFIG = MotorConfig.NEO_VORTEX;
public static final MotorConfig OUTTAKE_FEEDER_MOTOR_CONFIG = MotorConfig.NEO_VORTEX;

public static final double OUTTAKE_SHOOTING_RPM = 2450; //TODO
public static final double OUTTAKE_PASSING_RPM = 5000; //TODO
public static final double OUTTAKE_SHOOTING_RPM = 2450;
public static final double OUTTAKE_PASSING_RPM = 5000;

public static final double kP = 0.0004;
public static final double kI = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/carlmontrobotics/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

package org.carlmontrobotics;

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

Expand Down
31 changes: 2 additions & 29 deletions src/main/java/org/carlmontrobotics/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,67 +17,41 @@
import org.carlmontrobotics.commands.ManipulatorCommands.RunConveyor;
import org.carlmontrobotics.commands.ManipulatorCommands.ShootBalls;
import org.carlmontrobotics.commands.ManipulatorCommands.SmartShoot;
import org.carlmontrobotics.commands.ManipulatorCommands.OuttakeFeeder;

import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_PASSING_RPM;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_SHOOTING_RPM;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Transform2d;
import edu.wpi.first.math.util.Units;
import edu.wpi.first.util.sendable.Sendable;
import edu.wpi.first.util.sendable.SendableBuilder;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance;

import java.util.function.BooleanSupplier;

import javax.print.attribute.standard.MediaSize.NA;

import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;

//auton
import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.commands.PathPlannerAuto;
import com.pathplanner.lib.path.GoalEndState;
import com.pathplanner.lib.path.PathPlannerPath;
import com.pathplanner.lib.path.Waypoint;
import com.pathplanner.lib.auto.NamedCommands;

//controllers
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.XboxController.Axis;
import edu.wpi.first.wpilibj.XboxController.Button;

//commands
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.ConditionalCommand;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup;
import edu.wpi.first.wpilibj2.command.PrintCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.WaitCommand;

//control bindings
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import edu.wpi.first.wpilibj2.command.button.POVButton;
import edu.wpi.first.wpilibj2.command.button.Trigger;

//constants
import org.carlmontrobotics.Constants.OI;
import org.carlmontrobotics.Constants.OI.Driver;
import org.carlmontrobotics.Constants.OI.Manipulator;
import org.carlmontrobotics.Constants.OuttakeC;
import org.carlmontrobotics.Constants.Drivetrainc.Autoc;


//smartdashboard/elastic
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
Expand Down Expand Up @@ -119,7 +93,6 @@ public RobotContainer() {
setBindingsManipulator();

SmartDashboard.putBoolean("Baby Mode", Config.CONFIG.isBabyMode());
// SmartDashboard.putData("Rotate Command",new RotateToTag(drivetrain, limelight));
SmartDashboard.putString("Alliance", DriverStation.getAlliance().toString());
SmartDashboard.putString("Location", DriverStation.getLocation().toString());
SmartDashboard.putBoolean("Connected to FMS?", DriverStation.isFMSAttached());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@

import static org.carlmontrobotics.Constants.IntakeC.CONVEYOR_SPEED;
import static org.carlmontrobotics.Constants.IntakeC.INTAKE_SPEED;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_FEEDER_VOLT_PERC;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_SHOOTING_RPM;

import org.carlmontrobotics.subsystems.Drivetrain;
import org.carlmontrobotics.subsystems.Intake;
import org.carlmontrobotics.subsystems.Outtake;

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

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
Expand All @@ -40,14 +37,6 @@ public CenterLeftNeutralAuto(Drivetrain dt, Outtake shooter, Intake intake) {
this.dt = dt;
timer = new Timer();
addRequirements(shooter, intake, dt);
// SmartDashboard.putNumber("startShoot", startShoot);
// SmartDashboard.putNumber("endshoot", endshoot);
// SmartDashboard.putNumber("endStrafe", endStrafe);
// SmartDashboard.putNumber("endFastDrive", endFastDrive);
// SmartDashboard.putNumber("endSlowDrive", endSlowDrive);
// SmartDashboard.putNumber("endRotation", endRotation);
// SmartDashboard.putNumber("endStrafeDrive", endStrafeDrive);
// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
Expand All @@ -56,13 +45,6 @@ public void initialize() {
dt.resetFieldOrientation();
dt.setFieldOriented(true);
timer.restart();
// startShoot = SmartDashboard.getNumber("startShoot", startShoot);
// endshoot = SmartDashboard.getNumber("endshoot", endshoot);
// endStrafe = SmartDashboard.getNumber("endStrafe", endStrafe);
// endFastDrive = SmartDashboard.getNumber("endFastDrive", endFastDrive);
// endSlowDrive = SmartDashboard.getNumber("endSlowDrive", endSlowDrive);
// endRotation = SmartDashboard.getNumber("endRotation", endRotation);
// endStrafeDrive= SmartDashboard.getNumber("endStrafeDrive", endStrafeDrive);
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down Expand Up @@ -108,7 +90,6 @@ public void end(boolean interrupted) {
shooter.spinOuttakeFeeder(0);
intake.stopConveyor();
dt.stop();
//intake.stopIntake();
}

// Returns true when the command should end.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@

import static org.carlmontrobotics.Constants.IntakeC.CONVEYOR_SPEED;
import static org.carlmontrobotics.Constants.IntakeC.INTAKE_SPEED;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_FEEDER_VOLT_PERC;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_SHOOTING_RPM;

import org.carlmontrobotics.subsystems.Drivetrain;
import org.carlmontrobotics.subsystems.Intake;
import org.carlmontrobotics.subsystems.Outtake;

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

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
Expand All @@ -40,14 +37,6 @@ public CenterRightNeutralAuto(Drivetrain dt, Outtake shooter, Intake intake) {
this.dt = dt;
timer = new Timer();
addRequirements(shooter, intake, dt);
// SmartDashboard.putNumber("startShoot", startShoot);
// SmartDashboard.putNumber("endshoot", endshoot);
// SmartDashboard.putNumber("endStrafe", endStrafe);
// SmartDashboard.putNumber("endFastDrive", endFastDrive);
// SmartDashboard.putNumber("endSlowDrive", endSlowDrive);
// SmartDashboard.putNumber("endRotation", endRotation);
// SmartDashboard.putNumber("endStrafeDrive", endStrafeDrive);
// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
Expand All @@ -56,13 +45,6 @@ public void initialize() {
dt.resetFieldOrientation();
dt.setFieldOriented(true);
timer.restart();
// startShoot = SmartDashboard.getNumber("startShoot", startShoot);
// endshoot = SmartDashboard.getNumber("endshoot", endshoot);
// endStrafe = SmartDashboard.getNumber("endStrafe", endStrafe);
// endFastDrive = SmartDashboard.getNumber("endFastDrive", endFastDrive);
// endSlowDrive = SmartDashboard.getNumber("endSlowDrive", endSlowDrive);
// endRotation = SmartDashboard.getNumber("endRotation", endRotation);
// endStrafeDrive= SmartDashboard.getNumber("endStrafeDrive", endStrafeDrive);
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down Expand Up @@ -108,7 +90,6 @@ public void end(boolean interrupted) {
shooter.spinOuttakeFeeder(0);
intake.stopConveyor();
dt.stop();
//intake.stopIntake();
}

// Returns true when the command should end.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

package org.carlmontrobotics.commands.AutonCommands;

import static org.carlmontrobotics.Constants.IntakeC.CONVEYOR_SPEED;
import static org.carlmontrobotics.Constants.IntakeC.INTAKE_SPEED;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_FEEDER_VOLT_PERC;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_SHOOTING_RPM;

import org.carlmontrobotics.subsystems.Drivetrain;
import org.carlmontrobotics.subsystems.Intake;
import org.carlmontrobotics.subsystems.Outtake;

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

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
Expand All @@ -40,14 +35,6 @@ public LeftNeutralAuto(Drivetrain dt, Outtake shooter, Intake intake) {
this.dt = dt;
timer = new Timer();
addRequirements(shooter, intake, dt);
// SmartDashboard.putNumber("startShoot", startShoot);
// SmartDashboard.putNumber("endshoot", endshoot);
// SmartDashboard.putNumber("endStrafe", endStrafe);
// SmartDashboard.putNumber("endFastDrive", endFastDrive);
// SmartDashboard.putNumber("endSlowDrive", endSlowDrive);
// SmartDashboard.putNumber("endRotation", endRotation);
// SmartDashboard.putNumber("endStrafeDrive", endStrafeDrive);
// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
Expand All @@ -56,13 +43,6 @@ public void initialize() {
dt.resetFieldOrientation();
dt.setFieldOriented(true);
timer.restart();
// startShoot = SmartDashboard.getNumber("startShoot", startShoot);
// endshoot = SmartDashboard.getNumber("endshoot", endshoot);
// endStrafe = SmartDashboard.getNumber("endStrafe", endStrafe);
// endFastDrive = SmartDashboard.getNumber("endFastDrive", endFastDrive);
// endSlowDrive = SmartDashboard.getNumber("endSlowDrive", endSlowDrive);
// endRotation = SmartDashboard.getNumber("endRotation", endRotation);
// endStrafeDrive= SmartDashboard.getNumber("endStrafeDrive", endStrafeDrive);
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down Expand Up @@ -94,7 +74,6 @@ public void end(boolean interrupted) {
shooter.spinOuttakeFeeder(0);
intake.stopConveyor();
dt.stop();
//intake.stopIntake();
}

// Returns true when the command should end.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

package org.carlmontrobotics.commands.AutonCommands;

import static org.carlmontrobotics.Constants.IntakeC.CONVEYOR_SPEED;
import static org.carlmontrobotics.Constants.IntakeC.INTAKE_SPEED;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_FEEDER_VOLT_PERC;
import static org.carlmontrobotics.Constants.OuttakeC.OUTTAKE_SHOOTING_RPM;

import org.carlmontrobotics.subsystems.Drivetrain;
import org.carlmontrobotics.subsystems.Intake;
import org.carlmontrobotics.subsystems.Outtake;

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

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
Expand All @@ -25,9 +20,6 @@ public class RightNeutralAuto extends Command {
private final Intake intake;
private final Timer timer;

private double startShoot = 0.5;
private double endshoot = 4;
private double endStrafe = 1;
private double endFastDrive = 2.4;
private double endSlowDrive = 0.1;
private double endRotation = 0.6;
Expand All @@ -40,14 +32,6 @@ public RightNeutralAuto(Drivetrain dt, Outtake shooter, Intake intake) {
this.dt = dt;
timer = new Timer();
addRequirements(shooter, intake, dt);
// SmartDashboard.putNumber("startShoot", startShoot);
// SmartDashboard.putNumber("endshoot", endshoot);
// SmartDashboard.putNumber("endStrafe", endStrafe);
// SmartDashboard.putNumber("endFastDrive", endFastDrive);
// SmartDashboard.putNumber("endSlowDrive", endSlowDrive);
// SmartDashboard.putNumber("endRotation", endRotation);
// SmartDashboard.putNumber("endStrafeDrive", endStrafeDrive);
// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
Expand All @@ -56,13 +40,6 @@ public void initialize() {
dt.resetFieldOrientation();
dt.setFieldOriented(true);
timer.restart();
// startShoot = SmartDashboard.getNumber("startShoot", startShoot);
// endshoot = SmartDashboard.getNumber("endshoot", endshoot);
// endStrafe = SmartDashboard.getNumber("endStrafe", endStrafe);
// endFastDrive = SmartDashboard.getNumber("endFastDrive", endFastDrive);
// endSlowDrive = SmartDashboard.getNumber("endSlowDrive", endSlowDrive);
// endRotation = SmartDashboard.getNumber("endRotation", endRotation);
// endStrafeDrive= SmartDashboard.getNumber("endStrafeDrive", endStrafeDrive);
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down Expand Up @@ -94,7 +71,6 @@ public void end(boolean interrupted) {
shooter.spinOuttakeFeeder(0);
intake.stopConveyor();
dt.stop();
//intake.stopIntake();
}

// Returns true when the command should end.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.util.sendable.SendableRegistry;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj2.command.Command;

public class RotateToFieldRelativeAngle extends Command {
Expand Down
Loading