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

Commit

Permalink
Merge branch 'place-game-piece-comms' of https://github.com/Bearbots6…
Browse files Browse the repository at this point in the history
…964/FRC2023 into place-game-piece-comms
  • Loading branch information
TheGamer1002 committed Mar 22, 2023
2 parents b9563a3 + ad7ce4f commit 6ee4f05
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
9 changes: 0 additions & 9 deletions src/main/java/frc/robot/Interfaces/CANSparkMax.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package frc.robot.Interfaces;

import java.util.function.IntConsumer;
import java.util.function.IntSupplier;

import com.revrobotics.REVLibError;

import edu.wpi.first.util.sendable.Sendable;
import edu.wpi.first.util.sendable.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;

// This code has bugs.

Expand Down Expand Up @@ -260,7 +255,6 @@ public void initSendable(SendableBuilder builder) {
builder.addBooleanProperty("Brake Mode", this::isBraking, this::setBrakeMode);
builder.addBooleanProperty("Coast Mode", this::isCoasting, this::setCoastMode);


// current limits
builder.addIntegerProperty("Current Limit", null, this::setSmartCurrentLimit);
}
Expand Down Expand Up @@ -322,11 +316,8 @@ public void setCoastMode(boolean coast) {
}
}


public REVLibError setSmartCurrentLimit(Long limit) {
throwIfClosed();
return setSmartCurrentLimit(limit.intValue(), 0, 20000);
}


}
6 changes: 2 additions & 4 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

package frc.robot;

import edu.wpi.first.wpilibj.DataLogManager;
import edu.wpi.first.wpilibj.DriverStation;
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;
import edu.wpi.first.wpilibj.DataLogManager;
import edu.wpi.first.wpilibj.DriverStation;

/**
* The VM is configured to automatically run this class, and to call the functions corresponding to
Expand All @@ -34,7 +34,6 @@ public void robotInit() {
// Test values for the servo on startup (This is just a test that should be removed if it
// actually works)


DataLogManager.start();
DriverStation.startDataLog(DataLogManager.getLog());
}
Expand Down Expand Up @@ -64,7 +63,6 @@ public void disabledInit() {}
public void disabledPeriodic() {}

/** This autonomous runs the autonomous command selected by your {@link RobotContainer} class. */

@Override
public void autonomousInit() {
m_autonomousCommand = m_robotContainer.getAutonomousCommand();
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class RobotContainer {
private final DriveCommand m_DriveCommand = new DriveCommand(m_Tank);
private final BalanceCommand m_BalanceCommand = new BalanceCommand(m_PID, m_Tank);
private final AutoCommand m_AutoCommand = new AutoCommand(m_PID, m_Tank, m_claw, m_Arm);
private final PlaceConeSecondLevelCommand m_PlaceConeSecondLevelCommand =
private final PlaceConeSecondLevelCommand m_PlaceConeSecondLevelCommand =
new PlaceConeSecondLevelCommand(m_Tank, m_Arm);
private final IncreaseMaxSpeedCommand m_IncreaseMaxSpeedCommand =
new IncreaseMaxSpeedCommand(m_Tank);
Expand Down Expand Up @@ -93,9 +93,8 @@ private void configureButtonBindings() {
.whileTrue(m_OpenClawCommand);
new JoystickButton(m_armController2, XboxController.Button.kLeftBumper.value)
.whileTrue(m_FineDriveCommand);
new JoystickButton(m_armController2,XboxController.Button.kB.value)
.whileTrue(m_PlaceConeSecondLevelCommand);

new JoystickButton(m_armController2, XboxController.Button.kB.value)
.whileTrue(m_PlaceConeSecondLevelCommand);
}

public static double getDriverControllerLeftStickY() {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/frc/robot/commands/AutoCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.subsystems.*;


public class AutoCommand extends SequentialCommandGroup {
public AutoCommand(PID m_pid, Tank m_driveBase, Claw m_claw, Arm m_arm) {
addCommands(new PlaceConeSecondLevelCommand(m_driveBase, m_arm));
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/commands/BalanceCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ public void execute() {
if (Math.abs(pitchOffset) < 2) {
driveBase.setAllMotors(0);
} else {
driveBase.setAllMotors(
Constants.OperatorConstants.Pconstant * (pitchOffset));
driveBase.setAllMotors(Constants.OperatorConstants.Pconstant * (pitchOffset));

SmartDashboard.putNumber(
"motor speed", Constants.OperatorConstants.Pconstant * (pitchOffset));
Expand Down

0 comments on commit 6ee4f05

Please sign in to comment.