<commit_before>package com.techhounds.subsystems;

import com.techhounds.Robot;
import com.techhounds.RobotMap;
import com.techhounds.commands.angler.LimitCheckCommand;

import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CANTalon.TalonControlMode;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 *
 */
public class AnglerSubsystem extends Subsystem {
	
	private static AnglerSubsystem instance;
	private CANTalon angler;
	private double P = 0, I = 0, D = 0;
    
	private AnglerSubsystem() {
		angler = new CANTalon(RobotMap.Collector.COLLECTOR_ANGLER);
		LiveWindow.addActuator("Angler", "Motor", angler);
		angler.enableForwardSoftLimit(false);
		angler.enableReverseSoftLimit(false);
		angler.changeControlMode(TalonControlMode.Position);
		angler.configPotentiometerTurns(1);
		angler.setFeedbackDevice(CANTalon.FeedbackDevice.AnalogPot);
		SmartDashboard.getNumber("Angler_P", P);
		SmartDashboard.getNumber("Angler_I", I);
		SmartDashboard.getNumber("Angler_D", D);
		angler.setPID(P, I, D);
		
	}
    // Put methods for controlling this subsystem
    // here. Call these from Commands.
	public void setPosition(double position) {
		angler.changeControlMode(TalonControlMode.Position);
		P = SmartDashboard.getNumber("Angler_P", P);
		I = SmartDashboard.getNumber("Angler_I", I);
		D = SmartDashboard.getNumber("Angler_D", D);
		angler.setPID(P, I, D);
		angler.set(position);
		angler.enable();
	}
	
	public void stopPower(){
		angler.disable();
	}
	
	public void setPower(double pow){
		angler.changeControlMode(TalonControlMode.PercentVbus);
		angler.set(Robot.rangeCheck(pow));
	}
	
	public double getPosition(){
		return angler.get();
	}
	
	public void updateSmartDashboard(){
		SmartDashboard.putNumber("Angler_Position", getPosition());
	}
	
	public static AnglerSubsystem getInstance(){
		if(instance == null){
			instance = new AnglerSubsystem();
		}
		return instance;
	}

    public void initDefaultCommand() {
    	<commit_msg>minor update to AnglerSubsystem adding a rangeCheck to setPosition method<commit_after>package com.techhounds.subsystems;

import com.techhounds.Robot;
import com.techhounds.RobotMap;

import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CANTalon.TalonControlMode;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 *
 */
public class AnglerSubsystem extends Subsystem {
	
	private static AnglerSubsystem instance;
	private CANTalon angler;
	private double P = 0, I = 0, D = 0;
    
	private AnglerSubsystem() {
		angler = new CANTalon(RobotMap.Collector.COLLECTOR_ANGLER);
		LiveWindow.addActuator("Angler", "Motor", angler);
		angler.enableForwardSoftLimit(false);
		angler.enableReverseSoftLimit(false);
		angler.changeControlMode(TalonControlMode.Position);
		angler.configPotentiometerTurns(1);
		angler.setFeedbackDevice(CANTalon.FeedbackDevice.AnalogPot);
		SmartDashboard.getNumber("Angler_P", P);
		SmartDashboard.getNumber("Angler_I", I);
		SmartDashboard.getNumber("Angler_D", D);
		angler.setPID(P, I, D);
		
	}
    // Put methods for controlling this subsystem
    // here. Call these from Commands.
	public void setPosition(double position) {
		angler.changeControlMode(TalonControlMode.Position);
		P = SmartDashboard.getNumber("Angler_P", P);
		I = SmartDashboard.getNumber("Angler_I", I);
		D = SmartDashboard.getNumber("Angler_D", D);
		angler.setPID(P, I, D);
		angler.set(Robot.rangeCheck(position, 0, 1));
		angler.enable();
	}
	
	public void stopPower(){
		angler.disable();
	}
	
	public void setPower(double pow){
		angler.changeControlMode(TalonControlMode.PercentVbus);
		angler.set(Robot.rangeCheck(pow));
	}
	
	public double getPosition(){
		return angler.get();
	}
	
	public void updateSmartDashboard(){
		SmartDashboard.putNumber("Angler_Position", getPosition());
	}
	
	public static AnglerSubsystem getInstance(){
		if(instance == null){
			instance = new AnglerSubsystem();
		}
		return instance;
	}

    public void initDefaultCommand() {
    	
{'fraction_non_alphanumeric': 0.1179842369238118, 'fraction_numerical': 0.0023883448770002386, 'mean_word_length': 5.149779735682819, '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': '2007288', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1455, 'n_words': 257}