Skip to content

Commit e05e2bc

Browse files
committed
practice field days
1 parent af81d29 commit e05e2bc

File tree

7 files changed

+76
-232
lines changed

7 files changed

+76
-232
lines changed

src/main/java/frc/robot/AutoManager/AutoCommands.java

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import edu.wpi.first.wpilibj2.command.Command;
55
import frc.robot.Manager.Manager;
66
import frc.robot.Manager.ManagerStates;
7-
import frc.robot.Subsystems.Drive.Drive;
7+
//import frc.robot.Subsystems.Drive.Drive;
88

99
public class AutoCommands {
1010

@@ -22,61 +22,61 @@ public AutoCommands() {
2222
timer = new Timer();
2323
}
2424

25-
public class SidewaysToRightFace extends Command {
26-
private final Drive drive = Drive.getInstance();
27-
28-
public static SidewaysToRightFace sidewaysToRightFace () {
29-
return AutoCommands.getInstance().new SidewaysToRightFace();
30-
}
31-
32-
@Override
33-
public void initialize() {
34-
timer.restart();
35-
}
36-
37-
@Override
38-
public void execute() {
39-
if (timer.get() <= 4){
40-
drive.sidewaysToRightFace();
41-
} else {
42-
Manager.getInstance().setState(ManagerStates.AUTO_OUT);
43-
}
44-
}
45-
46-
@Override
47-
public boolean isFinished() {
48-
return timer.get() >= 10;
49-
}
25+
// public class SidewaysToRightFace extends Command {
26+
// private final Drive drive = Drive.getInstance();
27+
28+
// public static SidewaysToRightFace sidewaysToRightFace () {
29+
// return AutoCommands.getInstance().new SidewaysToRightFace();
30+
// }
31+
32+
// @Override
33+
// public void initialize() {
34+
// timer.restart();
35+
// }
36+
37+
// @Override
38+
// public void execute() {
39+
// if (timer.get() <= 4){
40+
// drive.sidewaysToRightFace();
41+
// } else {
42+
// Manager.getInstance().setState(ManagerStates.AUTO_OUT);
43+
// }
44+
// }
45+
46+
// @Override
47+
// public boolean isFinished() {
48+
// return timer.get() >= 10;
49+
// }
5050

51-
}
52-
53-
public class DriveForward extends Command {
54-
private final Drive drive = Drive.getInstance();
55-
56-
public static DriveForward driveForward() {
57-
return AutoCommands.getInstance().new DriveForward();
58-
}
59-
60-
@Override
61-
public void initialize() {
62-
timer.restart();
63-
}
64-
65-
@Override
66-
public void execute() {
67-
if (timer.get() <= 2.5){
68-
drive.driveForward();
69-
} else {
70-
Manager.getInstance().setState(ManagerStates.AUTO_OUT);
71-
}
72-
}
73-
74-
@Override
75-
public boolean isFinished() {
76-
return timer.get() >= 10;
77-
}
51+
// }
52+
53+
// public class DriveForward extends Command {
54+
// private final Drive drive = Drive.getInstance();
55+
56+
// public static DriveForward driveForward() {
57+
// return AutoCommands.getInstance().new DriveForward();
58+
// }
59+
60+
// @Override
61+
// public void initialize() {
62+
// timer.restart();
63+
// }
64+
65+
// @Override
66+
// public void execute() {
67+
// if (timer.get() <= 2.5){
68+
// drive.driveForward();
69+
// } else {
70+
// Manager.getInstance().setState(ManagerStates.AUTO_OUT);
71+
// }
72+
// }
73+
74+
// @Override
75+
// public boolean isFinished() {
76+
// return timer.get() >= 10;
77+
// }
7878

79-
}
79+
// }
8080

8181
public class IntakeCoral extends Command {
8282
private final Manager manager = Manager.getInstance();

src/main/java/frc/robot/AutoManager/AutoManager.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
package frc.robot.AutoManager;
2-
import org.littletonrobotics.junction.Logger;
32

43
import com.pathplanner.lib.auto.NamedCommands;
54
import com.pathplanner.lib.commands.PathPlannerAuto;
6-
import com.pathplanner.lib.util.PathPlannerLogging;
7-
8-
import edu.wpi.first.math.geometry.Pose2d;
95
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
106
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
117
import edu.wpi.first.wpilibj2.command.Command;
128
import edu.wpi.first.wpilibj2.command.PrintCommand;
13-
import frc.robot.Manager.Manager;
14-
import frc.robot.Manager.ManagerStates;
9+
1510

1611
public class AutoManager {
1712
private final SendableChooser<Command> autoChooser;
@@ -25,8 +20,8 @@ public AutoManager() {
2520
NamedCommands.registerCommand("Hold Algae", AutoCommands.HoldAlgae.holdAlgae());
2621
NamedCommands.registerCommand("Score Algae", AutoCommands.ScoreAlgae.scoreAlgae());
2722
NamedCommands.registerCommand("Idle", AutoCommands.Idle.idle());
28-
NamedCommands.registerCommand("DRIVE !", AutoCommands.DriveForward.driveForward());
29-
NamedCommands.registerCommand("Sideways to Right Face", AutoCommands.SidewaysToRightFace.sidewaysToRightFace());
23+
//NamedCommands.registerCommand("DRIVE !", AutoCommands.DriveForward.driveForward());
24+
//NamedCommands.registerCommand("Sideways to Right Face", AutoCommands.SidewaysToRightFace.sidewaysToRightFace());
3025

3126
//Autochooser!
3227
autoChooser = new SendableChooser<>();

src/main/java/frc/robot/GlobalConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public enum RobotMode {
1414

1515
public static final double SIMULATION_PERIOD = 0.02;
1616

17-
public static final RobotMode ROBOT_MODE = RobotMode.REAL;
17+
public static final RobotMode ROBOT_MODE = RobotBase.isReal() ? RobotMode.REAL : RobotMode.SIM;
1818

1919

2020
public static final class Controllers {

src/main/java/frc/robot/Robot.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
import org.littletonrobotics.junction.networktables.NT4Publisher;
1010
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
1111
import org.team7525.misc.CommandsUtil;
12-
1312
import com.pathplanner.lib.commands.FollowPathCommand;
1413
import com.pathplanner.lib.commands.PathfindingCommand;
15-
1614
import edu.wpi.first.cameraserver.CameraServer;
1715
import edu.wpi.first.wpilibj.DriverStation;
1816
import edu.wpi.first.wpilibj2.command.CommandScheduler;
@@ -26,7 +24,6 @@ public class Robot extends LoggedRobot {
2624

2725
private Manager manager;
2826
private AutoManager autoManager;
29-
private Drive drive;
3027
private Vision vision;
3128

3229
public Robot() {}

src/main/java/frc/robot/Subsystems/AlgaeCoraler/AlgaeCoralerIOSim.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import static frc.robot.GlobalConstants.*;
55
import static frc.robot.Subsystems.AlgaeCoraler.AlgaeCoralerConstants.*;
66
import static frc.robot.Subsystems.AlgaeCoraler.AlgaeCoralerConstants.Sim.*;
7-
87
import org.littletonrobotics.junction.Logger;
9-
108
import com.revrobotics.sim.SparkMaxSim;
119
import com.revrobotics.spark.SparkLowLevel.MotorType;
1210
import com.revrobotics.spark.SparkMax;
@@ -15,11 +13,12 @@
1513
import edu.wpi.first.math.system.plant.LinearSystemId;
1614
import edu.wpi.first.math.util.Units;
1715
import edu.wpi.first.units.measure.Angle;
18-
import edu.wpi.first.wpilibj.Timer;
1916
import edu.wpi.first.wpilibj.simulation.DCMotorSim;
2017
import edu.wpi.first.wpilibj.simulation.SingleJointedArmSim;
2118
import frc.robot.Subsystems.AlgaeCoraler.AlgaeCoralerConstants.Sim;
2219

20+
21+
2322
public class AlgaeCoralerIOSim implements AlgaeCoralerIO {
2423

2524
private SingleJointedArmSim pivotSim;
@@ -126,6 +125,5 @@ public boolean hasCoral() {
126125

127126
@Override
128127
public void setThere(boolean there) {
129-
System.out.println("...");
130128
}
131129
}

0 commit comments

Comments
 (0)