public class EncoderTest
extends edu.wpi.first.wpilibj.command.Command
Modifier and Type | Field and Description |
---|---|
(package private) double |
leftEncoderPosition |
(package private) double |
leftEncoderVelocity |
(package private) double |
leftMotorValue |
(package private) double |
leftOutput |
protected Drive |
m_drive |
protected PIDController |
m_LPIDController |
protected PIDController |
m_RPIDController |
(package private) double |
rightEncoderPosition |
(package private) double |
rightEncoderVelocity |
(package private) double |
rightMotorValue |
(package private) double |
rightOutput |
Constructor and Description |
---|
EncoderTest() |
Modifier and Type | Method and Description |
---|---|
void |
encoderData()
This class is used for testing.
|
void |
encoderPosition(double leftTargetPosition,
double rightTargetPosition)
This class is used to drive the robot to a certain distance using encoders and PID.
|
void |
encoderVelocity(double leftTargetVelocity,
double rightTargetVelocity)
This class is used to drive the robot at a constant velocity using encoders and PID.
|
protected void |
end() |
protected void |
execute() |
protected void |
initialize() |
protected void |
interrupted() |
protected boolean |
isFinished() |
private double |
makeInRange(double output) |
cancel, doesRequire, getGroup, getName, getSmartDashboardType, getTable, initTable, isCanceled, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setRunWhenDisabled, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
double leftEncoderVelocity
double rightEncoderVelocity
double leftEncoderPosition
double rightEncoderPosition
double leftMotorValue
double rightMotorValue
double leftOutput
double rightOutput
protected Drive m_drive
protected PIDController m_LPIDController
protected PIDController m_RPIDController
protected void initialize()
initialize
in class edu.wpi.first.wpilibj.command.Command
public void encoderVelocity(double leftTargetVelocity, double rightTargetVelocity)
leftTargetVelocity
- value for the velocity of the left wheels, in inches per secondrightTargetVelocity
- value for the velocity of the right wheels, in inches per secondpublic void encoderData()
public void encoderPosition(double leftTargetPosition, double rightTargetPosition)
leftTargetPosition
- value for the position of the left wheels, in inches.rightTargetPosition
- value for the position of the right wheels, in inches.private double makeInRange(double output)
protected boolean isFinished()
isFinished
in class edu.wpi.first.wpilibj.command.Command
protected void end()
end
in class edu.wpi.first.wpilibj.command.Command
protected void interrupted()
interrupted
in class edu.wpi.first.wpilibj.command.Command
protected void execute()
execute
in class edu.wpi.first.wpilibj.command.Command