<commit_before>/*
 * Copyright (c) 2015 Titan Robotics Club (http://www.titanrobotics.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package team492;

import edu.wpi.first.wpilibj.SerialPort;
import frclib.FrcPixyCam;

public class RobotInfo
{
    //
    // Compiler switches
    //

    //
    // Field dimensions in inches.
    //
    public static final double FIELD_LENGTH                     = 54*12.0;
    public static final double FIELD_WIDTH                      = 27*12.0;
    public static final double FIELD_BASELINE_DISTANCE          = 93.3;
    public static final double FIELD_LAUNCHPAD_DISTANCE         = 185.3;
    public static final double FIELD_NEUTRAL_ZONE_LENGTH        = FIELD_LENGTH - FIELD_LAUNCHPAD_DISTANCE*2.0;
    public static final double FIELD_SIDELIFT_ANGLE             = 60.0;     //in degrees
    public static final double FIELD_AIRSHIP_PANEL_WIDTH        = 40.755;   //70.59/2/sin(60)

    //
    // Robot dimensions.
    //
    public static final double ROBOT_LENGTH                     = 38.0;
    public static final double ROBOT_WIDTH                      = 35.0;
    public static final double ROBOT_HEIGHT                     = 24.0;

    //
    // Joystick ports.
    //
    public static final int JSPORT_LEFT_DRIVESTICK              = 0;
    public static final int JSPORT_RIGHT_DRIVESTICK             = 1;
    public static final int JSPORT_OPERATORSTICK                = 2;

    //
    // Analog Input ports.
    //
    public static final int AIN_PRESSURE_SENSOR                 = 0;
    public static final int AIN_ULTRASONIC_SENSOR               = 3;
    //
    // Digital Input ports.
    //
    public static final int DIN_GEAR_SENSOR                     = 0;

    //
    // CAN IDs.
    //
    public static final int CANID_LEFTFRONTWHEEL                = 3;    // 40A: Orange
    public static final int CANID_RIGHTFRONTWHEEL               = 4;    // 40A: Yellow
    public static final int CANID_LEFTREARWHEEL                 = 5;    // 40A: Green
    public static final int CANID_RIGHTREARWHEEL                = 6;    // 40A: Blue
    public static final int CANID_WINCH                         = 7;    // 40A: Purple
    public static final int CANID_SPARE                         = 8;    // 40A: Gray

    public static final int CANID_PDP                           = 16;
    public static final int CANID_PCM1                          = 17;
    public static final int CANID_PCM2                          = 18;

    //
    // Relay channels.
    //
    public static final int RELAY_RINGLIGHT_POWER               = 0;    // 20A: White
    public static final int RELAY_FLASHLIGHT_POWER              = 1;    // 20A: Yellow

    //
    // Solenoid channels.
    //
    public static final int SOL_GEARPICKUP_CLAW_RETRACT         = 0;
    public static final int SOL_GEARPICKUP_CLAW_EXTEND          = 1;
    public static final int SOL_GEARPICKUP_ARM_RETRACT          = 2;
    public static final int SOL_GEARPICKUP_ARM_EXTEND           = 3;
    public static final int SOL_MAILBOX_RETRACT                 = 4;
    public static final int SOL_MAILBOX_EXTEND                  = 5;
    public static final int SOL_TARGET_FOUND_LED                = 6;    // White LED
    public static final int SOL_TARGET_ALIGNED_LED              = 7;    // Blue LED

    //
    // Miscellaneous sensors and devices.
    //
    public static final int CAM_WIDTH                           = 320;
    public static final int CAM_HEIGHT                          = 240;
    public static final int CAM_FRAME_RATE                      = 15;
    public static final int CAM_BRIGHTNESS                      = 20;

    //
    // DriveBase subsystem.
    //

    // 2017-02-21: 0.0091442577063687, 0.17, 0.0, 0.0
    // 2017-03-21: 0.0152347136491642, 0.15, 0.0, 0.0
    public static final double ENCODER_X_INCHES_PER_COUNT       = 0.0152347136491642;
    public static final double ENCODER_X_KP                     = 0.15;
    public static final double ENCODER_X_KI                     = 0.0;
    public static final double ENCODER_X_KD                     = 0.0;
    public static final double ENCODER_X_KF                     = 0.0;
    public static final double ENCODER_X_TOLERANCE              = 1.0;
    public static final double ENCODER_X_SETTLING               = 0.2;

    // 2017-02-21: 0.0159419007257628, 0.03, 0.0, 0.007
    // 2017-03-07: 0.0159419007257628, 0.05, 0.0, 0.007
    // 2017-03-08: 0.0159419007257628, 0.06, 0.0, 0.007
    // 2017-03-12: 0.0159419007257628, 0.03, 0.0, 0.0005
    // 2017-03-14: 0.0159419007257628, 0.03, 0.0, 0.005
    // 2017-03-21: 0.0171280999395813, 0.035, 0.0, 0.008
    // 2017-03-30: 0.01778656, 0.035, 0.0, 0.008
    public static final double ENCODER_Y_INCHES_PER_COUNT       = 0.01778656;
    public static final double ENCODER_Y_KP                     = 0.035;
    public static final double ENCODER_Y_KI                     = 0.0;
    public static final double ENCODER_Y_KD                     = 0.008;
    public static final double ENCODER_Y_KF                     = 0.0;
    public static final double ENCODER_Y_TOLERANCE              = 1.0;
    public static final double ENCODER_Y_SETTLING               = 0.2;

    // 2017-03-05: 0.15, 0.0, 0.01
    // 2017-03-07: 0.15, 0.0, 0.02
    // 2017-03-08: 0.1, 0.0, 0.007
    // 2017-03-12: 0.065, 0.0, 0.005/0.2, 0.0, 0.0
    // 2017-03-14: 0.065, 0.0, 0.005/0.08, 0.0, 0.0001
    // 2017-03-21: 0.065, 0.0, 0.005/0.06, 0.0, 0.0018 (Competition Robot)
    public static final double GYRO_TURN_KP                     = 0.065;
    public static final double GYRO_TURN_KI                     = 0.0;
    public static final double GYRO_TURN_KD                     = 0.005;
    public static final double GYRO_TURN_KF                     = 0.0;
    public static final double GYRO_TURN_TOLERANCE              = 2.0;
    public static final double GYRO_TURN_SETTLING               = 0.2;
    public static final double GYRO_TURN_SMALL_THRESHOLD        = 10.0;
    public static final double GYRO_TURN_SMALL_KP               = 0.06;
    public static final double GYRO_TURN_SMALL_KI               = 0.0;
    public static final double GYRO_TURN_SMALL_KD               = 0.0018;

    public static final double DRIVE_STALL_TIMEOUT              = 0.5;
    public static final double DRIVE_SLOW_XSCALE                = 3.0;
    public static final double DRIVE_SLOW_YSCALE                = 3.0;
    public static final double DRIVE_SLOW_TURNSCALE             = 3.0;

    // 2017-03-12: 0.01, 0.0, 0.0
    // 2017-03-14: 0.0165, 0.0, 0.002
    public static final double SONAR_KP                         = 0.0165;
    public static final double SONAR_KI                         = 0.0;
    public static final double SONAR_KD                         = 0.002;
    public static final double SONAR_KF                         = 0.0;<commit_msg>Tuned PID during final competition!<commit_after>/*
 * Copyright (c) 2015 Titan Robotics Club (http://www.titanrobotics.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package team492;

import edu.wpi.first.wpilibj.SerialPort;
import frclib.FrcPixyCam;

public class RobotInfo
{
    //
    // Compiler switches
    //

    //
    // Field dimensions in inches.
    //
    public static final double FIELD_LENGTH                     = 54*12.0;
    public static final double FIELD_WIDTH                      = 27*12.0;
    public static final double FIELD_BASELINE_DISTANCE          = 93.3;
    public static final double FIELD_LAUNCHPAD_DISTANCE         = 185.3;
    public static final double FIELD_NEUTRAL_ZONE_LENGTH        = FIELD_LENGTH - FIELD_LAUNCHPAD_DISTANCE*2.0;
    public static final double FIELD_SIDELIFT_ANGLE             = 60.0;     //in degrees
    public static final double FIELD_AIRSHIP_PANEL_WIDTH        = 40.755;   //70.59/2/sin(60)

    //
    // Robot dimensions.
    //
    public static final double ROBOT_LENGTH                     = 38.0;
    public static final double ROBOT_WIDTH                      = 35.0;
    public static final double ROBOT_HEIGHT                     = 24.0;

    //
    // Joystick ports.
    //
    public static final int JSPORT_LEFT_DRIVESTICK              = 0;
    public static final int JSPORT_RIGHT_DRIVESTICK             = 1;
    public static final int JSPORT_OPERATORSTICK                = 2;

    //
    // Analog Input ports.
    //
    public static final int AIN_PRESSURE_SENSOR                 = 0;
    public static final int AIN_ULTRASONIC_SENSOR               = 3;
    //
    // Digital Input ports.
    //
    public static final int DIN_GEAR_SENSOR                     = 0;

    //
    // CAN IDs.
    //
    public static final int CANID_LEFTFRONTWHEEL                = 3;    // 40A: Orange
    public static final int CANID_RIGHTFRONTWHEEL               = 4;    // 40A: Yellow
    public static final int CANID_LEFTREARWHEEL                 = 5;    // 40A: Green
    public static final int CANID_RIGHTREARWHEEL                = 6;    // 40A: Blue
    public static final int CANID_WINCH                         = 7;    // 40A: Purple
    public static final int CANID_SPARE                         = 8;    // 40A: Gray

    public static final int CANID_PDP                           = 16;
    public static final int CANID_PCM1                          = 17;
    public static final int CANID_PCM2                          = 18;

    //
    // Relay channels.
    //
    public static final int RELAY_RINGLIGHT_POWER               = 0;    // 20A: White
    public static final int RELAY_FLASHLIGHT_POWER              = 1;    // 20A: Yellow

    //
    // Solenoid channels.
    //
    public static final int SOL_GEARPICKUP_CLAW_RETRACT         = 0;
    public static final int SOL_GEARPICKUP_CLAW_EXTEND          = 1;
    public static final int SOL_GEARPICKUP_ARM_RETRACT          = 2;
    public static final int SOL_GEARPICKUP_ARM_EXTEND           = 3;
    public static final int SOL_MAILBOX_RETRACT                 = 4;
    public static final int SOL_MAILBOX_EXTEND                  = 5;
    public static final int SOL_TARGET_FOUND_LED                = 6;    // White LED
    public static final int SOL_TARGET_ALIGNED_LED              = 7;    // Blue LED

    //
    // Miscellaneous sensors and devices.
    //
    public static final int CAM_WIDTH                           = 320;
    public static final int CAM_HEIGHT                          = 240;
    public static final int CAM_FRAME_RATE                      = 15;
    public static final int CAM_BRIGHTNESS                      = 20;

    //
    // DriveBase subsystem.
    //

    // 2017-02-21: 0.0091442577063687, 0.17, 0.0, 0.0
    // 2017-03-21: 0.0152347136491642, 0.15, 0.0, 0.0
    public static final double ENCODER_X_INCHES_PER_COUNT       = 0.0152347136491642;
    public static final double ENCODER_X_KP                     = 0.15;
    public static final double ENCODER_X_KI                     = 0.0;
    public static final double ENCODER_X_KD                     = 0.0;
    public static final double ENCODER_X_KF                     = 0.0;
    public static final double ENCODER_X_TOLERANCE              = 1.0;
    public static final double ENCODER_X_SETTLING               = 0.2;

    // 2017-02-21: 0.0159419007257628, 0.03, 0.0, 0.007
    // 2017-03-07: 0.0159419007257628, 0.05, 0.0, 0.007
    // 2017-03-08: 0.0159419007257628, 0.06, 0.0, 0.007
    // 2017-03-12: 0.0159419007257628, 0.03, 0.0, 0.0005
    // 2017-03-14: 0.0159419007257628, 0.03, 0.0, 0.005
    // 2017-03-21: 0.0171280999395813, 0.035, 0.0, 0.008
    // 2017-03-30: 0.01778656, 0.035, 0.0, 0.008
    public static final double ENCODER_Y_INCHES_PER_COUNT       = 0.01778656;
    public static final double ENCODER_Y_KP                     = 0.035;
    public static final double ENCODER_Y_KI                     = 0.0;
    public static final double ENCODER_Y_KD                     = 0.008;
    public static final double ENCODER_Y_KF                     = 0.0;
    public static final double ENCODER_Y_TOLERANCE              = 1.0;
    public static final double ENCODER_Y_SETTLING               = 0.2;

    // 2017-03-05: 0.15, 0.0, 0.01
    // 2017-03-07: 0.15, 0.0, 0.02
    // 2017-03-08: 0.1, 0.0, 0.007
    // 2017-03-12: 0.065, 0.0, 0.005/0.2, 0.0, 0.0
    // 2017-03-14: 0.065, 0.0, 0.005/0.08, 0.0, 0.0001
    // 2017-03-21: 0.065, 0.0, 0.005/0.06, 0.0, 0.0018 (Competition Robot)
    // 2017-04-02: 0.05, 0.0, 0.003
    public static final double GYRO_TURN_KP                     = 0.05;
    public static final double GYRO_TURN_KI                     = 0.0;
    public static final double GYRO_TURN_KD                     = 0.003;
    public static final double GYRO_TURN_KF                     = 0.0;
    public static final double GYRO_TURN_TOLERANCE              = 2.0;
    public static final double GYRO_TURN_SETTLING               = 0.2;
    public static final double GYRO_TURN_SMALL_THRESHOLD        = 10.0;
    public static final double GYRO_TURN_SMALL_KP               = 0.06;
    public static final double GYRO_TURN_SMALL_KI               = 0.0;
    public static final double GYRO_TURN_SMALL_KD               = 0.0018;

    public static final double DRIVE_STALL_TIMEOUT              = 0.5;
    public static final double DRIVE_SLOW_XSCALE                = 3.0;
    public static final double DRIVE_SLOW_YSCALE                = 3.0;
    public static final double DRIVE_SLOW_TURNSCALE             = 3.0;

    // 2017-03-12: 0.01, 0.0, 0.0
    // 2017-03-14: 0.0165, 0.0, 0.002
    public static final double SONAR_KP                         = 0.0165;
    public static final double SONAR_KI                         = 0.0;
    public static final double SONAR_KD                         = 0.002;
    public static final double SONAR_KF                         = 0.0;
{'fraction_non_alphanumeric': 0.07451029791522328, 'fraction_numerical': 0.08540656295269887, 'mean_word_length': 1.7072463768115942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7290068', 'n_tokens_mistral': 6014, 'n_tokens_neox': 4894, 'n_words': 1491}