<commit_before>#include "Robot.hpp"
#include <cmath>

Robot::Robot() :
        settings( "RobotSettings.txt" ),
        drive1Buttons( 1 ),
        drive2Buttons( 2 ),
        shootButtons( 3 ),
        pidGraph( 3513 ) {
    robotDrive = new DriveTrain();
    claw = new Claw( 7 , 8, 2);

    driveStick1 = new Joystick (1);
    driveStick2 = new Joystick (2);
    shootStick = new Joystick (3);

    mainCompressor = new Compressor (1,1);
    autonTimer = new Timer ();
    displayTimer = new Timer ();

    kinect = new RobotKinect();
    //robotPosition = new RobotPosition(1,2,3,4);

    driverStation = DriverStationDisplay<Robot>::getInstance( atoi( settings.getValueFor( "DS_Port" ).c_str() ) );

    driverStation->addAutonMethod( "Right/Left Autonomous" , &Robot::RightLeftAuton , this);
    driverStation->addAutonMethod( "MotionProfile" , &Robot::AutonMotionProfile , this );

    pidGraph.resetTime();
    pidGraph.setSendInterval( 200 );

    insight = Insight::getInstance( atoi( settings.getValueFor( "Insight_Port" ).c_str() ) );

    logger1 = new Logger ();
    ls = new LogStream(logger1);
    logFileSink = new LogFileSink("LogFile.txt");
    logServerSink = new LogServerSink();
    logger1 ->addLogSink(logFileSink);
    logger1->addLogSink(logServerSink);
    logFileSink->setVerbosityLevels(LogEvent::VERBOSE_ALL);
    logServerSink->setVerbosityLevels(LogEvent::VERBOSE_ALL);
    logServerSink->startServer (4097);
    displayTimer->Start();
}

Robot::~Robot(){
    delete robotDrive;
    delete claw;

    delete driveStick1;
    delete driveStick2;
    delete shootStick;

    delete mainCompressor;

    delete autonTimer;
    delete displayTimer;

    delete kinect;

    delete logger1;
    delete ls;
    delete logFileSink;
    delete logServerSink;
}
void Robot::calibrateTalons() {
	robotDrive->drive(1,0);
	Wait (3.0);
	robotDrive->drive(0,0);
	Wait (3.0);
	robotDrive->drive(-1,0);
	Wait (3.0);
	robotDrive->drive(0,0);
	Wait (3.0);
}
void Robot::OperatorControl() {
    mainCompressor->Start();
    claw->ManualSetAngle(0);
    //robotPosition->zeroValues();
    while (IsOperatorControl() && IsEnabled()){
        //Kinect Drive
        //robotDrive->setLeftManual( kinect->GetArmScale().second );
        //robotDrive->setRightManual( kinect->GetArmScale().first );

    	DS_PrintOut();

        //arcade Drive
        robotDrive->drive( driveStick1->GetY() , driveStick2->GetZ(), 0.917 , 1);

        if ( drive1Buttons.releasedButton( 1 ) ) {
            robotDrive->setGear( !robotDrive->getGear() );
        }

        //Shoots Ball
        if ((shootStick->GetRawButton(1) || driveStick2->GetRawButton(1))&& !claw->IsShooting()){
            claw->Shoot();
        }

        //Engage collector
        if( shootButtons.releasedButton(2)) {
        	claw->SetCollectorMode(!claw->GetCollectorMode());
        }

        if (shootStick->GetRawButton(3))
        {
        	claw->SetWheelManual(-1);

        }
        else if (shootStick->GetRawButton(4))
        {
        	claw->SetWheelManual(1);
        }
        else
        {
        	claw->SetWheelManual(0);
        }

        if(shootButtons.pressedButton(7))
        {
        	claw->SetAngle(175);

        }
        else if(shootButtons.pressedButton(9))
        {
        	claw->SetAngle(88);

        }
        else if(shootButtons.pressedButton(11))
        {
        	claw->SetAngle(0);

        }
        else if(shootButtons.pressedButton(10))
        {
        	claw->SetAngle(claw->GetTargetAngle()+3.0f);

        }
        else if(shootButtons.pressedButton(12))
        {
        	claw->SetAngle(claw->GetTargetAngle()-3.0f);
<commit_msg>Changed shooting angle to 103<commit_after>#include "Robot.hpp"
#include <cmath>

Robot::Robot() :
        settings( "RobotSettings.txt" ),
        drive1Buttons( 1 ),
        drive2Buttons( 2 ),
        shootButtons( 3 ),
        pidGraph( 3513 ) {
    robotDrive = new DriveTrain();
    claw = new Claw( 7 , 8, 2);

    driveStick1 = new Joystick (1);
    driveStick2 = new Joystick (2);
    shootStick = new Joystick (3);

    mainCompressor = new Compressor (1,1);
    autonTimer = new Timer ();
    displayTimer = new Timer ();

    kinect = new RobotKinect();
    //robotPosition = new RobotPosition(1,2,3,4);

    driverStation = DriverStationDisplay<Robot>::getInstance( atoi( settings.getValueFor( "DS_Port" ).c_str() ) );

    driverStation->addAutonMethod( "Right/Left Autonomous" , &Robot::RightLeftAuton , this);
    driverStation->addAutonMethod( "MotionProfile" , &Robot::AutonMotionProfile , this );

    pidGraph.resetTime();
    pidGraph.setSendInterval( 200 );

    insight = Insight::getInstance( atoi( settings.getValueFor( "Insight_Port" ).c_str() ) );

    logger1 = new Logger ();
    ls = new LogStream(logger1);
    logFileSink = new LogFileSink("LogFile.txt");
    logServerSink = new LogServerSink();
    logger1 ->addLogSink(logFileSink);
    logger1->addLogSink(logServerSink);
    logFileSink->setVerbosityLevels(LogEvent::VERBOSE_ALL);
    logServerSink->setVerbosityLevels(LogEvent::VERBOSE_ALL);
    logServerSink->startServer (4097);
    displayTimer->Start();
}

Robot::~Robot(){
    delete robotDrive;
    delete claw;

    delete driveStick1;
    delete driveStick2;
    delete shootStick;

    delete mainCompressor;

    delete autonTimer;
    delete displayTimer;

    delete kinect;

    delete logger1;
    delete ls;
    delete logFileSink;
    delete logServerSink;
}
void Robot::calibrateTalons() {
	robotDrive->drive(1,0);
	Wait (3.0);
	robotDrive->drive(0,0);
	Wait (3.0);
	robotDrive->drive(-1,0);
	Wait (3.0);
	robotDrive->drive(0,0);
	Wait (3.0);
}
void Robot::OperatorControl() {
    mainCompressor->Start();
    claw->ManualSetAngle(0);
    //robotPosition->zeroValues();
    while (IsOperatorControl() && IsEnabled()){
        //Kinect Drive
        //robotDrive->setLeftManual( kinect->GetArmScale().second );
        //robotDrive->setRightManual( kinect->GetArmScale().first );

    	DS_PrintOut();

        //arcade Drive
        robotDrive->drive( driveStick1->GetY() , driveStick2->GetZ(), 0.917 , 1);

        if ( drive1Buttons.releasedButton( 1 ) ) {
            robotDrive->setGear( !robotDrive->getGear() );
        }

        //Shoots Ball
        if ((shootStick->GetRawButton(1) || driveStick2->GetRawButton(1))&& !claw->IsShooting()){
            claw->Shoot();
        }

        //Engage collector
        if( shootButtons.releasedButton(2)) {
        	claw->SetCollectorMode(!claw->GetCollectorMode());
        }

        if (shootStick->GetRawButton(3))
        {
        	claw->SetWheelManual(-1);

        }
        else if (shootStick->GetRawButton(4))
        {
        	claw->SetWheelManual(1);
        }
        else
        {
        	claw->SetWheelManual(0);
        }

        if(shootButtons.pressedButton(7))
        {
        	claw->SetAngle(175);

        }
        else if(shootButtons.pressedButton(9))
        {
        	claw->SetAngle(103);

        }
        else if(shootButtons.pressedButton(11))
        {
        	claw->SetAngle(0);

        }
        else if(shootButtons.pressedButton(10))
        {
        	claw->SetAngle(claw->GetTargetAngle()+3.0f);

        }
        else if(shootButtons.pressedButton(12))
        {
        	claw->SetAngle(claw->GetTargetAngle()-3.0f);

{'fraction_non_alphanumeric': 0.141629144494474, 'fraction_numerical': 0.02510574430345204, 'mean_word_length': 2.6449527598209848, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 91, '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': '3764650', 'n_tokens_mistral': 2607, 'n_tokens_neox': 2476, 'n_words': 402}