Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "java",
"name": "Main",
"request": "launch",
"mainClass": "frc.robot.Main",
"projectName": "Robot-Code-2024"
},
{
"type": "wpilib",
"name": "WPILib Desktop Debug",
"request": "launch",
"desktop": true,
"desktop": true
},
{
"type": "wpilib",
"name": "WPILib roboRIO Debug",
"request": "launch",
"desktop": false,
"desktop": false
}
]
}
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@
}
},
],
"java.test.defaultConfig": "WPIlibUnitTests"
"java.test.defaultConfig": "WPIlibUnitTests",
"java.format.settings.url": ".vscode/eclipse-java-google-style.xml",
"[java]": {
"editor.detectIndentation": false
},
"java.checkstyle.configuration": "${workspaceFolder}/.vscode/eclipse-java-google-style.xml"
}
124 changes: 60 additions & 64 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
@@ -1,98 +1,94 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot;

// ***NEED TO BE UPDATED FOR 2024 SEASON***

/**
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean
* constants. This class should not be used for any other purpose. All constants should be declared
* globally (i.e. public static). Do not put anything functional in this class.
* The Constants class provides a convenient place for teams to hold robot-wide numerical or
* boolean constants. This class should not be used for any other purpose. All constants should be
* declared globally (i.e. public static). Do not put anything functional in this class.
*
* <p>It is advised to statically import this class (or one of its inner classes) wherever the
* It is advised to statically import this class (or one of its inner classes) wherever the
* constants are needed, to reduce verbosity.
*/
public final class Constants {

public static class OperatorConstants {
public static final int DRIVER_XBOX_PORT = 0;
public static final int COPILOT_XBOX_PORT = 1;
public static class OperatorConstants {
public static final int DRIVER_XBOX_PORT = 0;
public static final int COPILOT_XBOX_PORT = 1;

public static final double DRIVER_JOYSTICK_DEADBAND = 0.1;
public static final double DRIVE_SPEED_ADJUSTMENT = 0.8;
}
public static final double DRIVER_JOYSTICK_DEADBAND = 0.1;
public static final double DRIVE_SPEED_ADJUSTMENT = 0.8;
}

public static class DrivetrainConstants {
public static final int LEFT_MOTOR_1_PORT = 1;
public static final int LEFT_MOTOR_2_PORT = 2;
public static final int RIGHT_MOTOR_1_PORT = 3;
public static final int RIGHT_MOTOR_2_PORT = 4;
public static class DrivetrainConstants {
public static final int LEFT_MOTOR_1_PORT = 1;
public static final int LEFT_MOTOR_2_PORT = 2;
public static final int RIGHT_MOTOR_1_PORT = 3;
public static final int RIGHT_MOTOR_2_PORT = 4;

public static final int COUNTS_PER_REV = 42;
public static final int COUNTS_PER_REV = 42;

// 1 meter = 39.37 inches = 2.088 wheel rotations = 17.664 motor rotations (assuming gear ratio = 8.46)
public static final double METERS_TO_ROTATIONS = 17.664;
public static final double DEGREES_TO_ROTATIONS = 0.1; // value accurate as of 2/13/24
}
// 1 meter = 39.37 inches = 2.088 wheel rotations = 17.664 motor rotations (assuming gear ratio = 8.46)
public static final double METERS_TO_ROTATIONS = 17.664;
public static final double DEGREES_TO_ROTATIONS = 0.1; // value accurate as of 2/13/24
}

public static class IntakeConstants {
public static final int INTAKE_MOTOR_PORT = 5;
public static class IntakeConstants {
public static final int INTAKE_MOTOR_PORT = 5;

public static final double INTAKE_MOTOR_SPEED_IN = 0.4;
public static final double INTAKE_MOTOR_SPEED_OUT = -0.4;
public static final double INTAKE_MOTOR_SPEED_IN = 0.4;
public static final double INTAKE_MOTOR_SPEED_OUT = -0.4;

public static final int COUNTS_PER_REV = 42;
}
public static final int COUNTS_PER_REV = 42;
}

public static class IndexerConstants {
public static final int INDEXER_MOTOR_PORT = 6;
public static class IndexerConstants {
public static final int INDEXER_MOTOR_PORT = 6;

public static final double INDEXER_MOTOR_SPEED_DOWN = 0.4; // TODO: replace with values from beam break branch
public static final double INDEXER_MOTOR_SPEED_UP = -0.4; // TODO: replace with values from beam break branch
public static final double INDEXER_MOTOR_SPEED_DOWN = 0.4; // TO DO: replace with values from beam break branch
public static final double INDEXER_MOTOR_SPEED_UP = -0.4; // TO DO: replace with values from beam break branch

public static final double INDEXER_MOTOR_SPEED_DOWN_BACKUP = 0.2; // for testing/backup, finalized 02/23/2024
public static final double INDEXER_MOTOR_SPEED_UP_BACKUP = -0.2; // for testing/backup, finalized 02/23/2024
public static final double INDEXER_MOTOR_SPEED_DOWN_BACKUP = 0.2; // for testing/backup, finalized 02/23/2024
public static final double INDEXER_MOTOR_SPEED_UP_BACKUP = -0.2; // for testing/backup, finalized 02/23/2024

public static final int COUNTS_PER_REV = 42;
}
public static final int COUNTS_PER_REV = 42;
}

public static class ShooterConstants {
public static final int SHOOTER_MOTOR_PORT = 7;
public static class ShooterConstants {
public static final int SHOOTER_MOTOR_PORT = 7;

public static final double SHOOTER_MOTOR_SPEED_AMP = HoodConstants.HOOD_MOTOR_SPEED / -2.0; // should be half of HOOD_MOTOR_SPEED, finalized 02/23/2024
public static final double SHOOTER_MOTOR_SPEED_SPEAKER = -0.5; // correct as of 2/25/24
public static final double SHOOTER_MOTOR_SPEED_OUT = -0.5; // constant for testing
public static final double SHOOTER_MOTOR_SPEED_AMP = HoodConstants.HOOD_MOTOR_SPEED / -2.0; // should be half of HOOD_MOTOR_SPEED, finalized 02/23/2024
public static final double SHOOTER_MOTOR_SPEED_SPEAKER = -0.5; // correct as of 2/25/24
public static final double SHOOTER_MOTOR_SPEED_OUT = -0.5; // constant for testing

public static final int COUNTS_PER_REV = 42;
}
public static final int COUNTS_PER_REV = 42;
}

public static class HoodConstants {
public static final int HOOD_MOTOR_PORT = 9; // correct as of 2/20/24
public static final int PIVOT_MOTOR_PORT = 8; // correct as of 2/20/24
public static class HoodConstants {
public static final int HOOD_MOTOR_PORT = 9; // correct as of 2/20/24
public static final int PIVOT_MOTOR_PORT = 8; // correct as of 2/20/24

public static final double HOOD_MOTOR_SPEED = 0.4; // should be double of SHOOTER_MOTOR_SPEED_AMP, finalized 02/23/2024
public static final double HOOD_MOTOR_SPEED = 0.4; // should be double of SHOOTER_MOTOR_SPEED_AMP, finalized 02/23/2024

public static final double PIVOT_MOTOR_SPEED = 0.5; // finalized 02/23/2024
public static final double SLOW_PIVOT_MOTOR_SPEED = 0.2; // finalized 02/23/2024
public static final double PIVOT_MOTOR_SPEED = 0.5; // finalized 02/23/2024
public static final double SLOW_PIVOT_MOTOR_SPEED = 0.2; // finalized 02/23/2024

// assuming hood back is at encoder position 0, PIVOT_DISTANCE is the required encoder position for the hood to be forward
public static final double PIVOT_DISTANCE = -48.20; // correct as of 2/20/24
// assuming hood back is at encoder position 0, PIVOT_DISTANCE is the required encoder position for the hood to be forward
public static final double PIVOT_DISTANCE = -48.20; // correct as of 2/20/24


public static final int COUNTS_PER_REV = 42;
}
public static final int COUNTS_PER_REV = 42;
}

public static class ClimberConstants {
public static final int CLIMBER_MOTOR_PORT = 100; // TO DO: set ID val
public static class ClimberConstants {
public static final int CLIMBER_MOTOR_PORT = 100; // TO DO: set ID val

public static final int COUNTS_PER_REV = 42;
}
public static final int COUNTS_PER_REV = 42;
}

public static class AutoConstants {
public static final double TAXI_AUTO_TARGET_DISTANCE = 25; // distance in meters to taxi (unset for 2024)
public static final double TAXI_AUTO_SPEED = 0.4; // (temp) speed of robot during taxi auto
public static final double ROTATION_SPEED = 0.5;
}
public static class AutoConstants {
public static final double TAXI_AUTO_TARGET_DISTANCE = 25; // distance in meters to taxi (unset for 2024)
public static final double TAXI_AUTO_SPEED = 0.4; // (temp) speed of robot during taxi auto
public static final double ROTATION_SPEED = 0.5;
}
}
31 changes: 15 additions & 16 deletions src/main/java/frc/robot/Main.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot;

import edu.wpi.first.wpilibj.RobotBase;

/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what
* you are doing, do not modify this file except to change the parameter class to the startRobot
* call.
* Do not add any static variables to this class, or any initialization at all. Unless you know
* what you are doing, do not modify this file except to change the parameter class to the
* startRobot call.
*/
public final class Main {
private Main() {}
/**
* Constructs Main object.
*/
public Main() {}

/**
* Main initialization function. Do not perform any initialization here.
*
* <p>If you change your main robot class, change the parameter type.
*/
public static void main(String... args) {
RobotBase.startRobot(Robot::new);
}
/**
* Main initialization function. Do not perform any initialization here.
*
* If you change your main robot class, change the parameter type.
*/
public static void main(String... args) {
RobotBase.startRobot(Robot::new);
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public double getCoXBoxRightJoyX() {
return m_coPilotXbox.getRightX();
}

}
}
Loading