mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 08:48:01 -06:00
Change PIDs to expect robot to be in Low Gear
Eventually should be changed to be gear agnostic. Maybe have conversion factor be in drive subsytem and change depending on gear shift.
This commit is contained in:
@@ -36,10 +36,10 @@ public class DrivePositionMPAux extends CommandBase {
|
||||
public DrivePositionMPAux(Drive subsystem, double cruiseVel, double rampDist, float rampRate, double targetPos, double targetGyro) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
m_drive = subsystem;
|
||||
m_cruiseVel = cruiseVel * DriveConstants.TICKS_PER_INCH / 10;
|
||||
m_rampDist = rampDist * DriveConstants.TICKS_PER_INCH;
|
||||
m_cruiseVel = cruiseVel * DriveConstants.TICKS_PER_INCH_LOW / 10;
|
||||
m_rampDist = rampDist * DriveConstants.TICKS_PER_INCH_LOW;
|
||||
m_rampRate = (long) rampRate * 1000;
|
||||
m_targetPos = targetPos * DriveConstants.TICKS_PER_INCH;
|
||||
m_targetPos = targetPos * DriveConstants.TICKS_PER_INCH_LOW;
|
||||
//m_targetGyro = targetGyro * DriveConstants.TICKS_PER_GYRO_REV / 360;
|
||||
m_targetGyro = m_drive.m_rightFrontMotor.getSelectedSensorPosition(DriveConstants.PID_TURN);
|
||||
addRequirements(m_drive);
|
||||
@@ -82,7 +82,7 @@ public class DrivePositionMPAux extends CommandBase {
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
if (m_currentPos - m_targetPos <= 0.5f * DriveConstants.TICKS_PER_INCH) {
|
||||
if (m_currentPos - m_targetPos <= 0.5f * DriveConstants.TICKS_PER_INCH_LOW) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -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_HIGH;
|
||||
m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW;
|
||||
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_HIGH;
|
||||
m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW;
|
||||
addRequirements(m_drive);
|
||||
//SmartDashboard.putNumber("Distance Target Inches", targetPos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user