![]() |
2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
|
Controls the Intake of the robot and provides internal ball position state info. More...
#include <intake_subsystem.h>
Public Types | |
enum class | IntakeState { Stop , Intaking , Outtaking } |
Possible intake states. More... | |
Public Member Functions | |
IntakeSubsystem (const argos_lib::RobotInstance instance, argos_lib::SwappableControllersSubsystem *controller) | |
void | Disable () |
Handle robot disabling. More... | |
bool | GetBallPresentIntake () |
Determines whether ball is present at intake. More... | |
bool | GetBallPresentShooter () |
Determines whether ball is present at shooter. More... | |
bool | GetIsBallTeamColor () |
Determines whether ball is team color. More... | |
void | Periodic () override |
void | Intake () |
Deploys intake and starts rollers inwards. Handles elevator logic of cycling balls. More... | |
void | SlowIntake () |
Deploys intake and starts rollers inwards at slow speed. Handles elevator logic of cycling balls. This is mostly useful for autonomous where fast intake sometimes spins ball before conveyor. More... | |
void | StopIntake () |
Retracts intake. Does not run rollers. More... | |
void | DumpBall () |
Reverses the intake to dump balls. More... | |
void | Shoot () |
Shoots ball. More... | |
void | StopShoot () |
Stop shooter. More... | |
void | ElevatorCycle (bool direction, bool cycleLength) |
Cycle the elevator to load or dump balls. More... | |
Private Attributes | |
const argos_lib::CANAddress | m_beltDriveAddr |
const argos_lib::CANAddress | m_intakeDriveAddr |
WPI_TalonSRX | m_beltDrive |
Motor that drives the belts on the elevator (Positive towards shooter, Negative away from shooter) More... | |
WPI_TalonSRX | m_intakeDrive |
Motor for the intake rollers (Positive is in, Negative is out) More... | |
frc::Solenoid | m_intakeDeploy |
Solenoid for intake actuation (True is extend, False is retract) More... | |
frc::TimeOfFlight | m_ballPresentIntake |
TOF sensor capable of detecting ball at intake. More... | |
frc::TimeOfFlight | m_ballPresentShooter |
TOF sensor capable of detecting ball at shooter. More... | |
IntakeState | m_intakeState |
Current intake state. More... | |
bool | m_intakeButtonPressed |
True if intake button is pressed. More... | |
bool | m_slowIntakeRequested |
True if a slow intake is needed. More... | |
bool | m_outtakeButtonPressed |
True if the outake button is pressed. More... | |
bool | m_shooterButtonPressed |
True if the shooter button is pressed. More... | |
bool | m_firstShotMode |
True if there was NOT a ball in the shooter. More... | |
argos_lib::SwappableControllersSubsystem * | m_pControllers |
The driver and operator controllers. More... | |
argos_lib::EdgeDetector | m_ShooterEdgeDetector |
an edge detector used for detecting a ball leaving the shooter More... | |
argos_lib::EdgeDetector | m_IntakeEdgeDetector |
Edge detector detecting a ball entering the intake. More... | |
argos_lib::HysteresisFilter< units::inch_t > | m_hysteresisIntake |
Filter for converting from ball distance to bool, True when TOF sensor reads a ball in front. More... | |
argos_lib::HysteresisFilter< units::inch_t > | m_hysteresisShooter |
Filter for converting from ball distance to bool, True when TOF sensor reads a ball in front. More... | |
argos_lib::Debouncer | m_shooterTimeDebouncer |
Simple de-bouncer for delaying shooter shots. More... | |
Controls the Intake of the robot and provides internal ball position state info.
|
strong |
IntakeSubsystem::IntakeSubsystem | ( | const argos_lib::RobotInstance | instance, |
argos_lib::SwappableControllersSubsystem * | controllers | ||
) |
void IntakeSubsystem::Disable | ( | ) |
Handle robot disabling.
void IntakeSubsystem::DumpBall | ( | ) |
Reverses the intake to dump balls.
void IntakeSubsystem::ElevatorCycle | ( | bool | direction, |
bool | cycleLength | ||
) |
Cycle the elevator to load or dump balls.
direction | which direction to run the elevator |
cycleLength | the length of the cycle (short/long) |
bool IntakeSubsystem::GetBallPresentIntake | ( | ) |
Determines whether ball is present at intake.
bool IntakeSubsystem::GetBallPresentShooter | ( | ) |
Determines whether ball is present at shooter.
bool IntakeSubsystem::GetIsBallTeamColor | ( | ) |
Determines whether ball is team color.
void IntakeSubsystem::Intake | ( | ) |
Deploys intake and starts rollers inwards. Handles elevator logic of cycling balls.
|
override |
Will be called periodically whenever the CommandScheduler runs.
void IntakeSubsystem::Shoot | ( | ) |
Shoots ball.
void IntakeSubsystem::SlowIntake | ( | ) |
Deploys intake and starts rollers inwards at slow speed. Handles elevator logic of cycling balls. This is mostly useful for autonomous where fast intake sometimes spins ball before conveyor.
void IntakeSubsystem::StopIntake | ( | ) |
Retracts intake. Does not run rollers.
void IntakeSubsystem::StopShoot | ( | ) |
Stop shooter.
|
private |
TOF sensor capable of detecting ball at intake.
|
private |
TOF sensor capable of detecting ball at shooter.
|
private |
Motor that drives the belts on the elevator (Positive towards shooter, Negative away from shooter)
|
private |
|
private |
True if there was NOT a ball in the shooter.
|
private |
Filter for converting from ball distance to bool, True when TOF sensor reads a ball in front.
|
private |
Filter for converting from ball distance to bool, True when TOF sensor reads a ball in front.
|
private |
True if intake button is pressed.
|
private |
Solenoid for intake actuation (True is extend, False is retract)
|
private |
Motor for the intake rollers (Positive is in, Negative is out)
|
private |
|
private |
Edge detector detecting a ball entering the intake.
|
private |
Current intake state.
|
private |
True if the outake button is pressed.
|
private |
The driver and operator controllers.
|
private |
True if the shooter button is pressed.
|
private |
an edge detector used for detecting a ball leaving the shooter
|
private |
Simple de-bouncer for delaying shooter shots.
|
private |
True if a slow intake is needed.