Skip to content

Commit

Permalink
fixed broken task checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Advay17 committed Nov 1, 2024
1 parent 9108e83 commit 5f1477c
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import frc.robot.commands.DriveCommands;
Expand Down Expand Up @@ -95,10 +96,9 @@ public void autonomousInit() {
new SequentialCommandGroup(
new ParallelDeadlineGroup(
new WaitCommand(3),
new InstantCommand(() -> {
new RunCommand(() -> {
try {
XRPDrivetrain.class.getMethod("arcadeDrive", double.class).invoke(RobotContainer.m_xrpDrivetrain, 1, 1);
System.out.println("runs");
XRPDrivetrain.class.getMethod("tankDrive", double.class, double.class).invoke(RobotContainer.m_xrpDrivetrain, 1, 1);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -109,10 +109,9 @@ public void autonomousInit() {
),
new ParallelDeadlineGroup(
new WaitCommand(2),
new InstantCommand(() -> {
new RunCommand(() -> {
try {
XRPDrivetrain.class.getMethod("arcadeDrive", double.class).invoke(RobotContainer.m_xrpDrivetrain, 1, -1);
System.out.println("runs");
XRPDrivetrain.class.getMethod("tankDrive", double.class, double.class).invoke(RobotContainer.m_xrpDrivetrain, 1, -1);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -123,10 +122,9 @@ public void autonomousInit() {
),
new ParallelDeadlineGroup(
new WaitCommand(2),
new InstantCommand(() -> {
new RunCommand(() -> {
try {
XRPDrivetrain.class.getMethod("arcadeDrive", double.class).invoke(RobotContainer.m_xrpDrivetrain, -1, 1);
System.out.println("runs");
XRPDrivetrain.class.getMethod("tankDrive", double.class, double.class).invoke(RobotContainer.m_xrpDrivetrain, -1, 1);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -137,8 +135,7 @@ public void autonomousInit() {
),
new InstantCommand(() -> {
try {
XRPDrivetrain.class.getMethod("arcadeDrive", double.class).invoke(RobotContainer.m_xrpDrivetrain, 0, 0);
System.out.println("runs");
XRPDrivetrain.class.getMethod("tankDrive", double.class, double.class).invoke(RobotContainer.m_xrpDrivetrain, 0, 0);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -154,7 +151,7 @@ public void autonomousInit() {
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
try {
((Command) Class.forName("DriveCommands$TankDriveDistance").getDeclaredConstructor(double.class).newInstance(5)).schedule();
((Command) Class.forName("frc.robot.commands.DriveCommands$TankDriveDistance").getDeclaredConstructor(double.class).newInstance(5)).schedule();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Expand Down Expand Up @@ -189,7 +186,7 @@ public void autonomousInit() {
}
catch(NoSuchMethodException e){
try {
((Command) Class.forName("ServoCommands$ServoPresetCommand").getDeclaredConstructor(int.class).newInstance(i)).schedule();
((Command) Class.forName("frc.robot.commands.ServoCommands$ServoPresetCommand").getDeclaredConstructor(int.class).newInstance(i)).schedule();
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException | ClassNotFoundException e1) {
// TODO Auto-generated catch block
Expand All @@ -216,7 +213,7 @@ public void autonomousInit() {
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
try {
((Command) Class.forName("DriveCommands$DriveToWall").getDeclaredConstructor().newInstance()).schedule();
((Command) Class.forName("frc.robot.commands.DriveCommands$DriveToWall").getDeclaredConstructor().newInstance()).schedule();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Expand All @@ -243,7 +240,7 @@ public void autonomousInit() {
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
try {
((Command) Class.forName("DriveCommands$TankTurnDegrees").getDeclaredConstructor(double.class).newInstance(38)).schedule();
((Command) Class.forName("frc.robot.commands.DriveCommands$TankTurnDegrees").getDeclaredConstructor(double.class).newInstance(38)).schedule();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Expand Down

0 comments on commit 5f1477c

Please sign in to comment.