mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Add Distance PID Command
This commit is contained in:
@@ -179,6 +179,14 @@ public class Drive extends SubsystemBase {
|
||||
m_driveTrain.arcadeDrive(move, steer);
|
||||
}
|
||||
|
||||
public void gotoPositionPID(WPI_TalonFX talon, double targetPos) {
|
||||
talon.set(TalonFXControlMode.Position, targetPos);
|
||||
}
|
||||
|
||||
public void gotoVelocityPID(WPI_TalonFX talon, double targetVel) {
|
||||
talon.set(TalonFXControlMode.Velocity, targetVel);
|
||||
}
|
||||
|
||||
public double getGyroYaw() {
|
||||
double[] ypr = new double[3];
|
||||
m_pigeon.getYawPitchRoll(ypr);
|
||||
@@ -201,14 +209,4 @@ public class Drive extends SubsystemBase {
|
||||
m_pigeon.setYaw(0);
|
||||
m_pigeon.setAccumZAngle(0);
|
||||
}
|
||||
|
||||
// Motion Magic Testing
|
||||
public void goToTargetPos()
|
||||
{
|
||||
//double targetPos = XboxController.RIGHT_Y_AXIS * DriveConstants.ENCODER_TICKS_PER_REV * 10.0;
|
||||
double targetPos = 1000;
|
||||
|
||||
m_leftFrontMotor.set(TalonFXControlMode.Velocity, targetPos);
|
||||
m_rightFrontMotor.set(TalonFXControlMode.Velocity, -targetPos);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user