<commit_before>//=============================================================================
//File Name: OurRobot.cpp
//Description: Main robot class in which all robot sensors and devices are
//             declared
//Author: FRC Team 3512, Spartatroniks
//=============================================================================

#include <DriverStationLCD.h>
#include "OurRobot.h"

float ScaleZ( Joystick& stick) {
    return floorf( 500.f * ( 1.f - stick.GetZ() ) / 2.f ) / 500.f; // CONSTANT^-1 is step value (now 1/500)
}

DriverStationLCD* OurRobot::driverStation = DriverStationLCD::GetInstance();

OurRobot::OurRobot() :
    mainCompressor( 1 , 6 ),
    mainDrive( 3 , 4 , 1 , 2 ),
    driveStick1( 1 ),
    driveStick2( 2 ),
    turretStick( 3 ),
    upperLift( 7 ),
    lowerLift( 8 ),

    shooterMotorLeft( 7 ),
    shooterMotorRight( 6 ),
    rotateMotor( 5 ),
    pinLock( 3 ),

    hammer( 2 ),
    shifter( 1 ),

    shooterEncoder( 1 , 0x20 << 1 ),

    turretKinect( "10.35.12.192" , 5614 ) // on-board computer's IP address and port
{
    mainDrive.SetExpiration( 1.f ); // let motors run for 1 second uncontrolled before shutting them down

    shooterIsManual = true;
    isShooting = false;
    isAutoAiming = false;
}

void OurRobot::DS_PrintOut() {
    /* ===== Kinect Packet Temp Storage ===== */
    // retrieve all values needed from Kinect here to reduce lock time
    turretKinect.valueMutex.lock();

    sf::Socket::Status sOnlineStatus = turretKinect.onlineStatus;
    signed short sPixelOffset = turretKinect.pixelOffset;
    unsigned int sDistance = turretKinect.distance;

    turretKinect.valueMutex.unlock();
    /* ====================================== */

    /* ===== Print to Driver Station LCD ===== */
    driverStation->Clear();

    driverStation->Printf( DriverStationLCD::kUser_Line1 , 1 , "RPM=%f" , shooterEncoder.getRPM() );

    if ( shooterIsManual ) {
        driverStation->Printf( DriverStationLCD::kUser_Line2 , 1 , "MANUAL TargetRPM=%f" , 72.0 * ScaleZ(turretStick) * 60.0 ); // 72 = max RPS of shooter
    }<commit_msg>Reverted change to encoder declaration from yesterday<commit_after>//=============================================================================
//File Name: OurRobot.cpp
//Description: Main robot class in which all robot sensors and devices are
//             declared
//Author: FRC Team 3512, Spartatroniks
//=============================================================================

#include <DriverStationLCD.h>
#include "OurRobot.h"

float ScaleZ( Joystick& stick) {
    return floorf( 500.f * ( 1.f - stick.GetZ() ) / 2.f ) / 500.f; // CONSTANT^-1 is step value (now 1/500)
}

DriverStationLCD* OurRobot::driverStation = DriverStationLCD::GetInstance();

OurRobot::OurRobot() :
    mainCompressor( 1 , 6 ),
    mainDrive( 3 , 4 , 1 , 2 ),
    driveStick1( 1 ),
    driveStick2( 2 ),
    turretStick( 3 ),
    upperLift( 7 ),
    lowerLift( 8 ),

    shooterMotorLeft( 7 ),
    shooterMotorRight( 6 ),
    rotateMotor( 5 ),
    pinLock( 3 ),

    hammer( 2 ),
    shifter( 1 ),

    shooterEncoder( 1 , 0x20 ),

    turretKinect( "10.35.12.192" , 5614 ) // on-board computer's IP address and port
{
    mainDrive.SetExpiration( 1.f ); // let motors run for 1 second uncontrolled before shutting them down

    shooterIsManual = true;
    isShooting = false;
    isAutoAiming = false;
}

void OurRobot::DS_PrintOut() {
    /* ===== Kinect Packet Temp Storage ===== */
    // retrieve all values needed from Kinect here to reduce lock time
    turretKinect.valueMutex.lock();

    sf::Socket::Status sOnlineStatus = turretKinect.onlineStatus;
    signed short sPixelOffset = turretKinect.pixelOffset;
    unsigned int sDistance = turretKinect.distance;

    turretKinect.valueMutex.unlock();
    /* ====================================== */

    /* ===== Print to Driver Station LCD ===== */
    driverStation->Clear();

    driverStation->Printf( DriverStationLCD::kUser_Line1 , 1 , "RPM=%f" , shooterEncoder.getRPM() );

    if ( shooterIsManual ) {
        driverStation->Printf( DriverStationLCD::kUser_Line2 , 1 , "MANUAL TargetRPM=%f" , 72.0 * ScaleZ(turretStick) * 60.0 ); // 72 = max RPS of shooter
    }
{'fraction_non_alphanumeric': 0.2129783693843594, 'fraction_numerical': 0.03208937485143808, 'mean_word_length': 3.4813631522896697, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1295196', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1297, 'n_words': 335}