public Manipulation(int in1,int in2,int out) { input1 = new Spark(in1); input2 = new Spark(in2); output = new CANTalon(out); output.changeControlMode(TalonControlMode.PercentVbus); }
public GearPlacer(int m) { state = GearPlacerState.Waiting; M = new Spark(m); motorSpeedOpen = Config.getSetting("gearMotorSpeedOpen", .4); motorSpeedClose = Config.getSetting("gearMotorSpeedClose", 0.25); }
public static void init() { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS leftSideLeftPaddle = new Spark(0); LiveWindow.addActuator("LeftSide", "LeftPaddle", (Spark) leftSideLeftPaddle); leftSideLeftOut = new DigitalInput(0); LiveWindow.addSensor("LeftSide", "LeftOut", leftSideLeftOut); leftSideLeftIn = new DigitalInput(2); LiveWindow.addSensor("LeftSide", "LeftIn", leftSideLeftIn); rightSideRightPaddle = new Spark(1); LiveWindow.addActuator("RightSide", "RightPaddle", (Spark) rightSideRightPaddle); rightSideRightOut = new DigitalInput(1); LiveWindow.addSensor("RightSide", "RightOut", rightSideRightOut); rightSideRightIn = new DigitalInput(3); LiveWindow.addSensor("RightSide", "RightIn", rightSideRightIn); gearGate = new Spark(2); LiveWindow.addActuator("Gear", "Gate", (Spark) gearGate); gearGearIsIn = new DigitalInput(4); LiveWindow.addSensor("Gear", "GearIsIn", gearGearIsIn); // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS }
public Shooter() { isCocked = false; motor = new Spark(RobotMap.ShooterMap.PWM_MOTOR); motor.setInverted(RobotMap.ShooterMap.INV_MOTOR); solenoid = new DoubleSolenoid(RobotMap.ShooterMap.SOL_FORWARD, RobotMap.ShooterMap.SOL_REVERSE); }
public Intake() { motor = new Spark(RobotMap.IntakeMap.PWM_MOTOR); motor.setInverted(RobotMap.IntakeMap.INV_MOTOR); limit = new DigitalInput(RobotMap.IntakeMap.DIO_LIMIT); stop(); }
public wheelIntake() { leftIntakeMotor = new Spark(0); rightIntakeMotor = new Spark(1); }
/** * Creates a new shooter object for the 2017 season, SteamWorks * * @param controller * The motor controller which runs the flywheel. * @param ballLoaderSensor * Detects if there's a ball ready to be fired. * @param elevator * The motor controller which loads the loader elevator * @param acceptableFlywheelSpeedError * The error we can handle on the flywheel without losing * accuracy * @param visionTargeting * Our vision processor object, used to target the high boiler. * @param acceptableGimbalError * The acceptable angular angle, in degrees, the gimbal turret is * allowed to be off. * @param gimbalMotor * The motor controller the turret is run on * @param agitatorMotor * The motor controller the agitator motor is connected to * @param distanceSensor * TODO * @param gimbalEnc * The potentiometer that reads the bearing of the turret. */ public Shooter (CANTalon controller, IRSensor ballLoaderSensor, Spark elevator, double acceptableFlywheelSpeedError, ImageProcessor visionTargeting, double acceptableGimbalError, CANTalon gimbalMotor, Victor agitatorMotor, UltraSonic distanceSensor) { this.flywheelController = controller; this.elevatorSensor = ballLoaderSensor; this.elevatorController = elevator; this.acceptableError = acceptableFlywheelSpeedError; this.visionTargeter = visionTargeting; this.gimbalMotor = gimbalMotor; this.agitatorMotor = agitatorMotor; this.distanceSensor = distanceSensor; }
public Climber(int c1, int c2) { climber1 = new Spark(c1); climber2 = new Spark(c2); }
public static void initialize() { if (initialized) return; // reset trigger init time initTriggerTime = Utility.getFPGATime(); // create and reset collector relay collectorSolenoid = new Spark(HardwareIDs.COLLECTOR_SOLENOID_PWM_ID); // create and reset gear tray spark & relay gearTrayRelay = new Relay(HardwareIDs.GEAR_TRAY_RELAY_CHANNEL_1,Relay.Direction.kForward); gearTrayRelay.set(Relay.Value.kOff); gearTrayRelay2 = new Relay(HardwareIDs.GEAR_TRAY_RELAY_CHANNEL_2,Relay.Direction.kForward); gearTrayRelay2.set(Relay.Value.kOff); // create motors & servos transportMotor = new Spark(HardwareIDs.TRANSPORT_PWM_ID); collectorMotor = new CANTalon(HardwareIDs.COLLECTOR_TALON_ID); agitatorServo = new Spark(HardwareIDs.AGITATOR_PWM_ID); // continuous servo control modeled as Spark PWM feederMotor = new CANTalon(HardwareIDs.FEEDER_TALON_ID); shooterMotor = new CANTalon(HardwareIDs.SHOOTER_TALON_ID); // set up shooter motor sensor shooterMotor.reverseSensor(false); shooterMotor.setFeedbackDevice(FeedbackDevice.QuadEncoder); // FOR REFERENCE ONLY: //shooterMotor.configEncoderCodesPerRev(12); // use this ONLY if you are NOT reading Native units // USE FOR DEBUG ONLY: configure shooter motor for open loop speed control //shooterMotor.changeControlMode(TalonControlMode.PercentVbus); // configure shooter motor for closed loop speed control shooterMotor.changeControlMode(TalonControlMode.Speed); shooterMotor.configNominalOutputVoltage(+0.0f, -0.0f); shooterMotor.configPeakOutputVoltage(+12.0f, -12.0f); // set PID(F) for shooter motor (one profile only) shooterMotor.setProfile(0); shooterMotor.setP(3.45); shooterMotor.setI(0); shooterMotor.setD(0.5); shooterMotor.setF(9.175); // make sure all motors are off resetMotors(); gamepad = new Joystick(HardwareIDs.GAMEPAD_ID); initialized = true; }
public static void initialize() { if (initialized) return; // reset trigger init time initTriggerTime = Utility.getFPGATime(); // create and reset collector relay collectorSolenoid = new Spark(HardwareIDs.COLLECTOR_SOLENOID_PWM_ID); // create and reset gear tray spark & relay gearTrayRelay = new Relay(HardwareIDs.GEAR_TRAY_RELAY_CHANNEL_1,Relay.Direction.kForward); gearTrayRelay.set(Relay.Value.kOff); gearTrayRelay2 = new Relay(HardwareIDs.GEAR_TRAY_RELAY_CHANNEL_2,Relay.Direction.kForward); gearTrayRelay2.set(Relay.Value.kOff); // create motors & servos transportMotor = new Spark(HardwareIDs.TRANSPORT_PWM_ID); collectorMotor = new CANTalon(HardwareIDs.COLLECTOR_TALON_ID); agitatorServo = new Spark(HardwareIDs.AGITATOR_PWM_ID); // continuous servo control modeled as Spark PWM feederMotor = new CANTalon(HardwareIDs.FEEDER_TALON_ID); shooterMotor = new CANTalon(HardwareIDs.SHOOTER_TALON_ID); // set up shooter motor sensor shooterMotor.reverseSensor(false); shooterMotor.setFeedbackDevice(FeedbackDevice.QuadEncoder); // FOR REFERENCE ONLY: //shooterMotor.configEncoderCodesPerRev(12); // use this ONLY if you are NOT reading Native units // USE FOR DEBUG ONLY: configure shooter motor for open loop speed control //shooterMotor.changeControlMode(TalonControlMode.PercentVbus); // configure shooter motor for closed loop speed control shooterMotor.changeControlMode(TalonControlMode.Speed); shooterMotor.configNominalOutputVoltage(+0.0f, -0.0f); shooterMotor.configPeakOutputVoltage(+12.0f, -12.0f); // set PID(F) for shooter motor (one profile only) shooterMotor.setProfile(0); shooterMotor.setP(P_COEFF); shooterMotor.setI(I_COEFF); shooterMotor.setD(D_COEFF); shooterMotor.setF(F_COEFF); // make sure all motors are off resetMotors(); gamepad = new Joystick(HardwareIDs.GAMEPAD_ID); initialized = true; }
/** * Constructor */ private Shooter() { left = new Spark(SHOOTER_LEFT); right = new Spark(SHOOTER_RIGHT); launcher = new DoubleSolenoid(1, LAUNCHER_EXT, LAUNCHER_RET); }
public SpeedControllerSubsystem(SpeedControllerSubsystemType type, final int channel) { switch(type) { case CAN_JAGUAR: this._controller = new CANJaguar(channel); break; case CAN_TALON: this._controller = new CANTalon(channel); break; case JAGUAR: this._controller = new Jaguar(channel); break; case SD540: this._controller = new SD540(channel); break; case SPARK: this._controller = new Spark(channel); break; case TALON: this._controller = new Talon(channel); break; case TALON_SRX: this._controller = new TalonSRX(channel); break; case VICTOR: this._controller = new Victor(channel); break; case VICTOR_SP: this._controller = new VictorSP(channel); break; default: break; } }
public TurtleSpark(int port, boolean isReversed) { v = new Spark(port); this.isReversed = isReversed; }
public Chassis() { rightMotor = new Spark(4); leftMotor = new Spark(RobotMap.LEFT_MOTOR); drive = new RobotDrive(rightMotor, leftMotor); this.drive.setInvertedMotor(MotorType.kFrontLeft, true); this.drive.setInvertedMotor(MotorType.kFrontRight, true); }
public static void initialize() { if (initialized) return; motorL = new Spark(LEFT_SPARK_ID); motorR = new Spark(RIGHT_SPARK_ID); driveControl = new DriveControl(); Controller.initialize(); initialized = true; }
/** * Create a motor driven by a <a href="http://www.revrobotics.com/SPARK">RevRobotics Spark Motor Controller</a> on the * specified channel, with a custom speed limiting function. * * @param channel the channel the controller is connected to * @param speedLimiter function that will be used to limit the speed (input voltage); may not be null * @return a motor on the specified channel */ public static Motor spark(int channel, DoubleToDoubleFunction speedLimiter) { return new HardwareSpark(new Spark(channel), SPEED_LIMITER); }