src/main/cpp/subsystems/DriveTrainSubsystemBase.cpp
void DriveTrainSubsystemBase::TurnInDegrees(double relativeAngle, double speed, double turnRadius)
{
    //This is Regular
    ResetEncoder();
    double startDistance = GetLeftEncoderInch();
    double currentDistanceLeft = GetLeftEncoderInch();
    double inch = Util::Abs(relativeAngle)*(Util::PI/180)*turnRadius;
    while (Util::Abs(currentDistanceLeft - startDistance) < inch )
    {
        if(relativeAngle < 0)
        {
            TurnLeft(speed);
        }
        else
        {
            TurnRight(speed);
        }
        currentDistanceLeft = GetLeftEncoderInch();
        frc::SmartDashboard::PutNumber("LeftEncoderInches", GetLeftEncoderInch());
        Util::Log("DriveTrainSubsystemBase: TurnInDegrees: current", currentDistanceLeft);
        Util::Log("DriveTrainSubsystemBase: TurnInDegrees: start", startDistance);
        Util::Log("DriveTrainSubsystemBase: TurnInDegrees: inch", inch);
    }
    Stop();
}
//Used to turn the robot a certain amount of degrees(RelativeAngle is user's wanted angle)
Used to turn the robot a certain amount of degrees(RelativeAngle is user's wanted angle)
Used to turn the robot a certain amount of degrees ( RelativeAngle is user ' s wanted angle )
void DriveTrainSubsystemBase::TurnInDegrees(double relativeAngle, double speed, double turnRadius)
{
    ResetEncoder();
    double startDistance = GetLeftEncoderInch();
    double currentDistanceLeft = GetLeftEncoderInch();
    double inch = Util::Abs(relativeAngle)*(Util::PI/180)*turnRadius;
    while (Util::Abs(currentDistanceLeft - startDistance) < inch )
    {
        if(relativeAngle < 0)
        {
            TurnLeft(speed);
        }
        else
        {
            TurnRight(speed);
        }
        currentDistanceLeft = GetLeftEncoderInch();
        frc::SmartDashboard::PutNumber("LeftEncoderInches", GetLeftEncoderInch());
        Util::Log("DriveTrainSubsystemBase: TurnInDegrees: current", currentDistanceLeft);
        Util::Log("DriveTrainSubsystemBase: TurnInDegrees: start", startDistance);
        Util::Log("DriveTrainSubsystemBase: TurnInDegrees: inch", inch);
    }
    Stop();
}
void DriveTrainSubsystemBase :: TurnInDegrees ( double relativeAngle , double speed , double turnRadius ) { ResetEncoder ( ) ; double startDistance = GetLeftEncoderInch ( ) ; double currentDistanceLeft = GetLeftEncoderInch ( ) ; double inch = Util :: Abs ( relativeAngle ) * ( Util :: PI / 180 ) * turnRadius ; while ( Util :: Abs ( currentDistanceLeft - startDistance ) < inch ) { if ( relativeAngle < 0 ) { TurnLeft ( speed ) ; } else { TurnRight ( speed ) ; } currentDistanceLeft = GetLeftEncoderInch ( ) ; frc :: SmartDashboard :: PutNumber ( " " , GetLeftEncoderInch ( ) ) ; Util :: Log ( " " , currentDistanceLeft ) ; Util :: Log ( " " , startDistance ) ; Util :: Log ( " " , inch ) ; } Stop ( ) ; }
Used to turn the robot a certain amount of degrees(RelativeAngle is user's wanted angle)
Used to turn the robot a certain amount of degrees ( RelativeAngle is user ' s wanted angle )
//This is Regular