<commit_before>package org.camsrobotics.frc2016.subsystems;

import org.camsrobotics.lib.Loopable;

/**
 * Drivebase Interface
 * 
 * @author Wesley
 *
 */
public class Drive implements Loopable {
	
	
	/**
	 * Send a DriveSignal to the drivebase to control it
	 * 
	 * @author Wesley
	 *
	 */
	public class DriveSignal	{
		public double leftSpeed;
		public double rightSpeed;
		
		public DriveSignal(double leftSpeed, double rightSpeed)	{
			this.leftSpeed = leftSpeed;
			this.rightSpeed = rightSpeed;
		}
	}
	
	/**
	 * Abstract controller
	 * 
	 * @author Wesley
	 *
	 */
	public interface DriveController	{
		public DriveSignal get();
	}

	@Override
	public void update() {
		//TODO Add the motor controllers...wait for the gearbox class
	}
}<commit_msg>Finish Drive class and add first controller<commit_after>package org.camsrobotics.frc2016.subsystems;

import org.camsrobotics.lib.Gearbox;
import org.camsrobotics.lib.Loopable;

/**
 * Drivebase Interface
 * 
 * @author Wesley
 *
 */
public class Drive implements Loopable {
	
	/**
	 * Send a DriveSignal to the drivebase to control it
	 * 
	 * @author Wesley
	 *
	 */
	public static class DriveSignal	{
		public double leftSpeed;
		public double rightSpeed;
		
		public DriveSignal(double leftSpeed, double rightSpeed)	{
			this.leftSpeed = leftSpeed;
			this.rightSpeed = rightSpeed;
		}
	}
	
	/**
	 * Abstract controller
	 * 
	 * @author Wesley
	 *
	 */
	public interface DriveController	{
		public DriveSignal get();
	}

	private Gearbox m_leftGearbox;
	private Gearbox m_rightGearbox;
	
	private DriveController m_controller = null;
	private DriveSignal m_signal = null;
	
	public Drive(Gearbox leftGearbox, Gearbox rightGearbox)	{
		m_leftGearbox = leftGearbox;
		m_rightGearbox = rightGearbox;
		m_rightGearbox.setReversed();
	}
	
	public void setController(DriveController controller)	{
		m_controller = controller;
	}
	
	/**
	 * Let's drive the bot!
	 */
	@Override
	public void update() {
		if(m_controller != null)	{
			m_signal = m_controller.get();
		}
		
		if(m_signal != null)	{
			m_leftGearbox.setSpeed(m_signal.leftSpeed);
			m_rightGearbox.setSpeed(m_signal.rightSpeed);
		}	else	{
			m_leftGearbox.setSpeed(0);
			m_rightGearbox.setSpeed(0);
		}
	}
}
{'fraction_non_alphanumeric': 0.09649910233393177, 'fraction_numerical': 0.004488330341113106, 'mean_word_length': 3.567622950819672, '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': '3949134', 'n_tokens_mistral': 845, 'n_tokens_neox': 723, 'n_words': 175}