projects
/
3501
/
2017steamworks
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a4ea999
)
Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
author
Rohan Rodrigues
<rohanrodrigues19@gmail.com>
Wed, 8 Feb 2017 00:46:11 +0000
(16:46 -0800)
committer
Eric Sandoval
<harpnart@gmail.com>
Sun, 19 Feb 2017 18:42:27 +0000
(10:42 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/OI.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
patch
|
blob
|
blame
|
history
diff --git
a/src/org/usfirst/frc/team3501/robot/Constants.java
b/src/org/usfirst/frc/team3501/robot/Constants.java
index c2fbf7b121dc7e831d783cf066980d32eb0d4f05..e18c8710a61eaf8454116d28d91e1de5c18abc81 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Constants.java
+++ b/
src/org/usfirst/frc/team3501/robot/Constants.java
@@
-44,6
+44,8
@@
public class Constants {
public static final Value HIGH_GEAR = DoubleSolenoid.Value.kForward;
public static final Value LOW_GEAR = DoubleSolenoid.Value.kReverse;
public static final Value HIGH_GEAR = DoubleSolenoid.Value.kForward;
public static final Value LOW_GEAR = DoubleSolenoid.Value.kReverse;
+ public static final double CLIMBER_SPEED = 5;
+
// MOTOR CONTROLLERS
public static final int FRONT_LEFT = 1;
public static final int FRONT_RIGHT = 3;
// MOTOR CONTROLLERS
public static final int FRONT_LEFT = 1;
public static final int FRONT_RIGHT = 3;
@@
-57,11
+59,15
@@
public class Constants {
public static final int ENCODER_RIGHT_B = 3;
public static final SPI.Port GYRO_PORT = SPI.Port.kOnboardCS0;
public static final int ENCODER_RIGHT_B = 3;
public static final SPI.Port GYRO_PORT = SPI.Port.kOnboardCS0;
+
+ public final static int TRIGGER_DRIVE_PORT = 0;
}
public static class Intake {
public static final int INTAKE_ROLLER_PORT = 8;
}
public static class Intake {
public static final int INTAKE_ROLLER_PORT = 8;
+ public final static int HOLD_INTAKE_PORT = 0;
+
}
public static enum Direction {
}
public static enum Direction {
diff --git
a/src/org/usfirst/frc/team3501/robot/OI.java
b/src/org/usfirst/frc/team3501/robot/OI.java
index 00186000ceb5768b3f0a95a03ba80f3f87105d1c..8b5cdacb84b0a96ea8be573add14da2e85042ef7 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/OI.java
+++ b/
src/org/usfirst/frc/team3501/robot/OI.java
@@
-1,5
+1,7
@@
package org.usfirst.frc.team3501.robot;
package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.commands.climber.MaintainClimbedPosition;
+import org.usfirst.frc.team3501.robot.commands.climber.RunWinchContinuous;
import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
@@
-19,6
+21,7
@@
public class OI {
public static Joystick leftJoystick;
public static Joystick rightJoystick;
public static Button toggleWinch;
public static Joystick leftJoystick;
public static Joystick rightJoystick;
public static Button toggleWinch;
+ private boolean isClimbing = false;
public static Button runIndexWheel;
public static Button reverseIndexWheel;
public static Button runIndexWheel;
public static Button reverseIndexWheel;
@@
-72,6
+75,14
@@
public class OI {
decreaseShooterSpeed = new JoystickButton(leftJoystick,
Constants.OI.DECREASE_SHOOTER_SPEED_PORT);
decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed());
decreaseShooterSpeed = new JoystickButton(leftJoystick,
Constants.OI.DECREASE_SHOOTER_SPEED_PORT);
decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed());
+
+ if (!isClimbing) {
+ toggleWinch.whenPressed(new RunWinchContinuous());
+ isClimbing = true;
+ } else {
+ toggleWinch.whenPressed(new MaintainClimbedPosition());
+ isClimbing = false;
+ }
}
public static OI getOI() {
}
public static OI getOI() {
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
index 210199d86e2cb3dc178fb5d289f0446e4147368f..f1fae231c7fd4370cb4ff2901f63ab63b324ded2 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
@@
-18,8
+18,11
@@
import edu.wpi.first.wpilibj.command.Command;
*
*/
public class RunWinchContinuous extends Command {
*
*/
public class RunWinchContinuous extends Command {
+<<<<<<< HEAD
DriveTrain driveTrain = Robot.getDriveTrain();
private double climbingSpeed;
DriveTrain driveTrain = Robot.getDriveTrain();
private double climbingSpeed;
+=======
+>>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
/**
* See JavaDoc comment in class for details
/**
* See JavaDoc comment in class for details
@@
-28,12
+31,22
@@
public class RunWinchContinuous extends Command {
* value range is from -1 to 1
*/
public RunWinchContinuous() {
* value range is from -1 to 1
*/
public RunWinchContinuous() {
+<<<<<<< HEAD
requires(driveTrain);
climbingSpeed = driveTrain.CLIMBER_SPEED;
requires(driveTrain);
climbingSpeed = driveTrain.CLIMBER_SPEED;
+=======
+ requires(Robot.getDriveTrain());
+>>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
}
@Override
protected void initialize() {
}
@Override
protected void initialize() {
+<<<<<<< HEAD
+=======
+ Robot.getDriveTrain().setMotorValues(
+ Robot.getDriveTrain().getClimbingSpeed(),
+ Robot.getDriveTrain().getClimbingSpeed());
+>>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
}
@Override
}
@Override
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
index d8d56aa519bae9aa41d0f0563e7ed2a9b08ea904..2a4ccf7788d3f7a44b6d98a28859b3f0af1830f7 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
@@
-55,6
+55,9
@@
public class DriveTrain extends Subsystem {
private PIDController driveController;
private PIDController gyroController;
private PIDController driveController;
private PIDController gyroController;
+ private boolean isClimbing;
+ private static double CLIMBER_SPEED;;
+
private DriveTrain() {
driveController = new PIDController(driveP, driveI, driveD);
private DriveTrain() {
driveController = new PIDController(driveP, driveI, driveD);
@@
-89,6
+92,8
@@
public class DriveTrain extends Subsystem {
rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.PISTON_MODULE,
Constants.DriveTrain.RIGHT_GEAR_PISTON_FORWARD,
Constants.DriveTrain.RIGHT_GEAR_PISTON_REVERSE);
rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.PISTON_MODULE,
Constants.DriveTrain.RIGHT_GEAR_PISTON_FORWARD,
Constants.DriveTrain.RIGHT_GEAR_PISTON_REVERSE);
+
+ CLIMBER_SPEED = Constants.DriveTrain.CLIMBER_SPEED;
}
public PIDController getDriveController() {
}
public PIDController getDriveController() {
@@
-219,4
+224,13
@@
public class DriveTrain extends Subsystem {
protected void initDefaultCommand() {
setDefaultCommand(new JoystickDrive());
}
protected void initDefaultCommand() {
setDefaultCommand(new JoystickDrive());
}
+
+ public boolean isClimbing() {
+ return this.isClimbing;
+ }
+
+ public double getClimbingSpeed() {
+ return this.CLIMBER_SPEED;
+ }
+
}
}