added drivebase subsystem and blank command
This commit is contained in:
parent
9f6eeacb8e
commit
cb6be490a4
33
src/org/usfirst/frc/team2059/robot/commands/Drive.java
Normal file
33
src/org/usfirst/frc/team2059/robot/commands/Drive.java
Normal file
@ -0,0 +1,33 @@
|
||||
package org.usfirst.frc.team2059.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Drive extends Command {
|
||||
|
||||
public Drive() {
|
||||
}
|
||||
|
||||
// Called just before this Command runs the first time
|
||||
protected void initialize() {
|
||||
}
|
||||
|
||||
// Called repeatedly when this Command is scheduled to run
|
||||
protected void execute() {
|
||||
}
|
||||
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
protected boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called once after isFinished returns true
|
||||
protected void end() {
|
||||
}
|
||||
|
||||
// Called when another command which requires one or more of the same
|
||||
// subsystems is scheduled to run
|
||||
protected void interrupted() {
|
||||
}
|
||||
}
|
27
src/org/usfirst/frc/team2059/robot/subsystems/Drivebase.java
Normal file
27
src/org/usfirst/frc/team2059/robot/subsystems/Drivebase.java
Normal file
@ -0,0 +1,27 @@
|
||||
package org.usfirst.frc.team2059.robot.subsystems;
|
||||
|
||||
import org.usfirst.frc.team2059.robot.RobotMap;
|
||||
import org.usfirst.frc.team2059.robot.commands.Drive;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||
import edu.wpi.first.wpilibj.CANTalon;
|
||||
|
||||
public class Drivebase extends Subsystem {
|
||||
|
||||
CANTalon leftMotorOne = new CANTalon(RobotMap.driveLeftMotorOne);
|
||||
CANTalon leftMotorTwo = new CANTalon(RobotMap.driveLeftMotorTwo);
|
||||
CANTalon rightMotorOne = new CANTalon(RobotMap.driveRightMotorOne);
|
||||
CANTalon rightMotorTwo = new CANTalon(RobotMap.driveRightMotorOne);
|
||||
|
||||
public void initDefaultCommand() {
|
||||
setDefaultCommand(new Drive());
|
||||
}
|
||||
|
||||
public void driveArcade(double x, double y, double z, double sensitivity){
|
||||
leftMotorOne.set(-y+(x+z));
|
||||
leftMotorTwo.set(-y+(x+z));
|
||||
rightMotorOne.set(y+(x+z));
|
||||
rightMotorTwo.set(y+(x+z));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user