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
14 changes: 14 additions & 0 deletions .pathplanner/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"robotWidth": 0.9,
"robotLength": 0.9,
"holonomicMode": true,
"pathFolders": [],
"autoFolders": [
"New Folder"
],
"defaultMaxVel": 3.0,
"defaultMaxAccel": 3.0,
"defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 720.0,
"maxModuleSpeed": 4.5
}
19 changes: 19 additions & 0 deletions src/main/deploy/pathplanner/autos/New Auto.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 1.0,
"startingPose": null,
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Gains Path"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
81 changes: 81 additions & 0 deletions src/main/deploy/pathplanner/paths/Gains Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 2.053233435210415,
"y": 7.1495765710980645
},
"prevControl": null,
"nextControl": {
"x": 3.890081170868021,
"y": 7.389779736530214
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.066039257723953,
"y": 6.344189487002038
},
"prevControl": {
"x": 5.066039257723953,
"y": 7.344189487002038
},
"nextControl": {
"x": 7.066039257723953,
"y": 5.344189487002038
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.461668000788668,
"y": 3.1650299445177192
},
"prevControl": {
"x": 6.857296743853384,
"y": 4.450823359478042
},
"nextControl": {
"x": 6.237127153147944,
"y": 2.4352721896853664
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.15401830115192,
"y": 0.9325534657953997
},
"prevControl": {
"x": 5.61389212279285,
"y": 0.9466830637619968
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": null,
"useDefaultConstraints": false
}
70 changes: 35 additions & 35 deletions src/main/java/frc/robot/RobocketsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,39 +80,39 @@ public void teleopPeriodic() {
}
}
// Intake
if (map.intake != null) {
map.intake.rotate(deadzone(getRightX(), 0.1));

if (getLeftBumperPressed()) {
map.intake.intake();
}
else if (getRightBumperPressed()) {
map.intake.outtake();
}
}
// if (map.intake != null) {
// map.intake.rotate(deadzone(getRightX(), 0.1));

// if (getLeftBumperPressed()) {
// map.intake.intake();
// }
// else if (getRightBumperPressed()) {
// map.intake.outtake();
// }
// }
// Shooter
if (map.shooter != null) {
if (getAButtonPressed()) {
//CommandScheduler.getInstance().schedule(new Shoot(SmartDashboard.getNumber("Shooter Speed", 0.5)));
map.shooter.setSpeed(SmartDashboard.getNumber("Shooter In Speed", 0.5));
}
if (getBButtonPressed()) {
//CommandScheduler.getInstance().schedule(new Shoot(-SmartDashboard.getNumber("Shooter Speed", 0.5)));
map.shooter.setSpeed(-SmartDashboard.getNumber("Shooter Out Speed", 0.5));
}
if (getYButtonPressed()) {
map.shooter.setIntakeSpeed(SmartDashboard.getNumber("Shooter Intake Speed", 0.5));
}
if (getXButtonPressed()) {
map.shooter.setIntakeSpeed(-SmartDashboard.getNumber("Shooter Outtake Speed", 0.5));
}
if (getAButtonReleased() || getBButtonReleased()) {
map.shooter.setSpeed(0);
}
if (getXButtonReleased() || getYButtonReleased()) {
map.shooter.setIntakeSpeed(0);
}
}
// if (map.shooter != null) {
// if (getAButtonPressed()) {
// //CommandScheduler.getInstance().schedule(new Shoot(SmartDashboard.getNumber("Shooter Speed", 0.5)));
// map.shooter.setSpeed(SmartDashboard.getNumber("Shooter In Speed", 0.5));
// }
// if (getBButtonPressed()) {
// //CommandScheduler.getInstance().schedule(new Shoot(-SmartDashboard.getNumber("Shooter Speed", 0.5)));
// map.shooter.setSpeed(-SmartDashboard.getNumber("Shooter Out Speed", 0.5));
// }
// if (getYButtonPressed()) {
// map.shooter.setIntakeSpeed(SmartDashboard.getNumber("Shooter Intake Speed", 0.5));
// }
// if (getXButtonPressed()) {
// map.shooter.setIntakeSpeed(-SmartDashboard.getNumber("Shooter Outtake Speed", 0.5));
// }
// if (getAButtonReleased() || getBButtonReleased()) {
// map.shooter.setSpeed(0);
// }
// if (getXButtonReleased() || getYButtonReleased()) {
// map.shooter.setIntakeSpeed(0);
// }
// }
// Vision
if (map.vision != null) {
if(getAButtonPressed()){
Expand Down Expand Up @@ -149,8 +149,8 @@ else if (getRightBumperPressed()) {


// West Coast
if (map.westcoast != null) {
map.westcoast.arcadeDrive(getLeftY(), getRightX());
}
// if (map.westcoast != null) {
// map.westcoast.arcadeDrive(getLeftY(), getRightX());
// }
}
}
1 change: 1 addition & 0 deletions src/main/java/frc/robot/RobocketsShuffleboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static void teleopInit() {
addNumber("Shooter Out Speed", 0.5);
addNumber("Shooter Intake Speed", 0.5);
addNumber("Shooter Outtake Speed", 0.5);

}


Expand Down
19 changes: 7 additions & 12 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public class Robot extends TimedRobot {
// This is also the file where all the subsystems reside
private static RobotMap map = new RobotMap();
public static RobotMap getMap() { return map; }
public static RobocketsController controller = new RobocketsController(Constants.CONTROLLER_PORT, map);
// public static RobocketsController controller = new RobocketsController(Constants.CONTROLLER_PORT, map);

/**
* This function is run when the robot is first started up and should be used for any
* initialization code.
*/
@Override
public void robotInit() {
AutoConstruct.sendAutoOptionsToSmartDashboard();
// AutoConstruct.sendAutoOptionsToSmartDashboard();
}

/**
Expand All @@ -56,14 +56,15 @@ public void robotPeriodic() {}
*/
@Override
public void autonomousInit() {
// CommandScheduler.getInstance().schedule(new SwerveGoCartesianF(map.swerve, new Translation2d(0, 6)));
AutoConstruct.scheduleSelectedCommand(map);
}

/** This function is called periodically during autonomous. */
@Override
public void autonomousPeriodic() {
CommandScheduler.getInstance().run();


//CommandScheduler.getInstance().run();

//Gian: I'm not so sure why we would ever use this if all the auto code is done in the commandscheduler

Expand All @@ -88,15 +89,9 @@ public void teleopInit() {
/** This function is called periodically during operator control. */
@Override
public void teleopPeriodic() {
controller.teleopPeriodic();
if (map.vision != null) {
var result = map.vision.getLatestResult();

if(result.hasTargets()){
System.out.println(result.getBestTarget());
}
}
// controller.teleopPeriodic();
// Run any commands
map.vision.getPoseFromTag();
CommandScheduler.getInstance().run();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import frc.robot.subsystems.swerve.SwerveDriveSubsystem;
import frc.robot.subsystems.swerve.SwerveModuleNeo;
import frc.robot.subsystems.vision.VisionSubsystem;
import frc.robot.subsystems.westcoast.WestCoastSubsystem;
// import frc.robot.subsystems.westcoast.WestCoastSubsystem;

// Contains all physical items on the robot (motors, encoders, LEDs, etc)
public class RobotMap
Expand All @@ -32,8 +32,8 @@ public class RobotMap
public RobotMap()
{
// intake = new IntakeSubsystem();
vision = new VisionSubsystem();
swerve = new SwerveDriveSubsystem(new Translation2d(-0.31115, 0.31115), new Translation2d(0.31115, 0.31115), new Translation2d(-0.31115, -0.31115), new Translation2d(0.31115, -0.31115)); // All translations are the swerve module positions relative to the center of the bot
// vision = new VisionSubsystem();
//shooter = new ShooterSubsystem();
// leds=new LedSubsystem();

Expand Down
18 changes: 9 additions & 9 deletions src/main/java/frc/robot/field/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ public class Field {
//-------
// Speaker
//-------
public static final Speaker SPEAKER = new Speaker(SPEAKER_TOP_LEFT, SPEAKER_BOTTOM_RIGHT);
public static final Subwoofer SUBWOOFER = new Subwoofer(SUBWOOFER_TOP_LEFT, SUBWOOFER_BOTTOM_RIGHT);
// public static final Speaker SPEAKER = new Speaker(SPEAKER_TOP_LEFT, SPEAKER_BOTTOM_RIGHT);
// public static final Subwoofer SUBWOOFER = new Subwoofer(SUBWOOFER_TOP_LEFT, SUBWOOFER_BOTTOM_RIGHT);

//-------
// Stage
//-------
public static final Stage STAGE =
new Stage(
LEFT_STAGE_POST_TOP_LEFT, TOP_STAGE_POST_CENTER, BOTTOM_STAGE_POST_CENTER,
RIGHT_TRAP_POINT1, RIGHT_TRAP_POINT2,
TOP_TRAP_POINT1, TOP_TRAP_POINT2,
BOTTOM_TRAP_POINT1, BOTTOM_TRAP_POINT2
);
// public static final Stage STAGE =
// new Stage(
// LEFT_STAGE_POST_TOP_LEFT, TOP_STAGE_POST_CENTER, BOTTOM_STAGE_POST_CENTER,
// RIGHT_TRAP_POINT1, RIGHT_TRAP_POINT2,
// TOP_TRAP_POINT1, TOP_TRAP_POINT2,
// BOTTOM_TRAP_POINT1, BOTTOM_TRAP_POINT2
// );

//-------
// Notes
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/field/TagPositions.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public static AprilTagFieldLayout getAprilTagFieldLayout(){
public static Optional<Pose3d> getTagPose3d(int ID){
return getAprilTagFieldLayout().getTagPose(ID);
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/subsystems/shooter/Shoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void initialize() {}

@Override
public void execute() {
Robot.getMap().shooter.setSpeed(speed);
// Robot.getMap().shooter.setSpeed(speed);
}

@Override
Expand All @@ -30,6 +30,6 @@ public boolean isFinished() {

@Override
public void end(boolean interrupted) {
Robot.getMap().shooter.setSpeed(0);
// Robot.getMap().shooter.setSpeed(0);
}
}
Loading