package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
-import org.usfirst.frc.team3501.robot.Lidar;
-import org.usfirst.frc.team3501.robot.MathLib;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CounterBase.EncodingType;
import edu.wpi.first.wpilibj.command.Subsystem;
/***
- * The Shooter consists of a platform and wheel, each controlled by separate
- * motors. The piston controlling the platform pushes the ball onto the wheel.
- * The wheel is controlled by a motor, which is running before the ball is
- * pushed onto the wheel. The spinning wheel propels the ball.
+ * The Shooter consists of a platform and wheel, each controlled by
+ * separate motors. The piston controlling the platform pushes the ball onto the
+ * wheel. The wheel is controlled by a motor, which is running before the ball
+ * is pushed
+ * onto the wheel. The spinning wheel propels the ball.
*
* @author superuser
*
}
public void setSpeed(double speed) {
- speed = MathLib.constrain(speed, -1, 1);
- shooter.set(speed);
- }
-
- // This getDistance() will return the distance using the lidar from the
- // desired target during match. This distance is returned in units of
- // CENTIMETERS.
- public double getDistance() {
- return lidar.getDistance();
+ if (speed > 1.0)
+ shooter.set(1.0);
+ else if (speed < -1.0)
+ shooter.set(-1.0);
+ else
+ shooter.set(speed);
}
public void stop() {
}
// Punch Commands
- public void punch() {
+ public void extendPunch() {
punch.set(Constants.Shooter.punch);
}