Skip to content

Shooter

The shooter subsystem is for a single flywheel shooter. It can be used to spin up, hold at a position and respond to manual commands.

To create and schedule a shooter behaviour, you can use the following code:

wom::Shooter *shooter = new wom::Shooter("shooter path (in nt tables)", config); // config is a ShooterConfig

Parameters

TypeNameDescriptionSee Also
std::stringpathThe path to the shooter in the NT tables
wom::ShooterConfigconfigThe configuration for the shooter

Config

TypeNameDescriptionSee Also
wom::GearboxgearboxThe gearbox for the shooter
wom::PIDConfig<units::radians_per_second, units::volt>pidThe PID configuration for the shooterPID Config
units::ampere_tcurrentLimitThe current limit for the shooter

States

wom::ShooterState is an enum of states for the shooter.

NameValueDescription
kPID0The shooter is idle
kManual1The shooter is in manual mode
kIdle2The shooter is idle

Methods

SetManual

Sets the shooter to manual mode.

void SetManual(units::volt_t voltage);

Usage

shooter->SetManual(12_V);

SetPID

Sets the shooter to PID mode.

void SetPID(units::radians_per_second_t goal);

Usage

shooter->SetPID(100_rad_per_s);

SetState

Sets the state of the shooter.

void SetState(wom::ShooterState state);

See States for the possible states.

Usage

shooter->SetState(wom::ShooterState::kPID);

IsStable

Returns whether the shooter is stable.

bool IsStable();

Usage

bool stable = shooter->IsStable();

Behaviours

Shooter Constant

The shooter constant behaviour is used to hold the shooter at a constant speed.

wom::ShooterConstant(wom::Shooter* s, units::volt_t setpoint)

Parameters

TypeNameDescriptionSee Also
wom::Shooter*sThe shooter to useShooter
units::volt_tsetpointThe setpoint for the shooter

Shooter Spinup

The shooter spinup behaviour is used to spin up the shooter to a certain speed.

wom::ShooterSpinup(wom::Shooter* s, units::radians_per_second_t speed, bool hold = false)

Parameters

TypeNameDescriptionSee Also
wom::Shooter*sThe shooter to useShooter
units::radians_per_second_tspeedThe speed to spin up to
boolholdWhether to hold the shooter at the speed