separated arm commands

This commit is contained in:
66945
2023-03-14 11:05:38 -06:00
parent 1d32b65b2f
commit 27ad7c5fe8
2 changed files with 35 additions and 17 deletions
@@ -0,0 +1,30 @@
// 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 frc4388.robot.subsystems.Arm;
public class PivotCommand extends PelvicInflammatoryDisease {
private final Arm arm;
private final double target;
/** Creates a new ArmCommand. */
public PivotCommand(Arm arm, double target) {
super(0.6, 0, 0, 0, 0);
this.arm = arm;
this.target = target;
addRequirements(arm);
}
@Override
public double getError() {
return (arm.getArmRotation() - target) / 360;
}
@Override
public void runWithOutput(double output) {
arm.setRotVel(output);
}
}