Skip to content

Commit

Permalink
Moving update entries to periodic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ammelll committed Dec 1, 2023
1 parent 2da4f71 commit 31855fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import edu.wpi.first.wpilibj2.command.InstantCommand;
import frc.robot.autos.Auto;
import frc.robot.commands.arm.MoveToPos;
import frc.robot.commands.swerve.Detector;
import frc.robot.commands.testing.AutoAlignPennTester;

/**
Expand All @@ -37,6 +38,7 @@ public class Robot extends TimedRobot {
private static LinkedHashMap<String, Auto> autoMap = new LinkedHashMap<String, Auto>();
private static LinkedHashMap<String, Auto> tempMap = new LinkedHashMap<String, Auto>();
private static SendableChooser<Auto> chooser;
private Detector detector = new Detector();

/**
* This function is run when the robot is first started up and should be used for any
Expand Down Expand Up @@ -71,6 +73,7 @@ public void robotPeriodic() {
// commands, running already-scheduled commands, removing finished or interrupted commands,
// and running subsystem periodic() methods. This must be called from the robot's periodic
// block in order for anything in the Command-based framework to work.
detector.updateEntries();
CommandScheduler.getInstance().run();
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/subsystems/Swerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants.*;
import frc.robot.commands.swerve.Detector;

public class Swerve extends SubsystemBase {
// public SwerveDriveOdometry swerveOdometry;
public SwerveDrivePoseEstimator estimator;
public SwerveModule[] mSwerveMods;
public Pigeon2 gyro;
public Detector detector;

public boolean isUsingCones = true;
private SwerveAutoBuilder autoBuilder = null;
Expand Down Expand Up @@ -217,7 +215,6 @@ public double getRotationRadians(){
public void periodic(){
// swerveOdometry.update(getYaw(), getModulePositions());
estimator.update(getYaw(), getModulePositions());
detector.updateEntries();
// for(SwerveModule mod : mSwerveMods){
// SmartDashboard.putNumber("Mod " + mod.moduleNumber + " Cancoder", mod.getCanCoder().getDegrees());
// SmartDashboard.putNumber("Mod " + mod.moduleNumber + " Integrated", mod.getPosition().angle.getDegrees());
Expand Down

0 comments on commit 31855fa

Please sign in to comment.