DeepSpace  2019
DriveTrain Class Reference

A subsystem that interfaces with the drivebase on the robot. More...

#include <DriveTrain.h>

Inheritance diagram for DriveTrain:

Public Member Functions

 DriveTrain ()
 Class constructor. More...
 
void InitDefaultCommand () override
 Initalizes the default command for this subsystem (DriveWithJoystick) More...
 
void ArcadeDrive (double xSpeed, double zRotation)
 
void TankDrive (double leftSpeed, double rightSpeed)
 
void RadialDrive (double magnitude, double radial)
 
void RawDrive (double l, double r)
 
void Coast ()
 
void Break ()
 

Private Attributes

can::WPI_TalonSRX * pLeftFrontMotor
 Pointer for left front motor. More...
 
can::WPI_TalonSRX * pLeftRearMotor
 Pointer for left rear motor. More...
 
can::WPI_TalonSRX * pRightFrontMotor
 Pointer for right front motor. More...
 
can::WPI_TalonSRX * pRightRearMotor
 Pointer for right rear motor. More...
 
rr::PIDControllerpArcadeController
 
frc::DifferentialDrive * pRobotDrive
 Pointer for a differential drivebase made up of 2 motor pairs. More...
 

Detailed Description

A subsystem that interfaces with the drivebase on the robot.

Definition at line 13 of file DriveTrain.h.

Constructor & Destructor Documentation

◆ DriveTrain()

DriveTrain::DriveTrain ( )

Class constructor.

Definition at line 3 of file DriveTrain.cpp.

Member Function Documentation

◆ ArcadeDrive()

void DriveTrain::ArcadeDrive ( double  xSpeed,
double  zRotation 
)

Pass data to wpilib's ArcadeDrive

Parameters
xSpeedForward speed (form -1 to 1)
zRotationRotation (from -1 to 1)

Definition at line 53 of file DriveTrain.cpp.

◆ Break()

void DriveTrain::Break ( )

Definition at line 96 of file DriveTrain.cpp.

◆ Coast()

void DriveTrain::Coast ( )

Definition at line 88 of file DriveTrain.cpp.

◆ InitDefaultCommand()

void DriveTrain::InitDefaultCommand ( )
override

Initalizes the default command for this subsystem (DriveWithJoystick)

Definition at line 49 of file DriveTrain.cpp.

◆ RadialDrive()

void DriveTrain::RadialDrive ( double  magnitude,
double  radial 
)

Drive with circles

Parameters
magnitudeMagnitude modifier for the radius output
radialValue that is computed into the outside motor's basic output

Definition at line 64 of file DriveTrain.cpp.

◆ RawDrive()

void DriveTrain::RawDrive ( double  l,
double  r 
)

Definition at line 83 of file DriveTrain.cpp.

◆ TankDrive()

void DriveTrain::TankDrive ( double  leftSpeed,
double  rightSpeed 
)

Passes data to wpilib's TankDrive

Parameters
leftSpeedleft motor speed
rightSpeedright motor speed

Definition at line 59 of file DriveTrain.cpp.

Member Data Documentation

◆ pArcadeController

rr::PIDController* DriveTrain::pArcadeController
private

Definition at line 52 of file DriveTrain.h.

◆ pLeftFrontMotor

can::WPI_TalonSRX* DriveTrain::pLeftFrontMotor
private

Pointer for left front motor.

Definition at line 47 of file DriveTrain.h.

◆ pLeftRearMotor

can::WPI_TalonSRX* DriveTrain::pLeftRearMotor
private

Pointer for left rear motor.

Definition at line 48 of file DriveTrain.h.

◆ pRightFrontMotor

can::WPI_TalonSRX* DriveTrain::pRightFrontMotor
private

Pointer for right front motor.

Definition at line 49 of file DriveTrain.h.

◆ pRightRearMotor

can::WPI_TalonSRX* DriveTrain::pRightRearMotor
private

Pointer for right rear motor.

Definition at line 50 of file DriveTrain.h.

◆ pRobotDrive

frc::DifferentialDrive* DriveTrain::pRobotDrive
private

Pointer for a differential drivebase made up of 2 motor pairs.

Definition at line 54 of file DriveTrain.h.


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