DeepSpace  2019
DriveWithJoystick Class Reference

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

#include <DriveWithJoystick.h>

Inheritance diagram for DriveWithJoystick:

Public Member Functions

 DriveWithJoystick ()
 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 Member Functions

bool getTriggers ()
 Called only if the drivemode is set to 1. More...
 

Private Attributes

int directionMultiplier
 Can be 1 or -1. Determines the direction the the robot moves in. More...
 
double magnitudeMultiplier
 The magnitude of the robot is multiplied by this number. Used for slowmode. More...
 
double magnitude
 magnitude value that will be passed into DriveTrain::RadialDrive More...
 
double radial
 radial value that will be passed into DriveTrain::RadialDrive More...
 
int driveMode
 Used to keep track of the drive mode. More...
 
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 10 of file DriveWithJoystick.h.

Constructor & Destructor Documentation

◆ DriveWithJoystick()

DriveWithJoystick::DriveWithJoystick ( )

Class constructor.

Definition at line 4 of file DriveWithJoystick.cpp.

Member Function Documentation

◆ End()

void DriveWithJoystick::End ( )
override

Runs once when IsFinished() returns true.

Definition at line 74 of file DriveWithJoystick.cpp.

◆ Execute()

void DriveWithJoystick::Execute ( )
override

Called in a loop during Teleop.

Definition at line 43 of file DriveWithJoystick.cpp.

◆ getTriggers()

bool DriveWithJoystick::getTriggers ( )
inlineprivate

Called only if the drivemode is set to 1.

Definition at line 34 of file DriveWithJoystick.cpp.

◆ Initialize()

void DriveWithJoystick::Initialize ( )
override

Runs once on initalization.

Definition at line 12 of file DriveWithJoystick.cpp.

◆ Interrupted()

void DriveWithJoystick::Interrupted ( )
override

Runs once if the command is forced to stop.

Definition at line 78 of file DriveWithJoystick.cpp.

◆ IsFinished()

bool DriveWithJoystick::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 71 of file DriveWithJoystick.cpp.

Member Data Documentation

◆ directionMultiplier

int DriveWithJoystick::directionMultiplier
private

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

Definition at line 28 of file DriveWithJoystick.h.

◆ driveMode

int DriveWithJoystick::driveMode
private

Used to keep track of the drive mode.

driveMode is set depending on what is selected from drivermenu

0 = Joystick 1 = Triggers

Definition at line 42 of file DriveWithJoystick.h.

◆ magnitude

double DriveWithJoystick::magnitude
private

magnitude value that will be passed into DriveTrain::RadialDrive

Definition at line 31 of file DriveWithJoystick.h.

◆ magnitudeMultiplier

double DriveWithJoystick::magnitudeMultiplier
private

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

Definition at line 29 of file DriveWithJoystick.h.

◆ pJoyDrive

frc::XboxController* DriveWithJoystick::pJoyDrive
private

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

Definition at line 44 of file DriveWithJoystick.h.

◆ radial

double DriveWithJoystick::radial
private

radial value that will be passed into DriveTrain::RadialDrive

Definition at line 32 of file DriveWithJoystick.h.


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