Skip to content

Commit

Permalink
WIP: added a new command and method for odometry
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Mar 2, 2024
1 parent 2eb69bd commit f8bb56e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public static final class IntakeConstants {
public static final int kArmMotorID = 39;
public static final int kArmEncoderChannel = 0;

// In degrees
// In degrees
public static final double kIntakeLoweredAngle = 0;
public static final double kIntakeRaisedAngle = 194;
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/frc/robot/commands/SetLED.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands;

import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.DriveSubsystem;
import frc.robot.subsystems.LEDSubsystem;
import frc.robot.subsystems.VisionSubsystem;
import frc.robot.subsystems.VisionSubsystem.Measurement;

public class SetLED extends Command {
private LEDSubsystem m_LedSubsystem;
private DriveSubsystem m_driveSubsystem = new DriveSubsystem();
private Pose2d m_odometry = m_driveSubsystem.getOdometry();

/** Creates a new SetLED. */
public SetLED(LEDSubsystem LED) {
m_LedSubsystem = LED;
addRequirements(m_LedSubsystem);

// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
@Override
public void initialize() {

if ()
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/subsystems/DriveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ public void resetOdometry(Pose2d pose) {
},
pose);
}
public Pose2d getOdometry(){
return m_poseEstimator.getEstimatedPosition();
}

/** Zeroes the heading of the robot. */
public void zeroHeading() {
Expand Down

0 comments on commit f8bb56e

Please sign in to comment.