defualt command and soft limits

This commit is contained in:
Abhi Sachi
2023-01-21 13:22:37 -07:00
parent 1442b90816
commit 89d8096844
4 changed files with 49 additions and 1 deletions
@@ -13,6 +13,7 @@ import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc4388.robot.Constants.*;
import frc4388.robot.subsystems.Arm;
import frc4388.robot.subsystems.LED;
import frc4388.robot.subsystems.SwerveDrive;
import frc4388.utility.LEDPatterns;
@@ -33,7 +34,9 @@ public class RobotContainer {
/* Subsystems */
private final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.leftFront, m_robotMap.rightFront, m_robotMap.leftBack, m_robotMap.rightBack, m_robotMap.gyro);
private final Arm m_robotArm = new Arm(m_robotMap.pivot, m_robotMap.tele);
private final LED m_robotLED = new LED(m_robotMap.LEDController);
/* Controllers */
@@ -58,6 +61,11 @@ public class RobotContainer {
getDriverController().getLeftYAxis(),
-getDriverController().getRightXAxis(), false), m_robotSwerveDrive)
);
m_robotArm.setDefaultCommand(new RunCommand(() -> m_robotArm.runPivotAndTele(
getOperatorController().getLeftYAxis(),
getOperatorController().getLeftXAxis()), m_robotArm)
);
}
/**