Skip to content

Commit

Permalink
bye bye arm (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack60612 authored Nov 9, 2023
1 parent 1130ee0 commit 051ad1c
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 399 deletions.
13 changes: 4 additions & 9 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public static final class CANConstants {
public static final int MOTORBACKRIGHTID = 12;
public static final int MOTORFRONTLEFTID = 13;
public static final int MOTORBACKLEFTID = 14;
/// Arm movement motors
public static final int ARMELEVATORMOTORID = 22;
public static final int ARMCLAWMOTORID = 23;
}

public static final double MAX_SPEED = 0.8;
Expand All @@ -30,11 +27,12 @@ public static final class CANConstants {
public static final int CONTROLLERUSBINDEX = 0;
public static final int FLIGHTSTICKUSBINDEX = 1;

// Game Controller Buttons
// Now In RobotContainer as Native Triggers.

// Joystick buttons
public static final int AIMBUTTON = 12;
public static final int CLAWBUTTON = 1;
public static final int ARMDOWNBUTTON = 3;
public static final int ARMUPBUTTON = 4;

// Analog Ports
/// Ultrasonic Sensors and ports.
public static final int ULTRASONIC1PORT = 0;
Expand All @@ -45,7 +43,4 @@ public static final class CANConstants {
public static final int DRIVEENCODERLEFTB = 1;
public static final int DRIVEENCODERRIGHTA = 2;
public static final int DRIVEENCODERRIGHTB = 3;
/// Limit Switches
public static final int LSWITCHCLAWOPEN = 4;
public static final int LSWITCHCLAWCLOSE = 5;
}
25 changes: 0 additions & 25 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@
import frc.robot.commands.AimCommand;
import frc.robot.commands.BalanceCommand;
import frc.robot.commands.DefaultDrive;
import frc.robot.commands.PlaceCommand;
import frc.robot.commands.StraightCommand;
import frc.robot.commands.arm.ArmDownCommand;
import frc.robot.commands.arm.ArmUpCommand;
import frc.robot.commands.arm.ClawCommand;
import frc.robot.subsystems.DriveSubsystem;
import frc.robot.subsystems.UltrasonicSubsystem;
import frc.robot.subsystems.arm.ClawSubsystem;
import frc.robot.subsystems.arm.ElevatorSubsystem;
import java.util.HashMap;
import java.util.List;

Expand All @@ -52,30 +46,20 @@ public class RobotContainer {
new UltrasonicSubsystem(Constants.ULTRASONIC1PORT);

private final DriveSubsystem m_driveSubsystem = new DriveSubsystem();
private final ElevatorSubsystem m_elevatorSubsystem = new ElevatorSubsystem();
private final ClawSubsystem m_clawSubsystem = new ClawSubsystem();
// The robots commands are defined here..
// private final ExampleCommand m_autoCommand = new ExampleCommand(m_exampleSubsystem);

private final AimCommand m_aimCommand = new AimCommand(m_driveSubsystem);
private final BalanceCommand m_balanceCommand = new BalanceCommand(m_driveSubsystem);
private final PlaceCommand m_placeCommand =
new PlaceCommand(m_clawSubsystem, m_elevatorSubsystem);
private final DefaultDrive m_defaultDrive =
new DefaultDrive(m_driveSubsystem, this::getControllerLeftY, this::getControllerRightY);
private final StraightCommand m_straightCommand =
new StraightCommand(m_driveSubsystem, this::getControllerLeftY, this::getControllerRightY);
private final ClawCommand m_clawCommand = new ClawCommand(m_clawSubsystem, m_flightStick::getY);
private final ArmUpCommand m_armUpCommand = new ArmUpCommand(m_elevatorSubsystem);
private final ArmDownCommand m_armDownCommand = new ArmDownCommand(m_elevatorSubsystem);
// misc init
private Trigger m_switchCameraButton;
private Trigger m_balanceButton;
private Trigger m_straightButton;
private JoystickButton m_aimButton;
private JoystickButton m_clawButton;
private JoystickButton m_armUpButton;
private JoystickButton m_armDownButton;
// Init For Autonomous
private RamseteAutoBuilder autoBuilder;
private final HashMap<String, Command> autonomousEventMap = new HashMap<String, Command>();
Expand All @@ -91,8 +75,6 @@ public RobotContainer() {

// set default drive command
m_driveSubsystem.setDefaultCommand(m_defaultDrive);
// set claw default command
m_clawSubsystem.setDefaultCommand(m_clawCommand);
}

/**
Expand All @@ -107,17 +89,11 @@ private void configureButtonBindings() {
m_balanceButton = m_controller1.rightBumper();
m_straightButton = m_controller1.rightTrigger();
// Joystick buttons
m_clawButton = new JoystickButton(m_flightStick, Constants.CLAWBUTTON);
m_aimButton = new JoystickButton(m_flightStick, Constants.AIMBUTTON);
m_armDownButton = new JoystickButton(m_flightStick, Constants.ARMDOWNBUTTON);
m_armUpButton = new JoystickButton(m_flightStick, Constants.ARMUPBUTTON);
// commands
m_balanceButton.whileTrue(m_balanceCommand);
m_straightButton.whileTrue(m_straightCommand);
m_aimButton.whileTrue(m_aimCommand);
m_clawButton.toggleOnTrue(m_clawCommand).toggleOnFalse(m_clawCommand);
m_armDownButton.whileTrue(m_armDownCommand);
m_armUpButton.whileTrue(m_armUpCommand);

m_controller1.a().whileTrue(new InstantCommand(() -> m_driveSubsystem.SetBrakemode()));
m_controller1.b().whileTrue(new InstantCommand(() -> m_driveSubsystem.SetCoastmode()));
Expand All @@ -134,7 +110,6 @@ private void initializeAutonomous() {
// ex:
// autonomousEventMap.put("A", new PathFollowingCommand(m_driveSubsystem, pathGroup.get(0)));
autonomousEventMap.put("BalanceRobot", m_balanceCommand);
autonomousEventMap.put("PlaceCube", m_placeCommand);

// Create the AutoBuilder. This only needs to be created once when robot code starts, not every
// time you want to create an auto command.
Expand Down
50 changes: 0 additions & 50 deletions src/main/java/frc/robot/commands/PlaceCommand.java

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/java/frc/robot/commands/arm/ArmDownCommand.java

This file was deleted.

45 changes: 0 additions & 45 deletions src/main/java/frc/robot/commands/arm/ArmUpCommand.java

This file was deleted.

59 changes: 0 additions & 59 deletions src/main/java/frc/robot/commands/arm/ClawCommand.java

This file was deleted.

72 changes: 0 additions & 72 deletions src/main/java/frc/robot/subsystems/arm/ClawSubsystem.java

This file was deleted.

Loading

0 comments on commit 051ad1c

Please sign in to comment.