本文整理汇总了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();
}
示例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);
}
示例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.");
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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";
}