mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Applied 80% Output Limit, Fixed PID 1/2 Distance Problem
This commit is contained in:
@@ -28,7 +28,7 @@ public class DriveStraightToPositionMM extends CommandBase {
|
||||
public DriveStraightToPositionMM(Drive subsystem, double targetPos) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
m_drive = subsystem;
|
||||
m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW;
|
||||
m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW * 2;
|
||||
addRequirements(m_drive);
|
||||
//SmartDashboard.putNumber("Distance Target Inches", targetPos);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class DriveStraightToPositionPID extends CommandBase {
|
||||
public DriveStraightToPositionPID(Drive subsystem, double targetPos) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
m_drive = subsystem;
|
||||
m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW;
|
||||
m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW * 2;
|
||||
addRequirements(m_drive);
|
||||
//SmartDashboard.putNumber("Distance Target Inches", targetPos);
|
||||
}
|
||||
|
||||
@@ -58,11 +58,18 @@ public class DriveWithJoystick extends CommandBase {
|
||||
} else {
|
||||
steerOutput = 0;
|
||||
}
|
||||
double tempOutputLimit = 0.8;
|
||||
|
||||
if (moveOutput > 0.5) {
|
||||
moveOutput = 0.5;
|
||||
} else if(moveOutput < -0.5) {
|
||||
moveOutput = -0.5;
|
||||
if (moveOutput > tempOutputLimit) {
|
||||
moveOutput = tempOutputLimit;
|
||||
} else if(moveOutput < -tempOutputLimit) {
|
||||
moveOutput = -tempOutputLimit;
|
||||
}
|
||||
|
||||
if (steerOutput > tempOutputLimit) {
|
||||
steerOutput = tempOutputLimit;
|
||||
} else if(steerOutput < -tempOutputLimit) {
|
||||
steerOutput = -tempOutputLimit;
|
||||
}
|
||||
|
||||
SmartDashboard.putNumber("Steer Output Test", moveOutput);
|
||||
|
||||
Reference in New Issue
Block a user