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

#include <positional_aim_command.hpp>

Inheritance diagram for fang::turret::PositionalAimCommand:
Collaboration diagram for fang::turret::PositionalAimCommand:

Classes

struct  Config
 

Public Member Functions

 PositionalAimCommand (FieldGimbalSubsystem &gimbal, ITurretInputHandler &input, const Config &config)
 
const char * getName () const override
 
void initialize () override
 
void execute () override
 
void end (bool interrupted) override
 
bool isFinished () const override
 
- Public Member Functions inherited from tap::control::Command
 Command ()
 
virtual ~Command ()
 
mockable subsystem_scheduler_bitmap_t getRequirementsBitwise () const
 
int getGlobalIdentifier () const
 
mockable void addSubsystemRequirement (Subsystem *requirement)
 
virtual bool isReady ()
 

Additional Inherited Members

- Protected Attributes inherited from tap::control::Command
command_scheduler_bitmap_t commandRequirementsBitwise = 0
 

Detailed Description

Unlike aim command, it takes the raw position instead of velocity. Used for autonomous testing and as a precursor to general auto-aim commands

Constructor & Destructor Documentation

◆ PositionalAimCommand()

fang::turret::PositionalAimCommand::PositionalAimCommand ( FieldGimbalSubsystem gimbal,
ITurretInputHandler input,
const Config config 
)

Member Function Documentation

◆ end()

void fang::turret::PositionalAimCommand::end ( bool  interrupted)
overridevirtual

The action to take when the command ends. Called when either the command finishes normally, or when it interrupted/canceled.

Parameters
[in]interruptedwhether the command was interrupted/canceled.

Implements tap::control::Command.

◆ execute()

void fang::turret::PositionalAimCommand::execute ( )
overridevirtual

The main body of a command. Called repeatedly while the command is scheduled by a CommandScheduler.

Implements tap::control::Command.

◆ getName()

const char * fang::turret::PositionalAimCommand::getName ( ) const
inlineoverridevirtual
Returns
the name of the command, to be implemented by derived classes.

Implements tap::control::Command.

◆ initialize()

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

The initial subroutine of a command. Called once when the command is initially scheduled by a CommandScheduler.

Note that command instances are re-used: a single command could be initialized, run, finished, then later initialized again. Ensure that initialize() resets any state stored in the command!

Implements tap::control::Command.

◆ isFinished()

bool fang::turret::PositionalAimCommand::isFinished ( ) const
overridevirtual

Whether the command has finished. Once a Command finishes, the scheduler will call the end() function and un-schedule it. If a Command is naturally finished (i.e. isFinished() == true), then the CommandScheduler will pass in false to end(). If, for example, another Command is added that in turn stops the Command from executing, then the CommandScheduler will pass in true to end().

Returns
whether the command has finished.

Implements tap::control::Command.


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