Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::chassis::CounterStrikeCommand Class Reference

#include <counter_strike_command.hpp>

Inheritance diagram for fang::chassis::CounterStrikeCommand:
Collaboration diagram for fang::chassis::CounterStrikeCommand:

Public Types

using Config = FieldDriftCommand::Config
 

Public Member Functions

 CounterStrikeCommand (HolonomicSubsystem &holonomicSubsystem, const turret::FieldGimbalSubsystem &gimbal, IHolonomicInput &holonomicInput, const Config &config)
 
virtual ~CounterStrikeCommand ()=default
 
const char * getName () const override
 
void execute () override
 
- Public Member Functions inherited from fang::chassis::FieldDriftCommand
 FieldDriftCommand (HolonomicSubsystem &holonomicSubsystem, IHolonomicInput &holonomicInput, const Config &config)
 
virtual ~FieldDriftCommand ()=default
 
const char * getName () const override
 
void initialize () override
 
void execute () override
 
void end (bool interrupted) override
 
bool isFinished () const
 
- 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 ()
 

Protected Member Functions

physics::Velocity2D getFieldTranslation () const
 
RPM getFieldRotation () const
 
- Protected Member Functions inherited from fang::chassis::FieldDriftCommand
physics::Velocity2D getFieldTranslation () const
 
RPM getFieldRotation () const
 

Protected Attributes

const turret::FieldGimbalSubsystemgimbal_
 
const Config kConfig_
 
- Protected Attributes inherited from fang::chassis::FieldDriftCommand
HolonomicSubsystemholonomicSubsystem_
 
IHolonomicInputholonomicInput_
 
const Config kConfig_
 
- Protected Attributes inherited from tap::control::Command
command_scheduler_bitmap_t commandRequirementsBitwise = 0
 

Static Protected Attributes

static constexpr const char * kName {"Counter Strike Global!"}
 
- Static Protected Attributes inherited from fang::chassis::FieldDriftCommand
static constexpr const char * kName {"Field Drift"}
 

Detailed Description

First person shooter motion for holonomic drive. Plain and simple.

This pairs well with a mouse-supported DjiHolonomicInput.

If you face forward, a forward input on the remote will make the robot move forward. Every translation input is rotated to be relative to the turret head.

Member Typedef Documentation

◆ Config

Constructor & Destructor Documentation

◆ CounterStrikeCommand()

fang::chassis::CounterStrikeCommand::CounterStrikeCommand ( HolonomicSubsystem holonomicSubsystem,
const turret::FieldGimbalSubsystem gimbal,
IHolonomicInput holonomicInput,
const Config config 
)

This takes a chassis subsystem and the respective inputHandler

◆ ~CounterStrikeCommand()

virtual fang::chassis::CounterStrikeCommand::~CounterStrikeCommand ( )
virtualdefault

Member Function Documentation

◆ execute()

void fang::chassis::CounterStrikeCommand::execute ( )
overridevirtual

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

Implements tap::control::Command.

Reimplemented in fang::chassis::ShurikenCommand, and fang::chassis::TardisCommand.

◆ getFieldRotation()

RPM fang::chassis::CounterStrikeCommand::getFieldRotation ( ) const
protected

Translates the rotation input on the remote into a rotation where counterclockwise is positive

◆ getFieldTranslation()

physics::Velocity2D fang::chassis::CounterStrikeCommand::getFieldTranslation ( ) const
protected

Returns the fieldwise translation, translating the translation input relative to the turret where forward will make the robot move forwward wherever the turret is looking

◆ getName()

const char * fang::chassis::CounterStrikeCommand::getName ( ) const
overridevirtual
Returns
the name of the command, to be implemented by derived classes.

Implements tap::control::Command.

Reimplemented in fang::chassis::ShurikenCommand, and fang::chassis::TardisCommand.

Member Data Documentation

◆ gimbal_

const turret::FieldGimbalSubsystem& fang::chassis::CounterStrikeCommand::gimbal_
protected

◆ kConfig_

const Config fang::chassis::CounterStrikeCommand::kConfig_
protected

◆ kName

constexpr const char* fang::chassis::CounterStrikeCommand::kName {"Counter Strike Global!"}
staticconstexprprotected

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