<commit_before>package org.usfirst.frc4915.MecanumDrive;

import edu.wpi.first.wpilibj.BuiltInAccelerometer;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CANTalon.ControlMode;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Ultrasonic;


/**
 * The RobotMap is a mapping from the ports sensors and actuators are wired into
 * to a variable name. This provides flexibility changing wiring, makes checking
 * the wiring easier and significantly reduces the number of magic numbers
 * floating around.
 */
public class RobotMap {

	/*
	 * CONSTANTS
	 */

	public static final int MOTOR_PORT_LEFT_FRONT = 10;
	public static final int MOTOR_PORT_LEFT_REAR = 11;
	public static final int MOTOR_PORT_RIGHT_FRONT = 12;
	public static final int MOTOR_PORT_RIGHT_REAR = 13;
	
	public static final int MOTOR_PORT_ELEVATOR_WINCH = 14;
	
	/*
	 * The Pneumatic Control Module's CAN Node ID. Use 10 for 4915. Use 20 for 9999
	 */
	
	public final static int PCM_NODE_ID = 10;
	
	public final static int GYRO_PORT = 0;
	
	public final static int ULTRASONIC_PORT_FIRST = 0;
	public final static int ULTRASONIC_PORT_SECOND = 1;
	
	public final static int SOLENOID_CHANNEL_PRIMARY = 0;
	public final static int SOLENOID_CHANNEL_SECONDARY = 1;
	
	//public final static int SOLENOID_CHANNEL_AUNTIE = 3;
	
	/*
	 * DRIVETRAIN
	 */
	public static CANTalon mecanumDriveControlsLeftFront;
	public static CANTalon mecanumDriveControlsLeftRear;
	public static CANTalon mecanumDriveControlsRightFront;
	public static CANTalon mecanumDriveControlsRightRear;
	public static RobotDrive driveTrainRobotDrive;
	// TODO explain the reason for this number
	public static final double DEFAULT_MAX_OUTPUT = 950;

	/*
	 * Gyroscope
	 */
	public static Gyro gyro;

	/* 
	 * Distance Sensor
	 */
	public static Ultrasonic distanceSensor;

	/*
	 * ELEVATOR
	 */
	public static CANTalon elevatorWinchMotor;
	private static final int FWD_SOFT_LIMIT = 1023;
	private static final int REV_SOFT_LIMIT = 0;
	public static DigitalInput bottomLimitSwitch;

	/*
	 * GRABBER
	 */
	public static Solenoid primarySolenoid;
	public static Solenoid secondarySolenoid;
	
	/*
	 * GENERAL SENSORS
	 */
	public static BuiltInAccelerometer accelerometer;

	public static void init() {

		/*
		 * MECANUM WHEEL START
		 */
		mecanumDriveControlsLeftFront = new CANTalon(MOTOR_PORT_LEFT_FRONT);
		mecanumDriveControlsLeftRear = new CANTalon(MOTOR_PORT_LEFT_REAR);
		mecanumDriveControlsRightFront = new CANTalon(MOTOR_PORT_RIGHT_FRONT);
		mecanumDriveControlsRightRear = new CANTalon(MOTOR_PORT_RIGHT_REAR);

		changeControlMode(ControlMode.Speed);

		driveTrainRobotDrive = new RobotDrive(mecanumDriveControlsLeftFront, mecanumDriveControlsLeftRear, mecanumDriveControlsRightFront, mecanumDriveControlsRightRear);
		// Sets the max output to ???, 10ft per 1 secf -- After testing, we have
		// decided to go with 950.
		driveTrainRobotDrive.setMaxOutput(DEFAULT_MAX_OUTPUT);

		driveTrainRobotDrive.setSafetyEnabled(true);
		driveTrainRobotDrive.setExpiration(0.1);
		driveTrainRobotDrive.setSensitivity(0.5);

		driveTrainRobotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
		driveTrainRobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);

		/*
		 * Gyro instantiation
		 */
		gyro = new Gyro(GYRO_PORT);

		/*
		 * Distance instantiation -- UNUSED
		 */
		// distanceSensor = new Ultrasonic(ULTRASONIC_PORT_FIRST, ULTRASONIC_PORT_SECOND);

		/*
		 * MECANUM WHEEL END
		 */

		/*
		 * ELEVATOR START
		 */
		// ELEVATOR instantiation
		elevatorWinchMotor = new CANTalon(MOTOR_PORT_ELEVATOR_WINCH);
		elevatorWinchMotor.changeControlMode(ControlMode.Position);
		elevatorWinchMotor.setFeedbackDevice(CANTalon.FeedbackDevice.AnalogPot);
		elevatorWinchMotor.setPID(15, .01, 0.001, 0.0001, 25, 1, 0); //Values we determined after the gearbox was lubricated
		elevatorWinchMotor.setForwardSoftLimit(FWD_SOFT_LIMIT); // The absolute maximum height that the elevator can be
		elevatorWinchMotor.setReverseSoftLimit(REV_SOFT_LIMIT); // The greater minimum height that the elevator can be
		elevatorWinchMotor.enableForwardSoftLimit(true);
		elevatorWinchMotor.enableReverseSoftLimit(true);
		elevatorWinchMotor.ConfigFwdLimitSwitchNormallyOpen(true);
		elevatorWinchMotor.ConfigRevLimitSwitchNormallyOpen(true);
		elevatorWinchMotor.enableBrakeMode(true);

		bottomLimitSwitch = new DigitalInput(5);
		
		/*
		 * ELEVATOR END
		 */
<commit_msg>Uncommented the distanceSensor (still unused)<commit_after>package org.usfirst.frc4915.MecanumDrive;

import edu.wpi.first.wpilibj.BuiltInAccelerometer;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CANTalon.ControlMode;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Ultrasonic;


/**
 * The RobotMap is a mapping from the ports sensors and actuators are wired into
 * to a variable name. This provides flexibility changing wiring, makes checking
 * the wiring easier and significantly reduces the number of magic numbers
 * floating around.
 */
public class RobotMap {

	/*
	 * CONSTANTS
	 */

	public static final int MOTOR_PORT_LEFT_FRONT = 10;
	public static final int MOTOR_PORT_LEFT_REAR = 11;
	public static final int MOTOR_PORT_RIGHT_FRONT = 12;
	public static final int MOTOR_PORT_RIGHT_REAR = 13;
	
	public static final int MOTOR_PORT_ELEVATOR_WINCH = 14;
	
	/*
	 * The Pneumatic Control Module's CAN Node ID. Use 10 for 4915. Use 20 for 9999
	 */
	
	public final static int PCM_NODE_ID = 10;
	
	public final static int GYRO_PORT = 0;
	
	public final static int ULTRASONIC_PORT_FIRST = 0;
	public final static int ULTRASONIC_PORT_SECOND = 1;
	
	public final static int SOLENOID_CHANNEL_PRIMARY = 0;
	public final static int SOLENOID_CHANNEL_SECONDARY = 1;
	
	//public final static int SOLENOID_CHANNEL_AUNTIE = 3;
	
	/*
	 * DRIVETRAIN
	 */
	public static CANTalon mecanumDriveControlsLeftFront;
	public static CANTalon mecanumDriveControlsLeftRear;
	public static CANTalon mecanumDriveControlsRightFront;
	public static CANTalon mecanumDriveControlsRightRear;
	public static RobotDrive driveTrainRobotDrive;
	// TODO explain the reason for this number
	public static final double DEFAULT_MAX_OUTPUT = 950;

	/*
	 * Gyroscope
	 */
	public static Gyro gyro;

	/* 
	 * Distance Sensor
	 */
	public static Ultrasonic distanceSensor;

	/*
	 * ELEVATOR
	 */
	public static CANTalon elevatorWinchMotor;
	private static final int FWD_SOFT_LIMIT = 1023;
	private static final int REV_SOFT_LIMIT = 0;
	public static DigitalInput bottomLimitSwitch;

	/*
	 * GRABBER
	 */
	public static Solenoid primarySolenoid;
	public static Solenoid secondarySolenoid;
	
	/*
	 * GENERAL SENSORS
	 */
	public static BuiltInAccelerometer accelerometer;

	public static void init() {

		/*
		 * MECANUM WHEEL START
		 */
		mecanumDriveControlsLeftFront = new CANTalon(MOTOR_PORT_LEFT_FRONT);
		mecanumDriveControlsLeftRear = new CANTalon(MOTOR_PORT_LEFT_REAR);
		mecanumDriveControlsRightFront = new CANTalon(MOTOR_PORT_RIGHT_FRONT);
		mecanumDriveControlsRightRear = new CANTalon(MOTOR_PORT_RIGHT_REAR);

		changeControlMode(ControlMode.Speed);

		driveTrainRobotDrive = new RobotDrive(mecanumDriveControlsLeftFront, mecanumDriveControlsLeftRear, mecanumDriveControlsRightFront, mecanumDriveControlsRightRear);
		// Sets the max output to ???, 10ft per 1 secf -- After testing, we have
		// decided to go with 950.
		driveTrainRobotDrive.setMaxOutput(DEFAULT_MAX_OUTPUT);

		driveTrainRobotDrive.setSafetyEnabled(true);
		driveTrainRobotDrive.setExpiration(0.1);
		driveTrainRobotDrive.setSensitivity(0.5);

		driveTrainRobotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
		driveTrainRobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);

		/*
		 * Gyro instantiation
		 */
		gyro = new Gyro(GYRO_PORT);

		/*
		 * Distance instantiation -- UNUSED
		 */
		distanceSensor = new Ultrasonic(ULTRASONIC_PORT_FIRST, ULTRASONIC_PORT_SECOND);

		/*
		 * MECANUM WHEEL END
		 */

		/*
		 * ELEVATOR START
		 */
		// ELEVATOR instantiation
		elevatorWinchMotor = new CANTalon(MOTOR_PORT_ELEVATOR_WINCH);
		elevatorWinchMotor.changeControlMode(ControlMode.Position);
		elevatorWinchMotor.setFeedbackDevice(CANTalon.FeedbackDevice.AnalogPot);
		elevatorWinchMotor.setPID(15, .01, 0.001, 0.0001, 25, 1, 0); //Values we determined after the gearbox was lubricated
		elevatorWinchMotor.setForwardSoftLimit(FWD_SOFT_LIMIT); // The absolute maximum height that the elevator can be
		elevatorWinchMotor.setReverseSoftLimit(REV_SOFT_LIMIT); // The greater minimum height that the elevator can be
		elevatorWinchMotor.enableForwardSoftLimit(true);
		elevatorWinchMotor.enableReverseSoftLimit(true);
		elevatorWinchMotor.ConfigFwdLimitSwitchNormallyOpen(true);
		elevatorWinchMotor.ConfigRevLimitSwitchNormallyOpen(true);
		elevatorWinchMotor.enableBrakeMode(true);

		bottomLimitSwitch = new DigitalInput(5);
		
		/*
		 * ELEVATOR END
		 */

{'fraction_non_alphanumeric': 0.07392372609763914, 'fraction_numerical': 0.014955667129580174, 'mean_word_length': 4.917825537294564, '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': '831315', 'n_tokens_mistral': 3672, 'n_tokens_neox': 3142, 'n_words': 710}