Skip to content

Commit

Permalink
manually resolve merge conflicts, mess with LEDS
Browse files Browse the repository at this point in the history
manually merge the 1000s of merge conflicts by copy pasting the files in

blueprint some vision code and pray it works, fingers crossed for next year
  • Loading branch information
MMaaser committed May 23, 2024
1 parent 935387c commit 4f4f0ef
Show file tree
Hide file tree
Showing 59 changed files with 2,348 additions and 703 deletions.
52 changes: 52 additions & 0 deletions src/main/deploy/pathplanner/paths/N8-ShotC.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 8.378792911431978,
"y": 0.828823196107932
},
"prevControl": null,
"nextControl": {
"x": 7.257236952795264,
"y": 0.8288231961079319
},
"isLocked": false,
"linkedName": "N8"
},
{
"anchor": {
"x": 0.787031987758696,
"y": 4.391563704668065
},
"prevControl": {
"x": 0.9275104323519487,
"y": 3.3212331676900417
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 4.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 122.0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 180.0,
"velocity": 0
},
"useDefaultConstraints": true
}
81 changes: 68 additions & 13 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,64 @@

package frc.robot;

// import com.ctre.phoenix6.SignalLogger;

import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.cscore.CvSink;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import frc.robot.subsystems.Gyro; // Gyro added for some auton-teleop control // Added by Scoy

@SuppressWarnings("unused")

public class Robot extends TimedRobot {
private Command m_autonomousCommand;

private RobotContainer m_robotContainer;

private Gyro gyro = new Gyro(); // Added by Scoy

@Override
public void robotInit() {
m_robotContainer = new RobotContainer();
// DO NOT LEAVE THIS UNCOMMENTED DURING COMPETITION
// SignalLogger.setPath("/media/sda1/");
// SignalLogger.start();
CameraServer.startAutomaticCapture();
// Creates the CvSink and connects it to the UsbCamera
CvSink cvSink = CameraServer.getVideo();
NetworkTableInstance.getDefault().getTable("limelight-speedy").getEntry("stream").setNumber(2);

// Creates the CvSource and MjpegServer [2] and connects them

}

@Override
public void robotPeriodic() {
CommandScheduler.getInstance().run();
CommandScheduler.getInstance().run();
}

@Override
public void disabledInit() {}
public void disabledInit() {
}

@Override
public void disabledPeriodic() {}
public void disabledPeriodic() {
}

@Override
public void disabledExit() {}
public void disabledExit() {
}

@Override
public void autonomousInit() {

// gyro.setAutonStartingPose180(180);
// gyro.setAutonStartingPose(-180); // Seems to impact Teleop more than auton
m_autonomousCommand = m_robotContainer.getAutonomousCommand();

if (m_autonomousCommand != null) {
Expand All @@ -42,35 +70,62 @@ public void autonomousInit() {
}

@Override
public void autonomousPeriodic() {}
public void autonomousPeriodic() {
}

@Override
public void autonomousExit() {}
public void autonomousExit() {
}

@Override
public void teleopInit() {
if (m_autonomousCommand != null) {
m_autonomousCommand.cancel();
}
}
// Shaun's Pre-Field Additions: 4-2-24
// Some things to try to reset the gyro

// This one probably won't work; it's equivalent to Rkyer just pressing Start.
// m_robotContainer.drivetrain.seedFieldRelative();

// This one also probably won't work.
// m_robotContainer.drivetrain.getPigeon2().setYaw(0);

// I have some hope for this!
// m_robotContainer.drivetrain.getPigeon2().setYaw(180);

// This one is nasty, and I don't have a great understanding of it; delete this
// method if we don't use it. It pretty much does the same as seedFieldRelative
// but with an additional 180 degrees
// m_robotContainer.drivetrain.saltFieldRelative();

// new InstantCommand(gyro::setStartingPoseBasedOnAlliance);

}

@Override
public void teleopPeriodic() {}
public void teleopPeriodic() {
// SmartDashboard.putNumber("Gyro Pose", gyro.getYaw());
}

@Override
public void teleopExit() {}
public void teleopExit() {
}

@Override
public void testInit() {
CommandScheduler.getInstance().cancelAll();
}

@Override
public void testPeriodic() {}
public void testPeriodic() {
}

@Override
public void testExit() {}
public void testExit() {
}

@Override
public void simulationPeriodic() {}
}
public void simulationPeriodic() {
}
}
Loading

0 comments on commit 4f4f0ef

Please sign in to comment.