Use proper case with EncoderBase and DriveBase
This commit is contained in:
parent
667a528b98
commit
e04f4ba346
@ -1,9 +1,9 @@
|
|||||||
package org.usfirst.frc.team2059.robot.commands;
|
package org.usfirst.frc.team2059.robot.commands;
|
||||||
import org.usfirst.frc.team2059.robot.subsystems.Drivebase;
|
import org.usfirst.frc.team2059.robot.subsystems.DriveBase;
|
||||||
import org.usfirst.frc.team2059.robot.subsystems.Encoderbase;
|
import org.usfirst.frc.team2059.robot.subsystems.EncoderBase;
|
||||||
import edu.wpi.first.wpilibj.command.Command;
|
import edu.wpi.first.wpilibj.command.Command;
|
||||||
public abstract class CommandBase extends Command {
|
public abstract class CommandBase extends Command {
|
||||||
protected static Encoderbase encoderbase = new Encoderbase();
|
protected static EncoderBase encoderBase = new EncoderBase();
|
||||||
protected static Drivebase drivebase = new Drivebase();
|
protected static DriveBase driveBase = new DriveBase();
|
||||||
}
|
}
|
||||||
// vim: sw=2:ts=2:sts=2
|
// vim: sw=2:ts=2:sts=2
|
||||||
|
@ -3,7 +3,7 @@ import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
|||||||
import org.usfirst.frc.team2059.robot.structs.EncoderValues;
|
import org.usfirst.frc.team2059.robot.structs.EncoderValues;
|
||||||
public class LogEncoder extends CommandBase {
|
public class LogEncoder extends CommandBase {
|
||||||
public LogEncoder() {
|
public LogEncoder() {
|
||||||
requires(encoderbase);
|
requires(encoderBase);
|
||||||
}
|
}
|
||||||
protected void initialize() {
|
protected void initialize() {
|
||||||
}
|
}
|
||||||
@ -13,7 +13,7 @@ public class LogEncoder extends CommandBase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
protected void execute() {
|
protected void execute() {
|
||||||
EncoderValues values = encoderbase.getValues();
|
EncoderValues values = encoderBase.getValues();
|
||||||
System.out.println("==== Encoder log ====");
|
System.out.println("==== Encoder log ====");
|
||||||
System.out.println("Count : " + values.getCount());
|
System.out.println("Count : " + values.getCount());
|
||||||
System.out.println("Distance : " + values.getDistance());
|
System.out.println("Distance : " + values.getDistance());
|
||||||
|
@ -2,7 +2,7 @@ package org.usfirst.frc.team2059.robot.commands;
|
|||||||
import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
||||||
public class ResetEncoder extends CommandBase {
|
public class ResetEncoder extends CommandBase {
|
||||||
public ResetEncoder() {
|
public ResetEncoder() {
|
||||||
requires(encoderbase);
|
requires(encoderBase);
|
||||||
}
|
}
|
||||||
protected void initialize() {
|
protected void initialize() {
|
||||||
}
|
}
|
||||||
@ -10,7 +10,7 @@ public class ResetEncoder extends CommandBase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
protected void execute() {
|
protected void execute() {
|
||||||
encoderbase.resetEncoder();
|
encoderBase.resetEncoder();
|
||||||
}
|
}
|
||||||
protected void end() {
|
protected void end() {
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import org.usfirst.frc.team2059.robot.RobotMap;
|
|||||||
import org.usfirst.frc.team2059.robot.commands.Drive;
|
import org.usfirst.frc.team2059.robot.commands.Drive;
|
||||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||||
import edu.wpi.first.wpilibj.CANTalon;
|
import edu.wpi.first.wpilibj.CANTalon;
|
||||||
public class Drivebase extends Subsystem {
|
public class DriveBase extends Subsystem {
|
||||||
CANTalon leftMotorOne = new CANTalon(RobotMap.driveLeftMotorOne);
|
CANTalon leftMotorOne = new CANTalon(RobotMap.driveLeftMotorOne);
|
||||||
CANTalon leftMotorTwo = new CANTalon(RobotMap.driveLeftMotorTwo);
|
CANTalon leftMotorTwo = new CANTalon(RobotMap.driveLeftMotorTwo);
|
||||||
CANTalon rightMotorOne = new CANTalon(RobotMap.driveRightMotorOne);
|
CANTalon rightMotorOne = new CANTalon(RobotMap.driveRightMotorOne);
|
||||||
|
@ -4,7 +4,7 @@ import org.usfirst.frc.team2059.robot.commands.Drive;
|
|||||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||||
import edu.wpi.first.wpilibj.Encoder;
|
import edu.wpi.first.wpilibj.Encoder;
|
||||||
import org.usfirst.frc.team2059.robot.structs.EncoderValues;
|
import org.usfirst.frc.team2059.robot.structs.EncoderValues;
|
||||||
public class Encoderbase extends Subsystem {
|
public class EncoderBase extends Subsystem {
|
||||||
Encoder enc = new Encoder(0, 1, false, Encoder.EncodingType.k4X);
|
Encoder enc = new Encoder(0, 1, false, Encoder.EncodingType.k4X);
|
||||||
public void initDefaultCommand() {
|
public void initDefaultCommand() {
|
||||||
//TODO: Not sure if we need a default command, not settingo one
|
//TODO: Not sure if we need a default command, not settingo one
|
||||||
|
Loading…
Reference in New Issue
Block a user