<commit_before>package org.texastorque.texastorque2015.subsystem;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.texastorque.texastorque2015.constants.Constants;
import org.texastorque.torquelib.controlLoop.TorquePID;

public class Arms extends Subsystem {

    public static double UP = 0.0;
    public static double HORIZONTAL = 0.0;
    public static double DOWN = 0.0;

    //Solenoid states
    private boolean armsOpen;
    private boolean punchOut;

    //pid
    private double setPointAngle;

    private double leftAngle;
    private double leftMotorSpeed;
    private TorquePID leftPID;

    private double rightAngle;
    private double rightMotorSpeed;
    private TorquePID rightPID;

    public Arms() {
        leftPID = new TorquePID();
        rightPID = new TorquePID();
    }

    @Override
    public void init() {
    }

    @Override
    public void run() {
        armsOpen = input.isArmOpen();
        punchOut = input.isPunchOut();

        leftAngle = feedback.getLeftTiltAngle();
        rightAngle = feedback.getRightTiltAngle();

        if (!input.isOverride()) {

            setPointAngle = input.getTiltAngle();

            leftPID.setSetpoint(setPointAngle);
            rightPID.setSetpoint(setPointAngle);

            leftMotorSpeed = leftPID.calculate(leftAngle);
            rightMotorSpeed = rightPID.calculate(rightAngle);
        } else {
            leftMotorSpeed = input.getTiltOverrideMotorSpeed();
            rightMotorSpeed = input.getTiltOverrideMotorSpeed();
        }

        if (outputEnabled) {
            output.setArmsOpen(armsOpen);
            output.setPunchOut(punchOut);
            output.setTiltMotorSpeeds(leftMotorSpeed, rightMotorSpeed);
        }
    }

    @Override
    public void loadParams() {
        UP = Constants.TiltUpAngle.getDouble();<commit_msg>Change arm pid to keep the two sides level<commit_after>package org.texastorque.texastorque2015.subsystem;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.texastorque.texastorque2015.constants.Constants;
import org.texastorque.torquelib.controlLoop.TorquePID;

public class Arms extends Subsystem {

    public static double UP = 0.0;
    public static double HORIZONTAL = 0.0;
    public static double DOWN = 0.0;

    //Solenoid states
    private boolean armsOpen;
    private boolean punchOut;

    //pid
    private double setPointAngle;

    private double leftAngle;
    private double leftMotorSpeed;
    private TorquePID leftPID;

    private double rightAngle;
    private double rightMotorSpeed;
    private TorquePID rightPID;

    public Arms() {
        //Limit motor output on the left arm so that the right arm will not get behind.
        leftPID = new TorquePID();
        leftPID.setMaxOutput(0.8);
        
        rightPID = new TorquePID();
        rightPID.setMaxOutput(1.0);
    }

    @Override
    public void init() {
    }

    @Override
    public void run() {
        armsOpen = input.isArmOpen();
        punchOut = input.isPunchOut();

        //Get the current angles from the Potentiometers.
        leftAngle = feedback.getLeftTiltAngle();
        rightAngle = feedback.getRightTiltAngle();

        if (!input.isOverride()) {
            //The angle we want to arms to go to.
            setPointAngle = input.getTiltAngle();

            //Set the left arm to go to the desired angle, and the right arm to follow it.
            //This should keep the two sides level with each other.
            leftPID.setSetpoint(setPointAngle);
            rightPID.setSetpoint(leftAngle);

            leftMotorSpeed = leftPID.calculate(leftAngle);
            rightMotorSpeed = rightPID.calculate(rightAngle);
        } else {
            leftMotorSpeed = input.getTiltOverrideMotorSpeed();
            rightMotorSpeed = input.getTiltOverrideMotorSpeed();
        }

        if (outputEnabled) {
            output.setArmsOpen(armsOpen);
            output.setPunchOut(punchOut);
            output.setTiltMotorSpeeds(leftMotorSpeed, rightMotorSpeed);
        }
    }

    @Override
    public void loadParams() {
        UP = Constants.TiltUpAngle.getDouble();
{'fraction_non_alphanumeric': 0.08207343412526998, 'fraction_numerical': 0.007679385649148068, 'mean_word_length': 2.5412064570943076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '412975', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1183, 'n_words': 286}