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


Java Compressor.start方法代碼示例

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


在下文中一共展示了Compressor.start方法的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: robotInit

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

示例7: Drivetrain

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

示例8: ShooterSubsystem

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

示例9: Shooter

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

示例10: WsCompressor

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

示例11: RobotTemplate

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

示例12: 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() {
	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);
}
 
開發者ID:Team3309,項目名稱:frc-2013-offseason,代碼行數:18,代碼來源:Robot.java

示例13: robotInit

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

示例14: robotInit

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

示例15: robotInit

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


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