<commit_before>package com.snobot2016;

import com.snobot.xlib.ASnobot;

import com.snobot2016.autonomous.IPositioner;
import com.snobot2016.autonomous.Positioner;
import com.snobot2016.camera.Camera;
import com.snobot2016.drivetrain.IDriveTrain;
import com.snobot2016.drivetrain.SnobotDriveTrain;
import com.snobot2016.joystick.IDriverJoystick;
import com.snobot2016.joystick.SnobotDriverJoystick;

import edu.wpi.first.wpilibj.AnalogGyro;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.interfaces.Gyro;
import edu.wpi.first.wpilibj.vision.AxisCamera;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Snobot extends ASnobot
{
    // Drivetrain
    private SpeedController mDriveLeftMotor;
    private SpeedController mDriveRightMotor;
    private Encoder mLeftDriveEncoder;
    private Encoder mRightDriveEncoder;
    private IDriveTrain mDrivetrain;
    private IDriverJoystick mDriverJoystick;
    private Joystick mRawDriverJoystick;
    private IPositioner mSnobotPositioner;
    private Gyro mGyro;
    
    private AxisCamera mAxisCamera;
    private Camera mCamera;
    
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit()
    {
    	
    	
        // Motors
        mDriveLeftMotor = new Talon(Properties2016.sDRIVER_LEFT_MOTOR_PORT.getValue());
        mDriveRightMotor = new Talon(Properties2016.sDRIVER_RIGHT_MOTOR_PORT.getValue());

        // Digital
        mLeftDriveEncoder = new Encoder(Properties2016.sLEFT_DRIVE_ENCODER_PORT_A.getValue(), Properties2016.sLEFT_DRIVE_ENCODER_PORT_B.getValue());
        mRightDriveEncoder = new Encoder(Properties2016.sRIGHT_DRIVE_ENCODER_PORT_A.getValue(),
                Properties2016.sRIGHT_DRIVE_ENCODER_PORT_B.getValue());
        //Analog
        mGyro = new AnalogGyro(Properties2016.sGYRO_SENSOR_PORT.getValue());

        // UI
        mRawDriverJoystick = new Joystick(Properties2016.sDRIVER_JOYSTICK_PORT.getValue());

        mDriverJoystick = new SnobotDriverJoystick(mRawDriverJoystick);

        // Modules
        mDrivetrain = new SnobotDriveTrain(mDriveLeftMotor, mDriveRightMotor, mLeftDriveEncoder, mRightDriveEncoder, mDriverJoystick);
        mDrivetrain.control();
        mSubsystems.add(mDrivetrain);
        
        mSubsystems.add(mDriverJoystick);
        
    	mSnobotPositioner = new Positioner(mGyro, mDrivetrain);
    	mSubsystems.add(mSnobotPositioner);
    	
        //Camera
        mAxisCamera = new AxisCamera(Properties2016.sCAMERA_HOST_IP.getValue());
        mCamera = new Camera(mAxisCamera);

    	this.init();
    }

    /**
     * This autonomous (along with the chooser code above) shows how to select
     * between different autonomous modes using the dashboard. The sendable
     * chooser code works with the Java SmartDashboard. If you prefer the
     * LabVIEW Dashboard, remove all of the chooser code and uncomment the
     * getString line to get the auto name from the text box below the Gyro
     *
     * You can add additional auto modes by adding additional comparisons to the
     * switch structure below with additional strings. If using the
     * SendableChooser make sure to add them to the chooser code above as well.
     */
    public void autonomousInit()
    {

    }

    @Override
    public void updateLog()
    {<commit_msg>Added declaration and initialization for logger added to Snobot<commit_after>package com.snobot2016;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.snobot.xlib.ASnobot;
import com.snobot2016.autonomous.IPositioner;
import com.snobot2016.autonomous.Positioner;
import com.snobot2016.camera.Camera;
import com.snobot2016.drivetrain.IDriveTrain;
import com.snobot2016.drivetrain.SnobotDriveTrain;
import com.snobot2016.joystick.IDriverJoystick;
import com.snobot2016.joystick.SnobotDriverJoystick;
import com.snobot2016.logger.Logger;

import edu.wpi.first.wpilibj.AnalogGyro;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.interfaces.Gyro;
import edu.wpi.first.wpilibj.vision.AxisCamera;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Snobot extends ASnobot
{
    // Drivetrain
    private SpeedController mDriveLeftMotor;
    private SpeedController mDriveRightMotor;
    private Encoder mLeftDriveEncoder;
    private Encoder mRightDriveEncoder;
    private IDriveTrain mDrivetrain;
    private IDriverJoystick mDriverJoystick;
    private Joystick mRawDriverJoystick;
    private IPositioner mSnobotPositioner;
    private Gyro mGyro;
    
    private AxisCamera mAxisCamera;
    private Camera mCamera;
    private Logger mLogger;
    private SimpleDateFormat mLogDateFormat;
    
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit()
    {
    	
    	
        // Motors
        mDriveLeftMotor = new Talon(Properties2016.sDRIVER_LEFT_MOTOR_PORT.getValue());
        mDriveRightMotor = new Talon(Properties2016.sDRIVER_RIGHT_MOTOR_PORT.getValue());

        // Digital
        mLeftDriveEncoder = new Encoder(Properties2016.sLEFT_DRIVE_ENCODER_PORT_A.getValue(), Properties2016.sLEFT_DRIVE_ENCODER_PORT_B.getValue());
        mRightDriveEncoder = new Encoder(Properties2016.sRIGHT_DRIVE_ENCODER_PORT_A.getValue(),
                Properties2016.sRIGHT_DRIVE_ENCODER_PORT_B.getValue());
        //Analog
        mGyro = new AnalogGyro(Properties2016.sGYRO_SENSOR_PORT.getValue());

        // UI
        mRawDriverJoystick = new Joystick(Properties2016.sDRIVER_JOYSTICK_PORT.getValue());

        mDriverJoystick = new SnobotDriverJoystick(mRawDriverJoystick);

        // Modules
        mDrivetrain = new SnobotDriveTrain(mDriveLeftMotor, mDriveRightMotor, mLeftDriveEncoder, mRightDriveEncoder, mDriverJoystick);
        mDrivetrain.control();
        mSubsystems.add(mDrivetrain);
        
        mSubsystems.add(mDriverJoystick);
        
    	mSnobotPositioner = new Positioner(mGyro, mDrivetrain);
    	mSubsystems.add(mSnobotPositioner);
    	
        //Camera
        mAxisCamera = new AxisCamera(Properties2016.sCAMERA_HOST_IP.getValue());
        mCamera = new Camera(mAxisCamera);

        //Logger
        mLogDateFormat = new SimpleDateFormat("yyyyMMdd_hhmmssSSS");
        String headerDate = mLogDateFormat.format(new Date());
        mLogger = new Logger(headerDate);
    }

    /**
     * This autonomous (along with the chooser code above) shows how to select
     * between different autonomous modes using the dashboard. The sendable
     * chooser code works with the Java SmartDashboard. If you prefer the
     * LabVIEW Dashboard, remove all of the chooser code and uncomment the
     * getString line to get the auto name from the text box below the Gyro
     *
     * You can add additional auto modes by adding additional comparisons to the
     * switch structure below with additional strings. If using the
     * SendableChooser make sure to add them to the chooser code above as well.
     */
    public void autonomousInit()
    {

    }

    @Override
    public void updateLog()
    {
{'fraction_non_alphanumeric': 0.06925485284909205, 'fraction_numerical': 0.017532874139010644, 'mean_word_length': 3.522083805209513, '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': '2553842', 'n_tokens_mistral': 2640, 'n_tokens_neox': 2387, 'n_words': 614}