Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kevin's Macros code #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Binary file modified .gradle/6.0.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.0.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.0.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.0.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/6.0.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/6.0.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.0.1/javaCompile/jarAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.0.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/6.0.1/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
7 changes: 7 additions & 0 deletions build/debug/debuginfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"debugfile": "frcJava_roborio.debugconfig",
"project": "2020Robot",
"language": "java"
},
{
"artifact": "frcJava (in project 2020RobotOld)",
"target": "roborio",
"debugfile": "frcJava_roborio.debugconfig",
"project": "2020RobotOld",
"language": "java"
}
]
9 changes: 9 additions & 0 deletions build/debug/riopartial/2020RobotOld.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"artifact": "frcJava (in project 2020RobotOld)",
"target": "roborio",
"debugfile": "frcJava_roborio.debugconfig",
"project": "2020RobotOld",
"language": "java"
}
]
Binary file added build/libs/2020RobotOld.jar
Binary file not shown.
16 changes: 3 additions & 13 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc.robot.core751.subsystems.DifferentialDriveTrain;
import frc.robot.core751.subsystems.DifferentialDriveTrain.driveMotor;
import frc.robot.core751.subsystems.LightStrip.Orientation;
import frc.robot.core751.wrappers.OverrideableJoystick;


/**
* The Constants class provides a convenient place for teams to hold robot-wide
Expand Down Expand Up @@ -48,7 +49,7 @@ public int getButtonMapping() {

}

public static Joystick driverStick = new Joystick(Constants.driveStickPort);
public static OverrideableJoystick driverStick = new OverrideableJoystick(Constants.driveStickPort);

/*================================/
/===========Drive Train===========/
Expand Down Expand Up @@ -104,17 +105,6 @@ public int getButtonMapping() {

public static Button panelToggleButton = new JoystickButton(driverStick, Controller.Y.buttonNum);

/*======================================/
/===========Lightstrip=================/
/=====================================*/
public static int FTLEDPort = 0;
public static int FTLEDLength = 15;
public static Orientation FTLEDOrientation = Orientation.HORIZONTAL;

public static int FBLEDPort = 1;
public static int FBLEDLength = 13;
public static Orientation FBLEDOrientation = Orientation.HORIZONTAL;


// Robot-specific PIDTrajectory constants
public static double trackWidthMeters = 0.0762; // horizontal distance between the wheels
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/frc/robot/Replay.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/

package frc.robot;

/**
* Add your docs here.
*/
public class Replay {
public static Double[][] array = {{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.15748031437397003D},{0.4330708682537079D,0.15748031437397003D},{0.4330708682537079D,0.15748031437397003D},{0.4330708682537079D,0.15748031437397003D},{0.4330708682537079D,0.17322835326194763D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.18897637724876404D},{0.4330708682537079D,0.18897637724876404D},{0.4330708682537079D,0.18897637724876404D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.18110236525535583D},{0.4330708682537079D,0.16535432636737823D},{0.4330708682537079D,0.14960630238056183D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.14173229038715363D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.12598425149917603D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11811023950576782D},{0.4330708682537079D,0.11023622006177902D},{0.4330708682537079D,0.11023622006177902D},{0.4330708682537079D,0.11023622006177902D},{0.4330708682537079D,0.09448818862438202D},{0.4251968562602997D,0.07086614519357681D},{0.4251968562602997D,0.06299212574958801D},{0.4251968562602997D,0.05511811003088951D},{0.4251968562602997D,0.05511811003088951D},{0.4251968562602997D,0.05511811003088951D},{0.4173228442668915D,0.05511811003088951D},{0.4173228442668915D,0.05511811003088951D},{0.4094488322734833D,0.05511811003088951D},{0.4094488322734833D,0.05511811003088951D},{0.4094488322734833D,0.05511811003088951D},{0.4094488322734833D,0.05511811003088951D},{0.4094488322734833D,0.05511811003088951D},{0.4094488322734833D,0.05511811003088951D},{0.4015747904777527D,0.07874015718698502D},{0.3937007784843445D,0.10236220806837082D},{0.3858267664909363D,0.11023622006177902D},{0.3779527544975281D,0.12598425149917603D},{0.3779527544975281D,0.12598425149917603D},{0.3779527544975281D,0.12598425149917603D},{0.3779527544975281D,0.12598425149917603D},{0.3779527544975281D,0.12598425149917603D},{0.3700787425041199D,0.14173229038715363D,1D},{0.3700787425041199D,0.14173229038715363D,1D},{0.3700787425041199D,0.14173229038715363D,1D},{0.3700787425041199D,0.14173229038715363D,1D},{0.3700787425041199D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3779527544975281D,0.14173229038715363D,1D},{0.3858267664909363D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3937007784843445D,0.14173229038715363D,1D},{0.3779527544975281D,0.11023622006177902D,1D},{0.3385826647281647D,0.08661417663097382D,1D},{0.3385826647281647D,0.08661417663097382D,1D},{0.10236220806837082D,0.0D,1D},{0.007874015718698502D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D},{-0.015625D,0.0D,1D}};

}
34 changes: 13 additions & 21 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.commands.Ball.*;
import frc.robot.commands.Panel.*;
import frc.robot.core751.commands.JoystickPlayer;
import frc.robot.core751.commands.JoystickRecorder;
import frc.robot.core751.commands.Drivetrain.ArcadeDrive;
import frc.robot.core751.commands.Drivetrain.ReversableArcadeDrive;
import frc.robot.core751.commands.Drivetrain.SwitchDriveDirection;
Expand All @@ -37,31 +39,26 @@ public class RobotContainer {
// private final ExampleCommand m_autoCommand = new ExampleCommand(m_exampleSubsystem);


private final Camera camera0 = new Camera(0);
private final Camera camera1 = new Camera(1);

private final DifferentialDriveTrain differentialDriveTrain = new DifferentialDriveTrain(Constants.leftDrivetrainIDs, Constants.rightDrivetrainIDs, Constants.driveTrainMotorType, Constants.driveMotorProfile, Constants.driveInvertLeft, Constants.driveInvertRight);
private final ReversableArcadeDrive reversableArcadeDrive = new ReversableArcadeDrive(Constants.driverStick, differentialDriveTrain);
private final SwitchDriveDirection switchDriveDirection = new SwitchDriveDirection(differentialDriveTrain);
private final SwitchDriveDirection switchDriveDirection = new SwitchDriveDirection(differentialDriveTrain,0,1);

private final LightStrip[] lightStrips = new LightStrip[] {
new LightStrip(0, Constants.FTLEDLength, Constants.FTLEDOrientation),
//new LightStrip(1, Constants.FBLEDLength, Constants.FBLEDOrientation)
};
private final TeamColorLights teamColorLights = new TeamColorLights(lightStrips);

public final Panel panel = new Panel(Constants.leftColorsensorPort, Constants.rightColorsensorPort, Constants.panelSpinID, Constants.panelRotateID, Constants.panelTopLimitPort, Constants.panelBottomLimitPort);
private final GoToColor goToColor = new GoToColor(lightStrips, panel);
private final RotateWheel rotateWheel = new RotateWheel(lightStrips, panel);
private final ManualPanel manualPanel = new ManualPanel(panel, Constants.driverStick, Constants.rightTrigger, Constants.leftTrigger);
private final RotateThenSelect rotateThenSelect = new RotateThenSelect(panel, lightStrips);
private final TogglePanelPosition togglePanelPosition = new TogglePanelPosition(panel);

private final Camera camera = new Camera(0);

private final Ball ball = new Ball(Constants.ballIntakeMotorID, Constants.ballPolycordMotorID, Constants.ballOutakeMotorID);
private final DefaultBall defaultBall = new DefaultBall(ball, Constants.driverStick, Constants.ballLBumper, Constants.ballRBumper, Constants.ballOutButton, Constants.ballReverseOutButton);

private final PowerDistributionPanel pdp = new PowerDistributionPanel();

private final JoystickRecorder joystickRecorder = new JoystickRecorder(Constants.driverStick);
private final JoystickPlayer joystickPlayer = new JoystickPlayer(Replay.array, Constants.driverStick);



/**
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
Expand All @@ -77,23 +74,18 @@ public RobotContainer() {
* {@link edu.wpi.first.wpilibj2.command.button.JoystickButton}.
*/
private void configureButtonBindings() {
for (LightStrip l : lightStrips) {
l.setDefaultCommand(teamColorLights);
}

panel.setDefaultCommand(manualPanel);
differentialDriveTrain.setDefaultCommand(reversableArcadeDrive);
ball.setDefaultCommand(defaultBall);

Constants.panelToggleButton.whenPressed(togglePanelPosition);

Constants.driveSwitchDirectionButton.whenPressed(switchDriveDirection);

SmartDashboard.putData(pdp);
SmartDashboard.putData(joystickRecorder);
SmartDashboard.putData(joystickPlayer);

SmartDashboard.putData(togglePanelPosition);
SmartDashboard.putData(goToColor);
SmartDashboard.putData(rotateWheel);
SmartDashboard.putData(rotateThenSelect);
}


Expand Down
92 changes: 0 additions & 92 deletions src/main/java/frc/robot/commands/Panel/GoToColor.java

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/java/frc/robot/commands/Panel/RotateThenSelect.java

This file was deleted.

Loading