/** * A private constructor to prevent multiple instances from being created. */ private Winch(){ winchMotor = new Talon(RobotMap.winchMotor.getInt()); winchInputSwitch = new DigitalInput(RobotMap.winchLimitSwitch.getInt()); winchSolenoid = new MomentaryDoubleSolenoid( RobotMap.winchExtPort.getInt(),RobotMap.winchRetPort.getInt()); winchBallSensor = new AnalogChannel(RobotMap.winchBallSensorPort.getInt()); intakeBallSensor = new AnalogChannel(RobotMap.intakeBallSensorPort.getInt()); ballPresent = new Debouncer(RobotMap.ballPresentTime.getDouble()); ballNotPresent = new Debouncer(RobotMap.ballPresentTime.getDouble()); ballSettled = new Debouncer(RobotMap.ballSettleTime.getDouble()); ballPresentOnWinch = new Debouncer(RobotMap.ballPresentOnWinchTime.getDouble()); winchPotentiometer = new AnalogChannel(RobotMap.potentiometerPort.getInt()); winchEncoder = new AverageEncoder( RobotMap.winchEncoderA.getInt(), RobotMap.winchEncoderB.getInt(), RobotMap.winchEncoderPulsePerRot, RobotMap.winchEncoderDistPerTick, RobotMap.winchEncoderReverse, RobotMap.winchEncodingType, RobotMap.winchSpeedReturnType, RobotMap.winchPosReturnType, RobotMap.winchAvgEncoderVal); winchEncoder.start(); }
public void robotInit(){ driveStick= new JoyStickCustom(1, DEADZONE); secondStick=new JoyStickCustom(2, DEADZONE); frontLeft= new Talon(1); rearLeft= new Talon(2); frontRight= new Talon(3); rearRight= new Talon(4); timer=new Timer(); timer.start(); armM = new Victor(7); rollers =new Victor(6); mainDrive=new RobotDrive(frontLeft,rearLeft,frontRight,rearRight); mainDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight,true); mainDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true); armP = new AnalogPotentiometer(1); distance= new AnalogChannel(2); ultra=new Ultrasonic(6,7); ultra.setAutomaticMode(true); compress=new Compressor(5,1); handJoint=new Pneumatics(3,4); //ultra = new Ultrasonic(6,5); //ultra.setAutomaticMode(true); winch = new Winch(secondStick); }
public InfraredSwitch(int pInfraredDetectorChannel, AnalogChannel pAnalogVoltageMeter, double pHammerLevel, int pOnState, boolean pForceStateChange) { infraredDetector = new AnalogChannel(pInfraredDetectorChannel); analogVoltageMeter = pAnalogVoltageMeter; hammerLevel = pHammerLevel; onState = pOnState; setForceStateChange(pForceStateChange); }
public Potentiometer(int pPotentiometerChannel, AnalogChannel pAnalogVoltageMeter, boolean pReverse) { potentiometer = new AnalogChannel(pPotentiometerChannel); analogVoltageMeter = pAnalogVoltageMeter; scaled = false; scale = 0.0; minValue = 0.0; maxValue = 0.0; reverse = pReverse; }
public Potentiometer(int pPotentiometerChannel, AnalogChannel pAnalogVoltageMeter, boolean pReverse, double pScale, double pMinValue, double pMaxValue) { potentiometer = new AnalogChannel(pPotentiometerChannel); analogVoltageMeter = pAnalogVoltageMeter; scaled = true; scale = pScale; minValue = pMinValue; maxValue = pMaxValue; reverse = pReverse; }
public Sensors() { //initializing everything rightDriveEncoder = new Encoder(4, 3); leftDriveEncoder = new Encoder(2, 1); leftRangeFinder = new AnalogChannel(1, 1); rightRangeFinder = new AnalogChannel(1, 2); rightDriveEncoder.setDistancePerPulse(.08168); }
public void robotInit(){ analog = new AnalogChannel(4); joystick = new LogitechPro(1); attack = new LogitechAttack(2); leftMotor = new Motor(1,"Jaguar Speed Controller"); rightMotor = new Motor(2, "Jaguar Speed Controller"); drive = new DriveTrain(leftMotor, rightMotor); }
public Throttle( String name, int sliderChannel, double voltageRange, int percentChangeBeforeDetection ) { this.name = name; this.slider = new AnalogChannel(sliderChannel); this.voltageRange = Math.abs(voltageRange); this.speedChangeBeforeDetection = inRange(percentChangeBeforeDetection / 100); }
public static void init() { driveTrainRightVictor = new Victor(1, 1); driveTrainLeftVictor = new Victor(1, 3); loaderVictor = new Victor(1, 2); CatapultVictor = new Victor(1, 4); FireSolenoidSpike = new Relay(2); PrimeSolenoidSpike = new Relay(3); lightSpike = new Relay(7); compressorSpike = new Relay(8); gyro = new Gyro(1); ultrasonic = new AnalogChannel(3); limitSwitch = new DigitalInput(3); pressureSwitch = new DigitalInput(2); LiveWindow.addActuator("Drive Train", "Right Victor", (Victor) driveTrainRightVictor); LiveWindow.addActuator("Drive Train", "Left Victor", (Victor) driveTrainLeftVictor); robotDriveTrain = new RobotDrive(driveTrainLeftVictor, driveTrainRightVictor); robotDriveTrain.setSafetyEnabled(true); robotDriveTrain.setExpiration(0.1); robotDriveTrain.setSensitivity(0.5); robotDriveTrain.setMaxOutput(1.0); }
/** * Gyro constructor with a precreated analog channel object. Use this * constructor when the analog channel needs to be shared. There is no * reference counting when an AnalogChannel is passed to the gyro. * * @param channel * The AnalogChannel object that the gyro is connected to. */ public FalconGyro(AnalogChannel channel) { m_analog = channel; if (m_analog == null) { System.err .println("Analog channel supplied to Gyro constructor is null"); } else { m_channelAllocated = false; initGyro(); } }
public RobotHardware() { try { // Initializes the Jaguar motor controllers for driving CANJaguar frontLeftJaguar = new CANJaguar(Constants.FRONT_LEFT_MOTOR_PORT); CANJaguar backLeftJaguar = new CANJaguar(Constants.BACK_LEFT_MOTOR_PORT); CANJaguar frontRightJaguar = new CANJaguar(Constants.FRONT_RIGHT_MOTOR_PORT); CANJaguar backRightJaguar = new CANJaguar(Constants.BACK_RIGHT_MOTOR_PORT); // Initializes the controller for the four driving motors and reverses two of them driveControl = new RobotDrive(frontLeftJaguar, backLeftJaguar, frontRightJaguar, backRightJaguar); driveControl.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true); driveControl.setInvertedMotor(RobotDrive.MotorType.kRearRight, true); } catch (CANTimeoutException ex) { ex.printStackTrace(); } // Initialize joysticks driverJoystick = new Joystick(Constants.DRIVER_JOYSTICK_PORT); secondJoystick = new Joystick(Constants.SECOND_JOYSTICK_PORT); sonar = new AnalogChannel(Constants.ANALOG_SONAR_PORT); compressor = new Compressor(Constants.COMPRESSOR_PRESSURE_SWITCH_CHANNEL, Constants.COMPRESSOR_RELAY_CHANNEL); doubleSol = new DoubleSolenoid(Constants.DOUBLE_SOLENOID_FORWARD_CHANNEL, Constants.DOUBLE_SOLENOID_REVERSE_CHANNEL); sol1 = new Solenoid(Constants.SOLENOID_PORT_1); sol2 = new Solenoid(Constants.SOLENOID_PORT_2); }
public Piston(int extendPort, int retractPort, int readerport){ extend = new Solenoid(extendPort); retract = new Solenoid(retractPort); isSolenoid = true; pressureReaderport = readerport; ai = new AnalogChannel(pressureReaderport); }
public Elevator() { super("Elevator", Kp, Ki, Kd); motor = new Jaguar(RobotMap.elevatorMotor); pot = new AnalogChannel(RobotMap.elevatorPot); // Set default position and start PID setSetpoint(STOW); enable(); }
public Wrist() { super("Wrist", Kp, Ki, Kd); motor = new Victor(RobotMap.wristMotor); pot = new AnalogChannel(RobotMap.wristPot); // Set the starting setpoint and have PID start running in the background setSetpoint(STOW); enable(); // - Enables the PID controller. }
public Canon(ReserveBallon reserve) { mReserve = reserve; mjControl = JoystickDevice.GetCoPilot(); mjAngleDeTir = new Jaguar(PwmDevice.mCanonAngleDeTir); mfAngleDeTir = new FiltrePasseBas(25); mjOrientationDeTir = new Jaguar(PwmDevice.mCanonOrientationDeTir); mfOrientationDeTir = new FiltrePasseBas(25); msTir = new Solenoid(SolenoidDevice.mCanonTir); msTirRev = new Solenoid(SolenoidDevice.mCanonTirRev); mdLimiteRotationGauche = new DigitalInput(DigitalDevice.mCanonLimiteRotationGauche); mdLimiteRotationDroite = new DigitalInput(DigitalDevice.mCanonLimiteRotationDroite); mjCanonHaut = new Jaguar(PwmDevice.mCanonMoteurHaut); mfCanonHaut = new FiltrePasseBas(25); macCanonHaut = new AnalogChannel(AnalogDevice.mCanonMoteurHaut); mpidCanonHaut = new PIDController(Kp,Ki, Kd, macCanonHaut, mjCanonHaut); mpidCanonHaut.setInputRange(0.0, 4095.0); mpidCanonHaut.setOutputRange(-1.0, 1.0); mjCanonBas = new Jaguar(PwmDevice.mCanonMoteurBas); mfCanonBas = new FiltrePasseBas(25); macCanonBas = new AnalogChannel(AnalogDevice.mCanonMoteurBas); mpidCanonBas = new PIDController(Kp,Ki, Kd, macCanonBas, mjCanonBas); mpidCanonBas.setInputRange(0.0, 4095.0); mpidCanonBas.setOutputRange(-1.0, 1.0); mRangeFinder = new RangeFinder(5); maAngle = new ADXL345_I2C(1, ADXL345_I2C.DataFormat_Range.k8G); maRef = new ADXL345_I2C(1, ADXL345_I2C.DataFormat_Range.k8G); msTir.set(false); msTirRev.set(true); }
private Tilter() { leadscrew = new BoundedTalon(Constants.TILTER_CHANNEL, Constants.TILTER_UPPER_LIMIT_SWITCH_CHANNEL, Constants.TILTER_LOWER_LIMIT_SWITCH_CHANNEL); accel = new ADXL345_I2C(Constants.ACCELEROMETER_CHANNEL, ADXL345_I2C.DataFormat_Range.k2G); accelMeasurements = new Vector(); updateAccel(); pendulum = new AnalogChannel(Constants.PENDULUM_CHANNEL); enc = new Encoder(Constants.LEADSCREW_ENCODER_A_CHANNEL, Constants.LEADSCREW_ENCODER_B_CHANNEL); enc.setDistancePerPulse(Constants.TILTER_DISTANCE_PER_PULSE); enc.start(); Thread t = new Thread(new Runnable() { public void run() { Tilter.net = new NetworkIO(); } }); t.start(); controller = new PIDController(Constants.PVAL_T, Constants.IVAL_T, Constants.DVAL_T, enc, new PIDOutput() { public void pidWrite(double output) { setLeadscrewMotor(output); } }); controller.setPercentTolerance(0.01); controller.disable(); updatePID(); initialReadingTimer = new Timer(); initialReadingTimer.schedule(new TimerTask() { public void run() { initialLeadLength = calcLeadscrewLength(getAveragedAccelBasedAngle()); } }, INITIAL_ANGLE_MEASUREMENT_DELAY); }
public O_TenPotPIDSource(double initValue, int AnalogInChannel){ this.initValue = initValue; this.pot = new AnalogChannel(AnalogInChannel); }
public void init(Environment environment) { sonar = new AnalogChannel(RobotMap.SONAR_CHANNEL); }
public Ultrasonic() { ultrasonic = new AnalogChannel(ULTRASONIC_CHANNEL); }
public WsAnalogInput(int channel) { this.analogValue = new DoubleSubject("AnalogInput" + channel); this.input = new AnalogChannel(channel); analogValue.setValue(startState.getValue()); }
public static void init() { visionFrontSonar = new AnalogChannel(2); visionFrontSonarSolenoidRelay = new Solenoid(3); ColorLedsRelay = new Relay(3); FlashingLedsRelay = new Relay(2); m_compressor = new Compressor(7, 1); canonAngleAllWheelAngleMotor = new Talon(1, 4); LiveWindow.addActuator("CanonAngle", "AllWheelAngleMotor", (Talon) canonAngleAllWheelAngleMotor); canonAngleAnglePot = new AnalogChannel(1, 4); LiveWindow.addSensor("CanonAngle", "AnglePot", canonAngleAnglePot); canonAngleUpperAngleLimitSwitch = new DigitalInput(1, 1); LiveWindow.addSensor("CanonAngle", "UpperAngleLimitSwitch", canonAngleUpperAngleLimitSwitch); canonAngleLowerAngleLimitSwitch = new DigitalInput(1, 2); LiveWindow.addSensor("CanonAngle", "LowerAngleLimitSwitch", canonAngleLowerAngleLimitSwitch); canonSpinnerAllWheelSpinnerMotor = new Talon(1, 3); LiveWindow.addActuator("CanonSpinner", "AllWheelSpinnerMotor", (Talon) canonSpinnerAllWheelSpinnerMotor); canonShooterShooterSolenoid = new DoubleSolenoid(1, 1, 2); LiveWindow.addActuator("CanonShooter", "ShooterSolenoid", canonShooterShooterSolenoid); canonShooterShooterSolenoid.set(DoubleSolenoid.Value.kReverse); driveTrainAllWheelRightMotor = new Talon(1, 2); LiveWindow.addActuator("DriveTrain", "AllWheelRightMotor", (Talon) driveTrainAllWheelRightMotor); driveTrainAllWheelLeftMotor = new Talon(1, 1); LiveWindow.addActuator("DriveTrain", "AllWheelLeftMotor", (Talon) driveTrainAllWheelLeftMotor); driveTrainAllWheelRobotDrive = new RobotDrive(driveTrainAllWheelLeftMotor, driveTrainAllWheelRightMotor); driveTrainAllWheelRobotDrive.setSafetyEnabled(true); driveTrainAllWheelRobotDrive.setExpiration(0.1); driveTrainAllWheelRobotDrive.setSensitivity(0.5); driveTrainAllWheelRobotDrive.setMaxOutput(1.0); driveTrainAllWheelRobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false); driveTrainAllWheelRobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, false); driveTrainRobotFrameGyro = new Gyro(1, 1); LiveWindow.addSensor("DriveTrain", "RobotFrameGyro", driveTrainRobotFrameGyro); driveTrainRobotFrameGyro.setSensitivity(0.007); }
public Tusks(){ brake = new DoubleSolenoid(Ports.SHOOTER_BRAKE_1, Ports.SHOOTER_BRAKE_2); anglePot = new AnalogChannel(Ports.SHOOTER_ANGLE_POT); angler = new Talon(Ports.SHOOTER_ANGLE_CONTROL); state = STABLE; }
public void init() { motorLeft = new Talon(1); motorRight = new Talon(2); System.out.println("[INFO] TALON[1&2]: Created!"); elToro1 = new Talon(3); elToro2 = new Talon(4); System.out.println("[INFO] TALON[3&4]: Created!"); robotdrive = new RobotDriveSteering(motorLeft, motorRight); robotdrive.setInvertedMotor(RobotDriveSteering.MotorType.kRearLeft, true); robotdrive.setInvertedMotor(RobotDriveSteering.MotorType.kRearRight, true); compressor = new Compressor(1, 1); // presureSwitchDigitalInput, RelayOut compressor.start(); wormgear = new Relay(2); spreader = new Relay(3); System.out.println("[INFO] RELAY[1&2&3]: Created!"); joystick = new Joystick(1); //joystick2 = new Joystick(2); System.out.println("[INFO] JOYSTICK[1&2]: Created!"); cock = new Solenoid(1); uncock = new Solenoid(2); lock = new Solenoid(3); fire = new Solenoid(4); System.out.println("[INFO] Digital I/O: Enabled."); sonic = new Ultrasonic(4, 2); sonic.setEnabled(true); sonic2 = new AnalogChannel(3); pot = new AnalogPotentiometer(2, 10); autonomousTimer = new Timer(); t = new Timer(); LCD = DriverStationLCD.getInstance(); ds = DriverStation.getInstance(); System.out.println("[INFO] Robot Initialized"); }
public AnalogSwitch(int channel) { swit = new AnalogChannel(channel); }
public AnalogSwitch(int card, int channel) { swit = new AnalogChannel(card, channel); }
/** * light of robot and the sonar */ public IndicatorLight() { sonar = new AnalogChannel(RobotMap.sonar); light = new Relay(RobotMap.light, Relay.Direction.kForward); }
public BTData(BTDebugger debug) { //DRIVETRAIN MOTORS if (Constants.IS_DT_CANBUS) { motorFactDT = new BTCanJaguar.Factory(Constants.IS_DT_VOLTAGE,debug); } else { motorFactDT = new BTJaguar.Factory(debug); } if (Constants.IS_SHOOTER_CANBUS) { motorFactManip = new BTCanJaguar.Factory(Constants.IS_SHOOTER_VOLTAGE, debug); } else { motorFactManip = new BTJaguar.Factory(debug); } MOTOR_R = motorFactDT.makeMotor(Constants.RIGHT_MOTOR_PORT); MOTOR_L = motorFactDT.makeMotor(Constants.LEFT_MOTOR_PORT); //SHOOTER MOTORS MOTOR_Winch = motorFactManip.makeMotor(Constants.WINCH_MOTOR_PORT); MOTOR_Collector = motorFactManip.makeMotor(Constants.COLLECTOR_MOTOR_PORT); MOTOR_Hinge = motorFactManip.makeMotor(Constants.HINGE_MOTOR_PORT); //DRIVETRAIN ENCODERS SONAR_Drive = new BTSonar(Constants.SONAR_PORT, 1024, true); ENCODER_LeftDrive = new BTEncoder(Constants.LEFT_ENCODE_A, Constants.LEFT_ENCODE_B); ENCODER_RightDrive = new BTEncoder(Constants.RIGHT_ENCODE_A, Constants.RIGHT_ENCODE_B); //(86.4/128.0) ENCODER_LeftDrive.setDistancePerPulse((Constants.WHEEL_CIRCUMFERENCE/Constants.ENCODER_TEETH)); ENCODER_RightDrive.setDistancePerPulse(Constants.WHEEL_CIRCUMFERENCE/Constants.ENCODER_TEETH); ENCODER_ManipWinch = new BTEncoder(Constants.MANIP_SHOOT_ENCODE_A, Constants.MANIP_SHOOT_ENCODE_B); ENCODER_ManipWinch.setDistancePerPulse(Constants.MANIP_WHEEL_CIRCUMFERENCE/Constants.ENCODER_TEETH); DI_maxLimitSwitch = new BTDigitalInput(Constants.MAX_LIMIT_SWITCH_PORT); DI_minLimitSwitch = new BTDigitalInput(Constants.MIN_LIMIT_SWITCH_PORT); DI_winchLimit = new BTDigitalInput(Constants.WINCH_LIMIT_SWITCH_PORT); //ballDetection = new DigitalInput(Constants.BALL_DETECTION_PORT); POT_Hinge = new BTAnalogPot(Constants.HINGE_POT_CHANNEL); //POT_Collector = new BTAnalogPot(Constants.COLLECTOR_POT_CHANNEL); //SHOOTER PISTON PISTON_ManipRelease = new BTPiston(Constants.MANIP_RELEASE_EXTEND_PORT,Constants.MANIP_RELEASE_RETRACT_PORT); PISTON_Collector = new BTPiston(Constants.COLLECTOR_PISTON_EXTEND_PORT,Constants.COLLECTOR_PISTON_RETRACT_PORT); PISTON_LockAngle = new BTPiston(Constants.LOCK_PISTON_EXTEND_PORT, Constants.LOCK_PISTON_RETRACT_PORT); AC_PressureSensor = new AnalogChannel(Constants.PRESSURE_SENSOR_PORT); debug.write(Constants.DebugLocation.BTData, Constants.Severity.INFO, "Data Inited"); }
public ComponentRegistry() { messageDisplay = new MessageDisplay(); /* Instantiate Drive components */ leftDriveJoystick = new Joystick(LEFT_DRIVE_JOYSTICK); rightDriveJoystick = new Joystick(RIGHT_DRIVE_JOYSTICK); operatorJoystick = new Joystick(OPERATOR_JOYSTICK); SpeedControllerFactory speedControllerFactory = new SpeedControllerFactory(); frontLeftDriveMotor = speedControllerFactory.create(FRONT_LEFT_DRIVE_MOTOR_PORT, FRONT_LEFT_DRIVE_SPEED_CONTROLLER, (FRONT_LEFT_DRIVE_MOTOR_DIRECTION==REVERSE)); frontRightDriveMotor = speedControllerFactory.create(FRONT_RIGHT_DRIVE_MOTOR_PORT, FRONT_RIGHT_DRIVE_SPEED_CONTROLLER, (FRONT_RIGHT_DRIVE_MOTOR_DIRECTION==REVERSE)); rearLeftDriveMotor = speedControllerFactory.create(REAR_LEFT_DRIVE_MOTOR_PORT, REAR_LEFT_DRIVE_SPEED_CONTROLLER, (REAR_LEFT_DRIVE_MOTOR_DIRECTION==REVERSE)); rearRightDriveMotor = speedControllerFactory.create(REAR_RIGHT_DRIVE_MOTOR_PORT, REAR_RIGHT_DRIVE_SPEED_CONTROLLER, (REAR_RIGHT_DRIVE_MOTOR_DIRECTION==REVERSE)); robotDrive = new RobotDrive(frontLeftDriveMotor, rearLeftDriveMotor, frontRightDriveMotor, rearRightDriveMotor); reverseDirectionButton = new JoystickButton(leftDriveJoystick, REVERSE_DRIVE_DIRECTION_BUTTON, false); speedDragButton = new JoystickButton(rightDriveJoystick, SPEED_DRAG_BUTTON, false); speedBoostButton = new JoystickButton(leftDriveJoystick, SPEED_BOOST_BUTTON, false); lowSpeedButton = new JoystickButton(leftDriveJoystick, LOW_SPEED_BUTTON, false); mediumSpeedButton = new JoystickButton(leftDriveJoystick, MEDIUM_SPEED_BUTTON, true); highSpeedButton = new JoystickButton(leftDriveJoystick, HIGH_SPEED_BUTTON, false); /* Pickup components */ pickupStopSwitch = new DigitalInputSwitch(BALL_STOP_SWITCH_CHANNEL, NORMALLY_CLOSED); pickupMotor = speedControllerFactory.create(PICKUP_MOTOR_PORT, PICKUP_SPEED_CONTROLLER, pickupStopSwitch, null, PICKUP_MOTOR_DIRECTION==REVERSE); pickupButton = new JoystickButton(operatorJoystick, PICKUP_BUTTON, false); /* Instantiate Switch components */ leftAutonomousModeSwitch = new DigitalInputSwitch(LEFT_AUTONOMOUS_MODE_CHANNEL, NORMALLY_CLOSED); rightAutonomousModeSwitch = new DigitalInputSwitch(RIGHT_AUTONOMOUS_MODE_CHANNEL, NORMALLY_CLOSED); /* Shoulder components */ analogVoltageMeter = new AnalogChannel(ANALOG_SUPPLY_CHANNEL); shoulderPotentiometer = new Potentiometer(ARM_POTENTIOMETER_CHANNEL, analogVoltageMeter, SHOULDER_POTENTIOMETER_DIRECTION==REVERSE, SHOULDER_POTENTIOMETER_SCALE, SHOULDER_POTENTIOMETER_MINIMUM_EDGE, SHOULDER_POTENTIOMETER_MAXIMUM_EDGE); armUpLimitSwitch = new DigitalInputSwitch(ARM_UP_LIMIT_SWITCH_CHANNEL, NORMALLY_CLOSED); armDownLimitSwitch = new DigitalInputSwitch(ARM_DOWN_LIMIT_SWITCH_CHANNEL, NORMALLY_CLOSED); shoulderMotor = speedControllerFactory.create(SHOULDER_MOTOR_PORT, PICKUP_SPEED_CONTROLLER, armUpLimitSwitch, armDownLimitSwitch, SHOULDER_MOTOR_DIRECTION==REVERSE); pickupPositionButton = new JoystickButton(operatorJoystick, SHOULDER_PICKUP_POSITION_BUTTON, false); lowShotPositionButton = new JoystickButton(operatorJoystick, SHOULDER_LOW_SHOT_POSITION_BUTTON, false); highShotPositionButton = new JoystickButton(operatorJoystick, SHOULDER_HIGH_SHOT_POSITION_BUTTON, false); seekShotButton = new JoystickButton(operatorJoystick, SHOULDER_SEEK_SHOT_BUTTON, false); startPositionButton = new JoystickButton(operatorJoystick, SHOULDER_START_POSITION_BUTTON, false); manualPositionButton = new JoystickButton(operatorJoystick, SHOULDER_MANUAL_MODE_BUTTON, false); distanceSensor = new MaxSonarDistanceSensor(DISTANCE_SENSOR_CHANNEL, analogVoltageMeter); shootingDistanceSwitch = new MaxSonarDistanceSwitch(distanceSensor, AUTO_SHOOT_DISTANCE, AUTO_SHOOT_DISTANCE_TOLERANCE, false); /* Hammer components */ hammerMotor = speedControllerFactory.create(LATCH_MOTOR_PORT, LATCH_SPEED_CONTROLLER, LATCH_MOTOR_DIRECTION==REVERSE); hammerFireButton = new JoystickButton(operatorJoystick, HAMMER_FIRE_BUTTON, false); hammerLatchButton = new JoystickButton(operatorJoystick, LATCH_LOCK_BUTTON, false); hammerLatchedSwitch = new DigitalInputSwitch(HAMMER_LATCHED_SWITCH_CHANNEL, NORMALLY_CLOSED); hammerLockedSwitch = new DigitalInputSwitch(HAMMER_LOCKED_SWITCH_CHANNEL, NORMALLY_CLOSED); autoShootButton = new JoystickButton(operatorJoystick, AUTO_SHOOT_BUTTON, false); reversePickupButton = new JoystickButton(operatorJoystick, REVERSE_PICKUP_BUTTON, false); /* Indicator light components */ Relay indicatorLightsSpikeRelay = new Relay(INDICATOR_LIGHTS_CHANNEL); shootDistanceLightRelay = new SimpleRelay(indicatorLightsSpikeRelay, SHOOT_DISTANCE_LIGHT_RELAY); hammerLatchedLightRelay = new SimpleRelay(indicatorLightsSpikeRelay, LATCH_LOCKED_LIGHT_RELAY); parkRobotButton = new JoystickButton(rightDriveJoystick, PARK_ROBOT_BUTTON, false); }
public AnalogChannel getAnalogVoltageMeter() { return analogVoltageMeter; }
public MaxSonarDistanceSensor(int pMaxSonarChannel, AnalogChannel pAnalogVoltageMeter) { maxSonar = new AnalogChannel(pMaxSonarChannel); analogVoltageMeter = pAnalogVoltageMeter; }
public InfraredSwitch(int pInfraredDetectorChannel, AnalogChannel pAnalogVoltageMeter, double pHammerLevel, int pOnState) { this(pInfraredDetectorChannel, pAnalogVoltageMeter, pHammerLevel, pOnState, false); }
public StringPot(int channelNum) { _channel = new AnalogChannel(channelNum); }
public MagneticEncoder(int channelNum) { _channel = new AnalogChannel(channelNum); }
public LoadSensor(int channel){ loadSensor = new AnalogChannel(channel); }
public CurrentSensor(int channel){ currentSensor = new AnalogChannel(channel); }
/** * Create the range finder. * @param analogModule The analog module it is in * @param channel The channel it is in */ public RangeFinderBall(int analogModule, int channel) { rangeFinder = new AnalogChannel(analogModule, channel); SmartDashboard.putNumber("Ball In Voltage", 1.4); SmartDashboard.putNumber("Ball Range Voltage", 0); }
public Ranger(int channel) { sensor = new AnalogChannel(channel); }
public AnalogChannel getSensor(){ return sensor; }
public WsAnalogInput(int channel) { this.analogValue = new DoubleSubject("AnalogInput" + channel); this.input = new AnalogChannel(channel); analogValue.setValue(0.0); }
public AnalogChannel getSonar() { return sonar; }