Java 类edu.wpi.first.wpilibj.Compressor 实例源码

项目:MinuteMan    文件:HardwareAdaptor.java   
private HardwareAdaptor(){
    pdp = new PowerDistributionPanel();
    comp = new Compressor();
    shifter = new DoubleSolenoid(SolenoidMap.SHIFTER_FORWARD, SolenoidMap.SHIFTER_REVERSE);

    navx = new AHRS(CoprocessorMap.NAVX_PORT);

    dtLeftEncoder = new Encoder(EncoderMap.DT_LEFT_A, EncoderMap.DT_LEFT_B, EncoderMap.DT_LEFT_INVERTED);
    S_DTLeft.linkEncoder(dtLeftEncoder);
    dtRightEncoder = new Encoder(EncoderMap.DT_RIGHT_A, EncoderMap.DT_RIGHT_B, EncoderMap.DT_RIGHT_INVERTED);
    S_DTRight.linkEncoder(dtRightEncoder);

    dtLeft = S_DTLeft.getInstance();
    dtRight = S_DTRight.getInstance();
    S_DTWhole.linkDTSides(dtLeft, dtRight);
    dtWhole = S_DTWhole.getInstance();

    arduino = S_Arduino.getInstance();
}
项目:2015RobotCode    文件:Robot.java   
public Robot() {    // initialize variables in constructor
    stick = new Joystick(RobotMap.JOYSTICK_PORT); // set the stick to refer to joystick #0
    button = new JoystickButton(stick, RobotMap.BTN_TRIGGER);

    myRobot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR,
            RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR);
    myRobot.setExpiration(RobotDrive.kDefaultExpirationTime);  // set expiration time for motor movement if error occurs

    pdp = new PowerDistributionPanel();  // instantiate class to get PDP values

    compressor = new Compressor(); // Compressor is controlled automatically by PCM

    solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1, RobotMap.SOLENOID_PCM_PORT2); // solenoid on PCM port #0 & #1

    /*camera = CameraServer.getInstance();
    camera.setQuality(50);
    camera.setSize(200);*/
    frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);  // create the image frame for cam
    session = NIVision.IMAQdxOpenCamera("cam0",
            NIVision.IMAQdxCameraControlMode.CameraControlModeController);  // get reference to camera
    NIVision.IMAQdxConfigureGrab(session);  // grab current streaming session
}
项目:ParadigmShift-2014    文件:Rafiki_Atlas.java   
/**
 * Called when the robot first starts, (only once at power-up).
 */
public void robotInit() {
    //NetworkTable.setTeam(1259); adding the setTeam() method will cause the robot to encounter a thread error
    //NetworkTable.setIPAddress("10.12.59.2");
    operatorInputs = new OperatorInputs();
    drive = new DriveTrain(operatorInputs);
    prefs = Preferences.getInstance();
    pickerPID = new PickerPID();
    shoot = new Shooter(operatorInputs);
    pick = new Picker(operatorInputs, pickerPID, shoot);
    compressor = new Compressor(PRESSURE_SWITCH_CHANNEL, COMPRESSOR_RELAY_CHANNEL);
    colwellContraption1 = new Solenoid(1, 3);
    colwellContraption2 = new Solenoid(1, 4);
    colwellContraption2.set(true);

    this.autoTimer = new Timer();
    drive.leftEncoder.start();
    drive.rightEncoder.start();
    drive.timer.start();
    autoTimer.start();
}
项目:aerbot-champs    文件:Environment.java   
/**
 * Initializes systems
 * @param robot the RobotBase to set
 */
public Environment(RobotBase robot) {
    this.robot = robot;

    this.input = new XboxInput();

    this.accel = new AccelerometerSystem();
    this.accel.init(this);

    this.gyro = new GyroSystem();
    this.gyro.init(this);

    this.wheels = new WheelSystem();
    this.wheels.init(this);

    this.shooter = new ShooterSystem();
    this.shooter.init(this);

    this.intake = new IntakeSystem();
    this.intake.init(this);

    this.compressor = new Compressor(2, 1);
    this.compressor.start();
}
项目:HyperionRobot2014    文件:Robot.java   
/**
    * This function is run when the robot is first started up and should be
    * used for any initialization code.
    */
   public void robotInit() {
       robotInstance = this;
RobotMap.init();
       canonAngle = new CanonAngle();
       canonSpinner = new CanonSpinner();
       canonShooter = new CanonShooter();
       driveTrain = new DriveTrain();
       LedsSetter = new LedsSetter();

       // This MUST be here. If the OI creates Commands (which it very likely
       // will), constructing it during the construction of CommandBase (from
       // which commands extend), subsystems are not guaranteed to be
       // yet. Thus, their requires() statements may grab null pointers. Bad
       // news. Don't move it.
       oi = new OI();

       // instantiate the command used for the autonomous period
       autonomousCommand = new Autonomous_2balls();

       Compressor m_compressor = RobotMap.m_compressor;
       m_compressor.start();

       RobotMap.visionFrontSonarSolenoidRelay.set(true);
   }
项目:PainTrain    文件:PainTrain.java   
public PainTrain(){
    m_leftGearbox   = new ThreeCimBallShifter(  new Victor(1),
                                                new Victor(2),
                                                new Victor(3),
                                                new DoubleSolenoid (1,2) );

    m_rightGearbox  = new ThreeCimBallShifter(  new Victor(4),
                                                new Victor(5),
                                                new Victor(6));

    m_shooter       = new Shooter(7,8,7,8,9);
    m_intake        = new Intake( 3,
                                  5,
                                  10 );
    m_encodeLeft = new Encoder(2,3);
    m_encodeRight = new Encoder(5,6);

    m_compressor    = new Compressor(1,4);
    m_compressor.start();
}
项目:2014-robot    文件:RichardSimmons.java   
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    auto = new Autonomous(MechanismPack.getInstance());

    teleop = new Teleop(ControlPack.getInstance(), 
            MechanismPack.getInstance(), 
            SensorPack.getInstance());

    compressor = new Compressor(Channels.COMPRESSOR_PRESSURE_SWITCH_CHANNEL, Channels.COMPRESSOR_RELAY_CHANNEL);
    compressor.start();
    SensorPack.getInstance().getGyro().reset();

    swagLights = new Relay(Channels.SWAG_LIGHT_PORT);
    swagLights.set(Relay.Value.kOn);//TODO: NEEDED?
    System.out.println("Robot initilization complete.");


}
项目:2014_Main_Robot    文件:Robot.java   
/**
 * This method is run when the robot is first powered on.
 */
public void robotInit() {
    //initialize compressor
    compressor = new Compressor(RobotMap.pressureSwitch.getInt(), RobotMap.compressorRelay.getInt());

    // Initialize all subsystems
    CommandBase.init();

    //Initialize auto mode chooser
    autoSelectInit();

    //create thread to write dashboard variables
    printer = new ConsolePrinter(200);
    printer.startThread();

    //init message box on driverstation
    lcd = DriverStationLCD.getInstance();

    //Console Message so we know robot finished loading
    System.out.println("****Robot Done Loading****");
}
项目:EventBasedWiredCats    文件:WiredCats2415.java   
public WiredCats2415() {

        compressor = new Compressor(5, 8);

//        textReader.pushToSmartDashboard();

        initControllers();
        initDrive();
        initShooter();
        initIntake();
        initArm();
        initAutonomous();
        initHang();
//        initLogger();

        for (int i = 0; i < threads.size(); i++) {
            ((Thread) (threads.elementAt(i))).start();
        }
    }
项目:Hyperion3360-2012    文件:Robot.java   
public void robotInit() {
    // Ce commentaire va s'imprimmer sur la console de NetBeans
    System.out.println("Initialisation du Robot HYPERION 3360 : Version " + mVersionMajeur + "." + mVErsionMineur);

    // Le compresseur doit etre toujours demarer pour avoir le plus de pression.
    mCompresseur = new Compressor(DigitalDevice.mPressionCompresseur, RelayDevice.mCompresseur);
    mCompresseur.start();

    // Activer les composantes du robot dans autonomus et operatorControl.
    mDriveTrain = new DriveTrain();
    mReserveBalon = new ReserveBallon();
    mCanon = new Canon(mReserveBalon);
    mPont = new Pont();

    disabled = false;

    //Timer.delay(10);

    //camera.getInstance();
    //camera.writeResolution(AxisCamera.ResolutionT.k640x480);
    //camera.writeBrightness(0);
}
项目:FRC-2017-Command    文件:Robot.java   
@Override
public void robotInit() {
    logger = LoggerFactory.getLogger(Robot.class);
    logger.info("Initializing Robot");
    drivetrain = new DriveTrain();
    driveEncoders = new DriveEncoders(RobotMap.leftEncoderA,RobotMap.leftEncoderB,RobotMap.rightEncoderA, RobotMap.rightEncoderB,
            RobotMap.encoderMaxPeriod, RobotMap.encoderMinRate, RobotMap.encoderDPP,RobotMap.encoderReverseDirection,RobotMap.encoderSamplesToAvg);
    ultrasonic = new Ultrasonic(RobotMap.valueToInches,RobotMap.ultrasonicPort);
    gyro = new Gyro();
    vision = new Vision();
    gds = new GDS();
    pickup = new Pickup();
    flywheel = new Flywheel();
    meter = new Meter();
    winch = new Winch();
    winchPush = new WinchPush();
    fieldTimer = new FieldTimer();
    oi = new OI();

    chooser = new SendableChooser<>();
    endTimer = new StartEndTimer();
    stopTimers = new StopEndTimer();

    vision.setUpCamera();
    SmartDashboard.putData(drivetrain);
    chooser.addDefault("None", noAuto);
    chooser.addObject("Forward Drive", forwardAuto);
    chooser.addObject("Center Gear Blue", centerGearAuto);
    chooser.addObject("Left Gear", leftGearAuto);
    chooser.addObject("Right Gear", rightGearAuto);
    chooser.addObject("Boiler Red", boilerAuto);
    chooser.addObject("Center Gear Only",centerGearOnlyAuto);
    chooser.addObject("Boiler Blue", boilerAutoBlue);
    chooser.addObject("Center Gear Red", centerGearRed);
    SmartDashboard.putData("Auto choices", chooser);
    Compressor c = new Compressor(10);
    c.setClosedLoopControl(true);
    gyro.calibrate();
    winchPush.setLock(false);
}
项目:Robot_2017    文件:RobotMap.java   
public static void init() {
      // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    compressor = new Compressor();

      driveTrainLeftFront = new CANTalon(1);
      LiveWindow.addActuator("DriveTrain", "LeftFront", driveTrainLeftFront);
      driveTrainRightFront = new CANTalon(3);
      LiveWindow.addActuator("DriveTrain", "RightFront", driveTrainRightFront);
      driveTrainLeftRear = new CANTalon(2);
      driveTrainLeftRear.changeControlMode(TalonControlMode.Follower);
      driveTrainLeftRear.set(driveTrainLeftFront.getDeviceID());
      LiveWindow.addActuator("DriveTrain", "LeftRear", driveTrainLeftRear);
      driveTrainRightRear = new CANTalon(4);
      driveTrainRightRear.changeControlMode(TalonControlMode.Follower);
      driveTrainRightRear.set(driveTrainRightFront.getDeviceID());
      driveTrainRightRear.reverseOutput(false);
      LiveWindow.addActuator("DriveTrain", "RightRear", driveTrainRightRear);

      driveTrainLeftFront.setInverted(true);
      driveTrainRightFront.setInverted(true);
      driveTrainLeftRear.setInverted(true);
      driveTrainRightRear.setInverted(true);

      driveTrainRobotDrive41 = new RobotDrive(driveTrainRightFront, driveTrainLeftFront);
driveTrainRobotDrive41.setSafetyEnabled(true);
driveTrainRobotDrive41.setExpiration(0.1);
driveTrainRobotDrive41.setSensitivity(0.5);
driveTrainRobotDrive41.setMaxOutput(1.0);

      climbMotor = new CANTalon(5);
      LiveWindow.addActuator("Climbing", "Motor", climbMotor);

      lightsLightEnable = new Relay(0);
      LiveWindow.addActuator("Lights", "LightEnable", lightsLightEnable);

      gearIntakeRamp = new DoubleSolenoid(1, 0);
      LiveWindow.addActuator("GearIntake", "IntakeRamp", gearIntakeRamp);

      // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
  }
项目:Steamworks2017Robot    文件:Pneumatics.java   
/**
 * Creates a new Pneumatics subsystem.
 */
public Pneumatics() {
  logger.info("Initialize");
  if (Robot.deviceFinder.isPcmAvailable(RobotMap.PCM_CAN_ID)) {
    compressor = new Compressor(RobotMap.PCM_CAN_ID);
    compressor.setClosedLoopControl(true);
  }
}
项目:2016-Robot-Final    文件:Robot.java   
public void robotInit() {

    // Create subsystems
    drive = new Drive();
    intake = new Intake();
    arm = new Arm();
    shooter = new Shooter();
    hanger = new Hanger();

    oi = new OI();

    // Create motion profiles
    crossLowBar = new Profile(AutoMap.crossLowBar);
    reach = new Profile(AutoMap.reach);
    toShoot = new Profile(AutoMap.toShoot);
    toLowGoal = new Profile(AutoMap.toLowGoal);

    // Pick an auto
    chooser = new SendableChooser();
    chooser.addDefault("Do Nothing", new DoNothing());
    chooser.addObject("Low Bar", new LowBarRawtonomous());
    chooser.addObject("Low Bar (profile)", new CrossLowBar(crossLowBar));
    chooser.addObject("Reach", new Reach(reach));
    chooser.addObject("Forward Rawto", new ForwardRawtonomous());
    chooser.addObject("Backward Rawto", new BackwardRawtonomous());
    chooser.addObject("Shoot", new AutoShoot());
    SmartDashboard.putData("Auto mode", chooser);

    // Start camera stream
    camera = new USBCamera();
    server = CameraServer.getInstance();
    server.setQuality(40);
    server.startAutomaticCapture(camera);

    // Start compressor
    compressor = new Compressor();
    compressor.start();

    navx = new AHRS(SPI.Port.kMXP);
    }
项目:449-central-repo    文件:Pneumatics.java   
/**
 * Default constructor
 *
 * @param nodeID         The node ID of the compressor.
 * @param pressureSensor The pressure sensor attached to this pneumatics system. Can be null.
 */
@JsonCreator
public Pneumatics(@JsonProperty(required = true) int nodeID,
                  @Nullable PressureSensor pressureSensor) {
    compressor = new Compressor(nodeID);
    this.pressureSensor = pressureSensor;
}
项目:RobotBuilderTest    文件:RobotMap.java   
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveTrainLeftMotor = new Talon(0);
    LiveWindow.addActuator("DriveTrain", "LeftMotor", (Talon) driveTrainLeftMotor);

    driveTrainRightMotor = new Talon(1);
    LiveWindow.addActuator("DriveTrain", "RightMotor", (Talon) driveTrainRightMotor);

    driveTrainRobotDrive = new RobotDrive(driveTrainLeftMotor, driveTrainRightMotor);

    driveTrainRobotDrive.setSafetyEnabled(true);
    driveTrainRobotDrive.setExpiration(0.1);
    driveTrainRobotDrive.setSensitivity(0.5);
    driveTrainRobotDrive.setMaxOutput(1.0);

    intakeintakeMotor = new Talon(2);
    LiveWindow.addActuator("Intake", "intakeMotor", (Talon) intakeintakeMotor);

    pneumaticSystemCompressor = new Compressor(0);


    pneumaticSystemDoubleSolenoidPusher = new DoubleSolenoid(0, 0, 1);
    LiveWindow.addActuator("Pneumatic System", "DoubleSolenoidPusher", pneumaticSystemDoubleSolenoidPusher);

    sensorBaseUltraSonicMaxbotix = new AnalogInput(0);
    LiveWindow.addSensor("SensorBase", "UltraSonicMaxbotix", sensorBaseUltraSonicMaxbotix);

// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
项目:2016-Robot    文件:Robot.java   
public void robotInit() {

    // Create subsystems
    drive = new Drive();
    intake = new Intake();
    arm = new Arm();
    shooter = new Shooter();
    hanger = new Hanger();

    oi = new OI();

    // Create motion profiles
    crossLowBar = new Profile(AutoMap.crossLowBar);
    reach = new Profile(AutoMap.reach);
    toShoot = new Profile(AutoMap.toShoot);
    toLowGoal = new Profile(AutoMap.toLowGoal);

    // Pick an auto
    chooser = new SendableChooser();
    chooser.addDefault("Do Nothing", new DoNothing());
    chooser.addObject("Low Bar", new LowBarRawtonomous());
    chooser.addObject("Low Bar (profile)", new CrossLowBar(crossLowBar));
    chooser.addObject("Reach", new Reach(reach));
    chooser.addObject("Forward Rawto", new ForwardRawtonomous());
    chooser.addObject("Backward Rawto", new BackwardRawtonomous());
    chooser.addObject("Shoot", new AutoShoot());
    SmartDashboard.putData("Auto mode", chooser);

    // Start camera stream
    camera = new USBCamera();
    server = CameraServer.getInstance();
    server.setQuality(40);
    server.startAutomaticCapture(camera);

    // Start compressor
    compressor = new Compressor();
    compressor.start();

    navx = new AHRS(SPI.Port.kMXP);
    }
项目:FRC-2016-Robot-Code    文件:Robot.java   
public void robotInit() {

        frontLeft = new VictorSP(0);
        backLeft = new VictorSP(1);       
        frontRight = new VictorSP(2);
        backRight = new VictorSP(3);
        intakeMotor = new VictorSP(4);
        compressor = new Compressor(0);
        intakeSolenoid = new Solenoid(0);


        driveTrain = new RobotDrive(frontLeft, backLeft, frontRight, backRight);

        driveTrain.setSafetyEnabled(false);
        driveTrain.setExpiration(0.1);
        driveTrain.setSensitivity(0.5);
        driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, false);
        driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false);
        driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontRight, false);
        driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearRight, false);

        XboxController = new Joystick(2);

        rightJoystick = new Joystick(1);

        leftJoystick = new Joystick(0);
    }
项目:FRC-2016    文件:Pneumatics.java   
/**
 * Constructor
 */
private Pneumatics() {
    shifter = new DoubleSolenoid(1, SHIFTER_EXT, SHIFTER_RET);
    comp = new Compressor(1);
    comp.setClosedLoopControl(true);
    shifter.set(DoubleSolenoid.Value.kForward);
    shifter.set(DoubleSolenoid.Value.kOff);

}
项目:FRC2015Code    文件:RobotMap.java   
public static void init() {
    leftDriveMotor = new Talon(leftDriveMotorPin);
    LiveWindow.addActuator("driveTrain", "Left Motor",
            (Talon) leftDriveMotor);

    rightDriveMotor = new Talon(rightDriveMotorPin);
    LiveWindow.addActuator("driveTrain", "Right Motor",
            (Talon) rightDriveMotor);

    shifterSolenoid = new DoubleSolenoid(shifterSolenoidUpPin, shifterSolenoidDownPin);
    LiveWindow.addActuator("driveTrain", "Gearbox Shifter",
            (DoubleSolenoid) shifterSolenoid);

    winchMotor = new Talon(winchMotorPin);
    LiveWindow.addActuator("chainLifter", "Elevator Motor",
            (Talon) winchMotor);

    robotDrive = new RobotDrive(leftDriveMotor, rightDriveMotor);

    robotDrive.setSafetyEnabled(true);
    robotDrive.setExpiration(0.1);
    robotDrive.setSensitivity(0.5);
    robotDrive.setMaxOutput(1.0);

    robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false);
    robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, false);

    grabberSolenoid = new DoubleSolenoid(grabberSolenoidOpenPin, grabberSolenoidClosePin);
    LiveWindow.addActuator("grabberArm", "Grabber Solenoid",
            (DoubleSolenoid) grabberSolenoid);

    compressor = new Compressor();
    LiveWindow.addActuator("grabberArm", "compressor",
            (Compressor) compressor);

}
项目:strongback-java    文件:HardwarePneumaticsModule.java   
HardwarePneumaticsModule(Compressor pcm) {
    this.pcm = pcm;
    this.closedLoop = Relay.instantaneous(this.pcm::setClosedLoopControl, this.pcm::getClosedLoopControl);
    this.instantaneousFaults = new Faults() {
        @Override
        public Switch currentTooHigh() {
            return pcm::getCompressorCurrentTooHighFault;
        }
        @Override
        public Switch notConnected() {
            return pcm::getCompressorNotConnectedFault;
        }
        @Override
        public Switch shorted() {
            return pcm::getCompressorShortedFault;
        }
    };
    this.stickyFaults = new Faults() {
        @Override
        public Switch currentTooHigh() {
            return pcm::getCompressorCurrentTooHighStickyFault;
        }
        @Override
        public Switch notConnected() {
            return pcm::getCompressorNotConnectedStickyFault;
        }
        @Override
        public Switch shorted() {
            return pcm::getCompressorShortedStickyFault;
        }
    };
}
项目:2015RobotCode    文件:Robot.java   
/**
   * This function is run when the robot is first started up and should be
   * used for any initialization code.
   */
  public void robotInit() {

    // initialize all subsystems and important classes
oi = new OI();
//autoSys = new AutonomousSys();
driveSys = new DrivingSys();

      // instantiate the command used for the autonomous period
      //autonomousCommand = new AutonomousCmd();

      // instantiate cmd used for teleop period
      arcadeDriveCmd = new ArcadeDriveJoystick();

      // Show what cmd the susbsystem is running on SmartDashboard
      SmartDashboard.putData(driveSys);

      // Initialize Power Distribution Panel
      pdp = new PowerDistributionPanel();

      // Compressor is controlled automatically by PCM
      compressor = new Compressor();

      solenoid = new DoubleSolenoid(0, 1);
      solenoid.set(DoubleSolenoid.Value.kReverse);

      /*camera = CameraServer.getInstance();
      camera.setQuality(50);
      camera.startAutomaticCapture("cam0");*/

  }
项目:2015RobotCode    文件:PneumaticControl.java   
@Override
public void initialize() {
    m_compressor = new Compressor();
    m_compressor.setClosedLoopControl(true);
    m_solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1,
            RobotMap.SOLENOID_PCM_PORT2);
}
项目:2015RobotCode    文件:Robot.java   
public Robot() {
    myRobot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR,
RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR);
    myRobot.setExpiration(0.1);
    stick = new Joystick(RobotMap.JOYSTICK_PORT1);
    compressor = new Compressor();
    solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1,
            RobotMap.SOLENOID_PCM_PORT2);
    jaguar = new Jaguar(RobotMap.LIFT_MOTOR);
}
项目:4500-2014    文件:RobotTemplate.java   
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);

}
项目:aeronautical-facilitation    文件:AeronauticalFacilitation.java   
/**
 *
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    DriveTrain = new DriveTrain();
    launchercontroller = new Launcher();
    rollerSubsystem = new Roller();
    display = DriverStationLCD.getInstance();
    compressor = new Compressor(RobotMap.PressureSwitchDigitalInput, RobotMap.CompressorRelay);
    compressor.start();

    DriveTrain.shiftHighGear();

    OI.initialize();


    autonomousCommand = new Autonomous();

    arduino = new ArduinoConnection();
    arduino.setPattern("4");
    pattern = 0;
    driverStation = DriverStation.getInstance();
    alliance = driverStation.getAlliance().value;
    digital1 = driverStation.getDigitalIn(1);
    digital2 = driverStation.getDigitalIn(2);
    digital3 = driverStation.getDigitalIn(3);
    // Initialize all subsystems.
    // Subsystems: a self-contained system within a larger system. 
    CommandBase.init();
}
项目:ProjectShifter    文件:Drivetrain.java   
public Drivetrain(){
    leftFront = new Talon(Constants.leftFront);
    leftMiddle = new Talon(Constants.leftMiddle);
    leftBack = new Talon(Constants.leftBack);
    rightFront = new Talon(Constants.rightFront);
    rightMiddle = new Talon(Constants.rightMiddle);
    rightBack = new Talon(Constants.rightBack);
    relay = new Relay(Constants.shifter);
    compressor = new Compressor(Constants.pressureGauge, Constants.compressor);
    compressor.start();
}
项目:RobotCode2014    文件:ShooterSubsystem.java   
public ShooterSubsystem() {
    winchSafety = new WinchSafetyThread();
    initalizeCANJaguar();
    firedLimit = new DigitalIOButton(RobotMap.SHOOTER_FIRED_LIMIT);
    canLimitBottom = new CANLimitButton(false);
    firedLimit.whenPressed(new LogToBlackBox("CAN Button hit top"));
    canLimitBottom.whenPressed(new LogToBlackBox("CAN Button hit bottom"));
    latch = new Solenoid(RobotMap.SHOOTER_LATCH);
    compressor = new Compressor(RobotMap.COMPRESSOR_SWITCH, RobotMap.COMPRESSOR_RELAY);
    compressor.start();
    SmartDashboard.putNumber("P", P);
    SmartDashboard.putNumber("I", I);
    SmartDashboard.putNumber("D", D);
}
项目:FRC2014    文件:Shooter.java   
public Shooter(Collector collector) {
    //initializing everything
    shooterMotors = new Talon(4);
    shootCommand = false;
    compressor = new Compressor(7, 1);
    compressor.start();
    driverStation = DriverStation.getInstance();
    this.collector = collector;
}
项目:Team_3200_2014_Aerial_Assist    文件:PneumaticShooter.java   
/**
 * Creates the pneumatic shooter.
 */
public PneumaticShooter() {
    // Define pneumatics-related items
    compressor  = new Compressor(RobotMap.DIGITAL_MODULE, RobotMap.COMPRESSOR_PRESSURE_SWITCH,
            RobotMap.DIGITAL_MODULE, RobotMap.COMPRESSOR_RELAY);
    leftPiston = new Piston(RobotMap.SOLENOID_MODULE, RobotMap.LEFT_PISTON_SOLA, RobotMap.LEFT_PISTON_SOLB);
    middlePiston = new Piston(RobotMap.SOLENOID_MODULE, RobotMap.MIDDLE_PISTON_SOLA, RobotMap.MIDDLE_PISTON_SOLB);
    rightPiston = new Piston(RobotMap.SOLENOID_MODULE, RobotMap.RIGHT_PISTON_SOLA, RobotMap.RIGHT_PISTON_SOLB);

    leftPiston.set(false);
    middlePiston.set(false);
    rightPiston.set(false);

    ballIn = new RangeFinderBall(RobotMap.ANALOG_MODULE, RobotMap.RANGE_UNDER_BALL);

    timeStarted = -1;
    timeFire = -1;

    aShootButtonHeld = false;
    powSwitchButtonHeld = false;
    airPulseIncreaseStart = -1;
    airPulseDecreaseStart = -1;

    dryFireButtonHeld = false;
    dryFireStart = -1;

    RANGE_FOR_DIST[6] = 500;
    RANGE_FOR_DIST[10] = 600;

    SmartDashboard.putNumber("Time Extend (milliseconds)", 350);
    SmartDashboard.putNumber("Auto 2nd Ball Air pulse (milliseconds)", 250);
    SmartDashboard.putBoolean("Ball Sensor_Active", true);
    SmartDashboard.putBoolean("Ball in", false);

    SmartDashboard.putBoolean("Unstuckify", false);
}
项目:2014_software    文件:WsCompressor.java   
public WsCompressor(String name, int pressureSwitchSlot, int pressureSwitchChannel, int compresssorRelaySlot, int compressorRelayChannel)
{
    super(name);
    compressor = new Compressor(pressureSwitchSlot, pressureSwitchChannel, compresssorRelaySlot, compressorRelayChannel);
    compressor.start();

    LOW_VOLTAGE_CONFIG = new DoubleConfigFileParameter(this.getClass().getName(), "LowVoltage", 0.5);
    HIGH_VOLTAGE_CONFIG = new DoubleConfigFileParameter(this.getClass().getName(), "HighVoltage", 4.0);
    MAX_PSI_CONFIG = new DoubleConfigFileParameter(this.getClass().getName(), "MaxPSI", 115);

    lowVoltage = LOW_VOLTAGE_CONFIG.getValue();
    highVoltage = HIGH_VOLTAGE_CONFIG.getValue();
    maxPSI = MAX_PSI_CONFIG.getValue();
}
项目:FRC623Robot2014    文件:RobotHardware.java   
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);
}
项目:ReboundRumbleJava    文件:RobotTemplate.java   
public RobotTemplate() {
    // initialize all the objects
    ingest = new VictorPair(5,6);
    elevator = new Victor(1);

    shooter = new VictorPair(2,4);

    robotDrive = new Drive(8, 7, 10, 9);
    xbox = new JStick(1);
    joystick = new JStick(2);
    compressor = new Compressor(4, 3);
    compressor.start();

    driveGearA = new Solenoid(1);
    driveGearB = new Solenoid(2);
    driveGearA.set(true);
    driveGearB.set(false);
    selectedGear = 1;

    leftEnc = new Encoder(6, 7, true,CounterBase.EncodingType.k2X);
    leftEnc.setDistancePerPulse(0.103672558);

    rightEnc = new Encoder(9, 10, false);
    rightEnc.setDistancePerPulse(0.103672558);

    lcd = DriverStationLCD.getInstance();
}
项目:2012    文件:GameMech.java   
public GameMech()
    {
        load = new Loader();
        shoot = new SlingShot();
        camera = new CameraUnit();
//        PushDownerrr = new RampGoDownerrrr();
        airCompressor = new Compressor(ReboundRumble.AIR_PRESSURE_SENSOR_GPIO_CHANNEL,
                ReboundRumble.AIR_COMPRESSOR_RELAY_CHANNEL);

    }
项目:frc-2013-offseason    文件:Robot.java   
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    scheduler = Scheduler.getInstance();

    mDrive = Drive.getInstance();
    mArm = Arm.getInstance();

    compressor = new Compressor(RobotMap.PRESSURE_SWITCH,
            RobotMap.COMPRESSOR_RELAY);
    compressor.start();

    autonChooser.addObject("Do nothing", new FakeCommand());
    SmartDashboard.putData("Autonomous Chooser", autonChooser);
}
项目:2013-Ultimate-Ascent-Robot    文件:Pnuematics.java   
public Pnuematics(UltimateAscentRobot robot){
    super(robot);
    compressor = new Compressor(1,1);
    //compressor = new Relay(1);
    //compressor.setDirection(Relay.Direction.kForward);
    //pSwitch    = new DigitalInput(1);            
}
项目:2484-tesla-2013    文件:Robot_Tesla_2013.java   
protected void robotInit() 
{
    m_LeftDriveMotor    = new Victor(SLOT, LEFT_MOTOR_CHANNEL); //cRIO Slot,Channel
    m_RightDriveMotor   = new Victor(SLOT, RIGHT_MOTOR_CHANNEL);
    //m_ArmMotor          = new Victor(SLOT, ARM_MOTOR);
    m_FrisbeeMotor      = new Victor(SLOT, FRISBEE_MOTOR);

    m_Driver        = new Joystick(1); //USB Port
    m_Secondary     = new Joystick(2); 
    m_RobotDrive    = new RobotDrive(m_LeftDriveMotor, m_RightDriveMotor);

    m_Compressor = new Compressor(14, 1); //Pressure switch channel,Relay channel
    m_Compressor.start(); 

    //m_ArmSolIn      = new Solenoid(SOL_ARM_IN);
    //m_ArmSolOut     = new Solenoid(SOL_ARM_OUT);
    m_FrisbeeSolIn  = new Solenoid(SOL_FRISBEE_IN);
    m_FrisbeeSolOut = new Solenoid(SOL_FRISBEE_OUT);
    m_Lights        = new Solenoid(SOL_LIGHTS);

    //m_ArmPist       = new Piston(m_ArmSolIn, m_ArmSolOut, false, true, 3);
    m_FrisbeePist   = new Piston(m_FrisbeeSolIn, m_FrisbeeSolOut, true, false, 0.5f);

    m_Shooter = new Shooter(m_FrisbeePist, m_FrisbeeMotor, 1);

    //m_ArmTop = new DigitalInput(ARMTOP); //Channel
    //m_ArmBot = new DigitalInput(ARMBOT);

    m_LCD = DriverStationLCD.getInstance();


}
项目:StormRobotics2017    文件:Robot.java   
@Override
    public void robotInit() {


        driveTrain = new DriveTrain();
        //driveTrainPID = new DriveTrainPID();
        gear = new GearSystem();
        hang = new HangingSystem();
        intake = new IntakeSystem();
        shoot = new ShootingSystem();
        oi = new OI();
        vision = new VisionSystem();
        compressor = new Compressor();
        compressor.start();
        leds = new LEDz();
        ds = DriverStation.getInstance();

        chooser = new SendableChooser<>();
        chooser.addDefault("Do Nothing", new DriveForwardDistance(0, 0, 0, 0, true));
        chooser.addObject("Baseline", new Baseline());
        chooser.addObject("Left", new LeftPeg());
        chooser.addObject("Center No Vision", new CenterNoVision());
        chooser.addObject("Right", new RightPeg());
        chooser.addObject("Center Vision", new CenterVision());
        chooser.addObject("Right Peg Boiler", new RightPegBoiler());
        chooser.addObject("Left Peg Boiler", new LeftPegBoiler());
        chooser.addObject("CODE NIGHT FOLLOWER", new CodeNightFollow());

        SmartDashboard.putData("AutoChooser", chooser);


//      String[] autoModeNames = new String[] { "Drive Forward Distance", "Drive Forward Time", "Right", "GyroTurn" };
//      Command[] autoModes = new Command[] { new DriveForwardDistance(50, 2, 2),
//              new DriveForward(-0.25, 10), new Right()};// Almost full turn
//      
////        Command[] autoModes = new Command[] { new DriveForwardDistance(encoderTicsPerRev * 20, encoderTicsPerRev * 20),
////                new DriveForward(-0.25, 10) };
//
//      
//      // configure and send the sendableChooser, which allows the modes
//      // to be chosen via radio button on the SmartDashboard
//      for (int i = 0; i < autoModes.length; i++) {
//          chooser.addObject(autoModeNames[i], autoModes[i]);
//      }



        SmartDashboard.putData(Scheduler.getInstance());


        new Command("Sensor feedback") {
            @Override
            protected void initialize() {
            }

            @Override
            protected void execute() {
                sendSensorData();
            }

            @Override
            protected boolean isFinished() {
                return false;
            }

            @Override
            protected void end() {
            }

            @Override
            protected void interrupted() {
            }
        }.start();

    }
项目:2017-Robot    文件:Robot.java   
@Override
public void robotInit() {

        chooser = new SendableChooser<Integer>();
        chooser.addDefault("center red", 1);
        chooser.addObject("center blue", 2);
        chooser.addObject("boiler red", 3);
        chooser.addObject("boiler blue", 4);
        chooser.addObject("ret red", 5);
        chooser.addObject("ret blue", 6);
        chooser.addObject("current test", 7);

        SmartDashboard.putData("Auto choices", chooser);

        //NETWORK TABLE VARIABLES
        table = NetworkTable.getTable("dataTable");

        //POWER DIST PANEL
        pdp = new PowerDistributionPanel();

        //NAVX
        navx = new AHRS(SPI.Port.kMXP);

        // CONTROLLER
        jsLeft = new Joystick(0);
        jsRight = new Joystick(1);
        xbox = new XboxController(5);

        // MOTORS
        leftFront = new Talon(pwm5);
        leftMid = new Talon(pwm3);
        leftBack = new Talon(pwm1);
        rightFront = new Talon(pwm4);
        rightMid = new Talon(pwm2);
        rightBack = new Talon(pwm0);

        // ENCODERS
        encLeftDrive = new Encoder(0,1);
        encRightDrive = new Encoder(2,3);

        // COMPRESSOR
        compressor = new Compressor();
        compressor.start();

        //SOLENOIDs
        driveChain = new DoubleSolenoid(0,1);
        driveChain.set(Value.kReverse);
        presser = new DoubleSolenoid(2,3);
        presser.set(Value.kReverse);
        gearpiston = new DoubleSolenoid(4,5);
        gearpiston.set(Value.kReverse);


        //CANTALONS
        climber = new CANTalon(2);
        shooter = new CANTalon(4);
        intake = new CANTalon(9);
        feeder = new CANTalon(13);

        // CAMERA
        //DON'T DELETE THE COMMENTED THREAD-IT IS USED FOR CALIBRATION
        /*
        UsbCamera usbCam = new UsbCamera("mscam", 0);
        usbCam.setVideoMode(VideoMode.PixelFormat.kMJPEG, 160, 120, 20);
        MjpegServer server1 = new MjpegServer("cam1", 1181);
        server1.setSource(usbCam);
        */

        UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
        camera.setVideoMode(VideoMode.PixelFormat.kMJPEG, 160, 120, 20);

        //SMARTDASBOARD
        driveSetting = "LOW START";
        gearSetting = "GEAR CLOSE START";
}
项目:2015RobotCode    文件:PneumaticSys.java   
public PneumaticSys() {
    super();
    solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1, RobotMap.SOLENOID_PCM_PORT2); // PCM port #0 & #1
    compressor = new Compressor(); // Compressor is controlled automatically by PCM
}