Revert "Arm command --> Master"

This commit is contained in:
Aarav Shah
2023-03-16 16:33:07 -06:00
committed by GitHub
parent 8ef08f57a7
commit 5858fc6c91
8 changed files with 44 additions and 122 deletions
@@ -1,36 +0,0 @@
// 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 frc4388.robot.commands;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc4388.robot.subsystems.Arm;
public class ExtendArmTo extends CommandBase {
private final Arm m_arm;
private final double m_target;
private final boolean m_direction;
public ExtendArmTo(Arm arm, double units) {
m_arm = arm;
m_target = units;
m_direction = m_target > 1;
addRequirements(m_arm);
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
m_arm.setTeleVel(m_direction ? 1 : -1, false);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
if (m_direction)
return m_arm.getTeleUnit() > m_target;
else
return m_arm.getTeleUnit() < m_target;
}
}
@@ -5,25 +5,22 @@
package frc4388.robot.commands;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc4388.robot.subsystems.Arm;
import frc4388.robot.subsystems.SwerveDrive;
public class RunArmIn extends CommandBase {
private final Arm m_arm;
public RunArmIn(Arm arm) {
m_arm = arm;
addRequirements();
public class LimeAlign extends CommandBase {
public LimeAlign(SwerveDrive drive) {
addRequirements(drive);
}
// Called when the command is initially scheduled.
@Override
public void initialize() {}
public void initialize() {
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
m_arm.setTeleVel(1, true);
}
public void execute() {}
// Called once the command ends or is interrupted.
@Override
@@ -32,6 +29,6 @@ public class RunArmIn extends CommandBase {
// Returns true when the command should end.
@Override
public boolean isFinished() {
return m_arm.isTeleIn();
return false;
}
}
@@ -27,6 +27,6 @@ public class PivotCommand extends PelvicInflammatoryDisease {
@Override
public void runWithOutput(double output) {
SmartDashboard.putNumber("pivot output", output);
arm.setRotVel(output, true);
arm.setRotVel(output);
}
}
@@ -27,6 +27,6 @@ public class TeleCommand extends PelvicInflammatoryDisease {
@Override
public void runWithOutput(double output) {
arm.setTeleVel(output, true);
arm.setTeleVel(output);
}
}