Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::turret::SimpleAmmoBooster Class Reference

#include <simple_ammo_booster.hpp>

Inheritance diagram for fang::turret::SimpleAmmoBooster:
Collaboration diagram for fang::turret::SimpleAmmoBooster:

Classes

struct  Config
 

Public Types

using Flywheel = motor::ISpeedWheel
 
using Flywheels = std::vector< std::unique_ptr< Flywheel > >
 

Public Member Functions

 SimpleAmmoBooster (Drivers &drivers, Flywheels flywheels, const Config &config)
 
void boostOn () override
 
void boostOff () override
 
void update () override
 
void refresh () override
 
void initialize () override
 
- Public Member Functions inherited from fang::turret::SimpleAmmoBoosterSubsystem
 SimpleAmmoBoosterSubsystem (tap::Drivers &drivers)
 
virtual ~SimpleAmmoBoosterSubsystem ()=default
 
- Public Member Functions inherited from tap::control::Subsystem
 Subsystem (Drivers *drivers)
 
virtual ~Subsystem ()
 
void registerAndInitialize ()
 
mockable void setDefaultCommand (Command *defaultCommand)
 
mockable CommandgetDefaultCommand () const
 
virtual void refreshSafeDisconnect ()
 
mockable void setTestCommand (Command *testCommand)
 
mockable CommandgetTestCommand () const
 
virtual const char * getName () const
 
mockable int getGlobalIdentifier () const
 

Additional Inherited Members

- Protected Attributes inherited from tap::control::Subsystem
Driversdrivers
 

Detailed Description

Manages two flywheels. Update must been called periodically. Assumes they are horizontal.

Member Typedef Documentation

◆ Flywheel

◆ Flywheels

using fang::turret::SimpleAmmoBooster::Flywheels = std::vector<std::unique_ptr<Flywheel> >

Constructor & Destructor Documentation

◆ SimpleAmmoBooster()

fang::turret::SimpleAmmoBooster::SimpleAmmoBooster ( Drivers drivers,
Flywheels  flywheels,
const Config config 
)

You need to std::move the vector of flywheels. Theoretically, it should throw an error should you attempt to copy unique pointers.

Member Function Documentation

◆ boostOff()

void fang::turret::SimpleAmmoBooster::boostOff ( )
override

◆ boostOn()

void fang::turret::SimpleAmmoBooster::boostOn ( )
override

◆ initialize()

void fang::turret::SimpleAmmoBooster::initialize ( )
overridevirtual

Called once when you add the Subsystem to the commandScheduler stored in the Drivers class.

Implements fang::turret::SimpleAmmoBoosterSubsystem.

◆ refresh()

void fang::turret::SimpleAmmoBooster::refresh ( )
overridevirtual

Called in the scheduler's run function assuming this command has been registered with the scheduler. This function should contain code that must be periodically updated and is generic to the subsystem (i.e. updating a control loop generic to this subsystem). This function should not contain command specific control code. When you create a subclass of Subsystem, you should overwrite this virtual function.

Must be virtual otherwise scheduler will refer to this function rather than looking in child for this function.

Reimplemented from tap::control::Subsystem.

◆ update()

void fang::turret::SimpleAmmoBooster::update ( )
override

The documentation for this class was generated from the following files: