DeepSpace  2019
TriggerDrive Class Reference

An interface command for driving the robot with an xbox controller. More...

#include <TriggerDrive.h>

Inheritance diagram for TriggerDrive:

Public Member Functions

 TriggerDrive ()
 Class constructor. More...
 
void Initialize () override
 Runs once on initalization. More...
 
void Execute () override
 Called in a loop during Teleop. More...
 
bool IsFinished () override
 
void End () override
 Runs once when IsFinished() returns true. More...
 
void Interrupted () override
 Runs once if the command is forced to stop. More...
 

Private Attributes

int directionMultiplier
 Can be 1 or -1. Determines the direction the the robot moves in. More...
 
double speedMultiplier
 The speed of the robot is multiplied by this number. Used for slowmode. More...
 
double speed
 Speed value that will be passed into DriveTrain::ArcadeDrive. More...
 
double rotation
 Rotation value that will be passed into DriveTrain::ArcadeDrive. More...
 
double speedOutput = 0.0
 
double rotationOutput = 0.0
 
frc::XboxController * pJoyDrive
 A mnemonic for the driver's controller because we are lazy. More...
 

Detailed Description

An interface command for driving the robot with an xbox controller.

Definition at line 12 of file TriggerDrive.h.

Constructor & Destructor Documentation

◆ TriggerDrive()

TriggerDrive::TriggerDrive ( )

Class constructor.

Definition at line 4 of file TriggerDrive.cpp.

Member Function Documentation

◆ End()

void TriggerDrive::End ( )
override

Runs once when IsFinished() returns true.

Definition at line 84 of file TriggerDrive.cpp.

◆ Execute()

void TriggerDrive::Execute ( )
override

Called in a loop during Teleop.

Definition at line 25 of file TriggerDrive.cpp.

◆ Initialize()

void TriggerDrive::Initialize ( )
override

Runs once on initalization.

Definition at line 12 of file TriggerDrive.cpp.

◆ Interrupted()

void TriggerDrive::Interrupted ( )
override

Runs once if the command is forced to stop.

Definition at line 88 of file TriggerDrive.cpp.

◆ IsFinished()

bool TriggerDrive::IsFinished ( )
override

Used to tell wpilib if the command is fully finished. This should never return true Because we always want to be able to drive the bot during teleop

Returns
True if command is finished, else false

Definition at line 78 of file TriggerDrive.cpp.

Member Data Documentation

◆ directionMultiplier

int TriggerDrive::directionMultiplier
private

Can be 1 or -1. Determines the direction the the robot moves in.

Definition at line 30 of file TriggerDrive.h.

◆ pJoyDrive

frc::XboxController* TriggerDrive::pJoyDrive
private

A mnemonic for the driver's controller because we are lazy.

Definition at line 38 of file TriggerDrive.h.

◆ rotation

double TriggerDrive::rotation
private

Rotation value that will be passed into DriveTrain::ArcadeDrive.

Definition at line 34 of file TriggerDrive.h.

◆ rotationOutput

double TriggerDrive::rotationOutput = 0.0
private

Definition at line 36 of file TriggerDrive.h.

◆ speed

double TriggerDrive::speed
private

Speed value that will be passed into DriveTrain::ArcadeDrive.

Definition at line 33 of file TriggerDrive.h.

◆ speedMultiplier

double TriggerDrive::speedMultiplier
private

The speed of the robot is multiplied by this number. Used for slowmode.

Definition at line 31 of file TriggerDrive.h.

◆ speedOutput

double TriggerDrive::speedOutput = 0.0
private

Definition at line 35 of file TriggerDrive.h.


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