當前位置: 首頁>>代碼示例>>Java>>正文


Java Compressor類代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.Compressor的典型用法代碼示例。如果您正苦於以下問題:Java Compressor類的具體用法?Java Compressor怎麽用?Java Compressor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Compressor類屬於edu.wpi.first.wpilibj包,在下文中一共展示了Compressor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PainTrain

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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();
}
 
開發者ID:wsh32,項目名稱:PainTrain,代碼行數:21,代碼來源:PainTrain.java

示例2: HardwareAdaptor

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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();
}
 
開發者ID:taco650,項目名稱:MinuteMan,代碼行數:20,代碼來源:HardwareAdaptor.java

示例3: Robot

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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
}
 
開發者ID:TechnoWolves5518,項目名稱:2015RobotCode,代碼行數:23,代碼來源:Robot.java

示例4: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
 * 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();
}
 
開發者ID:pewaukeerobotics,項目名稱:ParadigmShift-2014,代碼行數:24,代碼來源:Rafiki_Atlas.java

示例5: Environment

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
 * 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();
}
 
開發者ID:Impact2585,項目名稱:aerbot-champs,代碼行數:28,代碼來源:Environment.java

示例6: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
    * 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);
   }
 
開發者ID:Hyperion3360,項目名稱:HyperionRobot2014,代碼行數:29,代碼來源:Robot.java

示例7: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
 * 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.");
    
    
}
 
開發者ID:FRC-Team-2403,項目名稱:2014-robot,代碼行數:22,代碼來源:RichardSimmons.java

示例8: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
 * 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****");
}
 
開發者ID:Team2168,項目名稱:2014_Main_Robot,代碼行數:24,代碼來源:Robot.java

示例9: WiredCats2415

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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();
        }
    }
 
開發者ID:wiredcats,項目名稱:EventBasedWiredCats,代碼行數:20,代碼來源:WiredCats2415.java

示例10: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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);
}
 
開發者ID:amalo,項目名稱:Hyperion3360-2012,代碼行數:23,代碼來源:Robot.java

示例11: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
@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);
}
 
開發者ID:mr-glt,項目名稱:FRC-2017-Command,代碼行數:41,代碼來源:Robot.java

示例12: init

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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
  }
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:41,代碼來源:RobotMap.java

示例13: Pneumatics

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
 * 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);
  }
}
 
開發者ID:ligerbots,項目名稱:Steamworks2017Robot,代碼行數:11,代碼來源:Pneumatics.java

示例14: robotInit

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
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);
    }
 
開發者ID:Team236,項目名稱:2016-Robot-Final,代碼行數:41,代碼來源:Robot.java

示例15: Pneumatics

import edu.wpi.first.wpilibj.Compressor; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:blair-robot-project,項目名稱:449-central-repo,代碼行數:13,代碼來源:Pneumatics.java


注:本文中的edu.wpi.first.wpilibj.Compressor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。