Skip to content

Commit

Permalink
Fixed arm encoder offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Mar 9, 2024
1 parent c5a61e3 commit cc8f491
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static final class IntakeConstants {
public static final double kIntakeAmpScoringAngle = -93; // 193 - 100 (previous angle)

/** Encoder offset in rotations */
public static final double kArmEncoderOffset = 0.2252;
public static final double kArmEncoderOffset = 0.3415;

public static final double kIntakeSpeed = 0.5;

Expand Down
20 changes: 13 additions & 7 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public RobotContainer() {
NamedCommands.registerCommand("Shoot",
new SequentialCommandGroup(
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting),
new ParallelDeadlineGroup(new WaitCommand(2), new NoteOuttakeCommand(m_intakeSubsystem)),
new NoteOuttakeCommand(m_intakeSubsystem),
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off)));

NamedCommands.registerCommand("Intake",
Expand All @@ -93,12 +93,18 @@ public RobotContainer() {
// from robot center to
// furthest module.
new ReplanningConfig(false, false)),
() ->
{var alliance = DriverStation.getAlliance();
if (alliance.isPresent()) {
return alliance.get() == DriverStation.Alliance.Red;
}
return false;}, m_robotDrive);
() -> {
// Boolean supplier that controls when the path will be mirrored for the red
// alliance
// This will flip the path being followed to the red side of the field.
// THE ORIGIN WILL REMAIN ON THE BLUE SIDE

var alliance = DriverStation.getAlliance();
if (alliance.isPresent()) {
return alliance.get() == DriverStation.Alliance.Red;
}
return false;
}, m_robotDrive);

// new SequentialCommandGroup(new ShooterSetSpeedCommand(m_shooterSubsystem,
// ShootSpeed.Shooting),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/subsystems/IntakeSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void periodic() {
SmartDashboard.putNumber("intakespeed", m_intakeSpeed);

SmartDashboard.putNumber("Arm Angle", m_armEncoder.getDistance());
SmartDashboard.putNumber("Arm Absolute Angle", m_armEncoder.getAbsolutePosition());
SmartDashboard.putBoolean("Have Note?", haveNote);
SmartDashboard.putNumber("distance sensor", m_distanceSensorToggle ? m_distanceSensor.getRange(Rev2mDistanceSensor.Unit.kInches) : -1);
SmartDashboard.putNumber("pid output", armMotorSpeed);
Expand Down

0 comments on commit cc8f491

Please sign in to comment.