-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * Constants Tuning: - Always boot up or deploy code to the robot in arm raised mode - There is a negative sign on the calculate function because it technically goes from 0 to -193 (Set inverted does absolutely nothing that has been deleted) - constant angles have been updated to reflect the offset tuning - kDistanceSensorThreshold as 10 actually works. Needs tuning - Intake Speed adjusted to 0.5. Needs tuning for the ground I suppose. - kEncoderOffset adjusted * Testing: - Distance sensor now uses MXP port instead of onboard (added set automatic mode) - Pid needs tuning -> tolerance set to 15 degrees - Fixed switch logic - Added setSetpoint at the end of setArmPosition so that the setarmpositioncommand does not automatically end - Have note functional - deleted intakemotor guards because inherent and unnecessary (add later if want) * Modified smart dashboard to be exact * Commit message# t abort qqqt :wqq# Your branch is up to date with 'origin/shoot-command'. * testing
- Loading branch information
1 parent
e526eec
commit 0e6b9e8
Showing
7 changed files
with
138 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/frc/robot/commands/ShooterSetSpeedCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// 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.wpilibj.Timer; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.Constants.ShooterConstants; | ||
import frc.robot.subsystems.ShooterSubsystem; | ||
import frc.robot.subsystems.ShooterSubsystem.ShootSpeed; | ||
|
||
public class ShooterSetSpeedCommand extends Command { | ||
ShooterSubsystem m_ShooterSubsystem; | ||
double m_shooterSpeed = 0; | ||
|
||
Timer m_timer = new Timer(); | ||
|
||
ShootSpeed m_shootSpeed; | ||
|
||
/** Creates a new ShootCommand. */ | ||
public ShooterSetSpeedCommand(ShooterSubsystem shooterSubsystem, ShootSpeed shootSpeed) { | ||
m_ShooterSubsystem = shooterSubsystem; | ||
addRequirements(m_ShooterSubsystem); | ||
|
||
m_shootSpeed = shootSpeed; | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
m_ShooterSubsystem.setShootingSpeed(m_shootSpeed); | ||
|
||
m_timer.reset(); | ||
m_timer.start(); | ||
} | ||
|
||
// 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 m_timer.get() > 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters