DeepSpace
2019
|
An interface command for driving the robot with an xbox controller. More...
#include <DriveWithJoystick.h>
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... | |
An interface command for driving the robot with an xbox controller.
Definition at line 10 of file DriveWithJoystick.h.
DriveWithJoystick::DriveWithJoystick | ( | ) |
Class constructor.
Definition at line 4 of file DriveWithJoystick.cpp.
|
override |
Runs once when IsFinished() returns true.
Definition at line 74 of file DriveWithJoystick.cpp.
|
override |
Called in a loop during Teleop.
Definition at line 43 of file DriveWithJoystick.cpp.
|
inlineprivate |
Called only if the drivemode is set to 1.
Definition at line 34 of file DriveWithJoystick.cpp.
|
override |
Runs once on initalization.
Definition at line 12 of file DriveWithJoystick.cpp.
|
override |
Runs once if the command is forced to stop.
Definition at line 78 of file DriveWithJoystick.cpp.
|
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
Definition at line 71 of file DriveWithJoystick.cpp.
|
private |
Can be 1 or -1. Determines the direction the the robot moves in.
Definition at line 28 of file DriveWithJoystick.h.
|
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.
|
private |
magnitude value that will be passed into DriveTrain::RadialDrive
Definition at line 31 of file DriveWithJoystick.h.
|
private |
The magnitude of the robot is multiplied by this number. Used for slowmode.
Definition at line 29 of file DriveWithJoystick.h.
|
private |
A mnemonic for the driver's controller because we are lazy.
Definition at line 44 of file DriveWithJoystick.h.
|
private |
radial value that will be passed into DriveTrain::RadialDrive
Definition at line 32 of file DriveWithJoystick.h.