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


Java Victor類代碼示例

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


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

示例1: PainTrain

import edu.wpi.first.wpilibj.Victor; //導入依賴的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: Robot

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public Robot() {
	stick = new Joystick(0);
	driveLeftFront = new Victor(LEFT_FRONT_DRIVE);
	driveLeftRear = new Victor(LEFT_REAR_DRIVE);
	driveRightFront = new Victor(RIGHT_FRONT_DRIVE);
	driveRightRear = new Victor(RIGHT_REAR_DRIVE);
	enhancedDriveLeft = new Victor(ENHANCED_LEFT_DRIVE);
	enhancedDriveRight = new Victor(ENHANCED_RIGHT_DRIVE);
	gearBox = new DoubleSolenoid(GEAR_BOX_PART1, GEAR_BOX_PART2);
	climber1 = new Victor(CLIMBER_PART1);
	climber2 = new Victor(CLIMBER_PART2);
	vexSensorBackLeft = new Ultrasonic(0, 1);
	vexSensorBackRight = new Ultrasonic(2, 3);
	vexSensorFrontLeft = new Ultrasonic(4, 5);
	vexSensorFrontRight = new Ultrasonic(6, 7);

	Skylar = new RobotDrive(driveLeftFront, driveLeftRear, driveRightFront, driveRightRear);
	OptimusPrime = new RobotDrive(enhancedDriveLeft, enhancedDriveRight);
}
 
開發者ID:TeamAutomatons,項目名稱:Steamwork_2017,代碼行數:20,代碼來源:Robot.java

示例3: robotInit

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new ExampleCommand();
    
    frontLeft = new Victor(1); // Creating Victor motors
    frontRight = new Victor(2);
    rearLeft = new Victor(3);
    rearRight = new Victor(4);
    
    myDrive = new RobotDrive(frontLeft, frontRight);
    // myDrive = new RobotDrive(frontLeft,frontRight,rearLeft,rearRight);
    
    driveStick = new Joystick(1);
    
    gyro = new Gyro(1);

    // Initialize all subsystems
    CommandBase.init();
}
 
開發者ID:Spartronics4915,項目名稱:2014-Aerial-Assist,代碼行數:24,代碼來源:RobotTemplate.java

示例4: DriveTrain

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
/**
 *
 */
public DriveTrain() {
    super("DriveTrain");

    FLeftMotor = new Victor(RobotMap.FLeftMotorPWM);
    FRightMotor = new Victor(RobotMap.FRightMotorPWM);
    BLeftMotor = new Victor(RobotMap.BLeftMotorPWM);
    BRightMotor = new Victor(RobotMap.BRightMotorPWM);
    //MLeftMotor = new Victor(RobotMap.MLeftMotorPWM);
    //MRightMotor = new Victor(RobotMap.MRightMotorPWM);
    drive = new RobotDrive(FLeftMotor, BLeftMotor, FRightMotor, BRightMotor);
    //drive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
    //drive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);

    GShiftSolDown = new Solenoid(RobotMap.DriveTrainLowGearSolenoid);
    GShiftSolUp = new Solenoid(RobotMap.DriveTrainHighGearSolenoid);
    display = DriverStationLCD.getInstance();
}
 
開發者ID:CarmelRobotics,項目名稱:aeronautical-facilitation,代碼行數:21,代碼來源:DriveTrain.java

示例5: init

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public void init() {
    if(!hasInit) {
        left = new Victor(HardwareDefines.RIGHT_LOADER_VICTOR);
        try {
            right = new CANJaguar(HardwareDefines.LEFT_LOADER_JAG);
        }
        catch(CANTimeoutException e) {
            System.out.println("Could not instantiate left loader jag!");
        }
        hasInit = true;
    }
    else {
        System.out.println("The loader subsystem has already "
                                        + "been initialized!");
        return;
    }
}
 
開發者ID:alexbrinister,項目名稱:Nashoba-Robotics2014,代碼行數:18,代碼來源:Loader.java

示例6: DriveTrainSubsystem

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public DriveTrainSubsystem() {
    motors = new SpeedController[RobotMap.DRIVE_TRAIN.MOTORS.length];
    for (int i = 0; i < RobotMap.DRIVE_TRAIN.MOTORS.length; i++) {
        motors[i] = new Victor(RobotMap.DRIVE_TRAIN.MOTORS[i]);
    }
    doubleSidedPid = new PIDController649(EncoderBasedDriving.AUTO_DRIVE_P, EncoderBasedDriving.AUTO_DRIVE_I, EncoderBasedDriving.AUTO_DRIVE_D, this, this);
    doubleSidedPid.setAbsoluteTolerance(EncoderBasedDriving.ABSOLUTE_TOLERANCE);
    doubleSidedPid.setOutputRange(-EncoderBasedDriving.MAX_MOTOR_POWER, EncoderBasedDriving.MAX_MOTOR_POWER);
    encoders = new Encoder[RobotMap.DRIVE_TRAIN.ENCODERS.length / 2];
    for (int x = 0; x < RobotMap.DRIVE_TRAIN.ENCODERS.length; x += 2) {
        encoders[x / 2] = new Encoder(RobotMap.DRIVE_TRAIN.ENCODERS[x], RobotMap.DRIVE_TRAIN.ENCODERS[x + 1], x == 0, EncodingType.k2X);
        encoders[x / 2].setDistancePerPulse(EncoderBasedDriving.ENCODER_DISTANCE_PER_PULSE);
    }
    lastRates = new Vector();
    shifterSolenoid = new DoubleSolenoid(RobotMap.DRIVE_TRAIN.FORWARD_SOLENOID_CHANNEL, RobotMap.DRIVE_TRAIN.REVERSE_SOLENOID_CHANNEL);
}
 
開發者ID:SaratogaMSET,項目名稱:649code2014,代碼行數:17,代碼來源:DriveTrainSubsystem.java

示例7: Loader

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public Loader()
{
    Conveyor = new Victor(ReboundRumble.LOADER_CONVEYOR_PWM);
    loaderInSolenoid = new Solenoid(ReboundRumble.LOADER_IN_SOLENOID_CHANNEL);
    loaderOutSolenoid = new Solenoid(ReboundRumble.LOADER_OUT_SOLENOID_CHANNEL);
    loaderUpSolenoid = new Solenoid(ReboundRumble.LOADER_UP_SOLENOID_CHANNEL);
    loaderDownSolenoid = new Solenoid(ReboundRumble.LOADER_DOWN_SOLENOID_CHANNEL);
    loaderIn = new DigitalInput(ReboundRumble.LOAD_IN_GPIO_CHANNEL);
    loaderOut = new DigitalInput(ReboundRumble.LOAD_OUT_GPIO_CHANNEL);
    loaderUp = new DigitalInput(ReboundRumble.LOAD_UP_GPIO_CHANNEL);
    loaderDown = new DigitalInput(ReboundRumble.LOAD_DOWN_GPIO_CHANNEL);
    loaderDownSolenoid.set(false);
    loaderUpSolenoid.set(true);
    loaderOutSolenoid.set(false);
    loaderInSolenoid.set(true);
}
 
開發者ID:FIRST-FRC-Team-2028,項目名稱:2012,代碼行數:17,代碼來源:Loader.java

示例8: SystemShooter

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public SystemShooter() {
    super();
    wheel1 = new Victor(5); // Both bots: 5
    wheel2 = new Victor(6); // Both bots: 6

    cockOn = new Solenoid(4); //competition: 4 / practice: 1
    cockOff = new Solenoid(3); //competition: 3 / practice: 2
    fireOn = new Solenoid(6); // competition: 6 / practice: 5
    fireOff = new Solenoid(5); // competition: 5 / practice 6
    gateUp = new Solenoid(1); // competition: 1 / practice 3
    gateDown = new Solenoid(2); // competition: 2 / practice 4

    autoShoot = false;
    isShootingAngle = true;
    
    frisbeesShot = 0;
    
    enteringLoop = false;
    
    cockTime = WiredCats2415.textReader.getValue("cockTime");
    gatesDownTime = WiredCats2415.textReader.getValue("gatesDownTime");
    fireTime = WiredCats2415.textReader.getValue("fireTime");
    
    System.out.println("[WiredCats] Initialized System Shooter");
}
 
開發者ID:wiredcats,項目名稱:EventBasedWiredCats,代碼行數:26,代碼來源:SystemShooter.java

示例9: SystemArm

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public SystemArm(ControllerShooter cs) {
    super();
    this.shooter = cs;
    
    arm = new Victor(3); // Both bots: 3
    kp = WiredCats2415.textReader.getValue("propConstantArm");
    ki = WiredCats2415.textReader.getValue("integralConstantArm");
    kd = WiredCats2415.textReader.getValue("derivativeConstantArm");

    intakePreset = WiredCats2415.textReader.getValue("intakePreset");
    backPyramidPreset = WiredCats2415.textReader.getValue("backPyramidPreset");
    frontPyramidPreset = WiredCats2415.textReader.getValue("frontPyramidPreset");
    hoverPreset = WiredCats2415.textReader.getValue("hoverPreset");
    upperBoundHardStop = WiredCats2415.textReader.getValue("upperBoundHardStop");

    desiredArmAngle = 0;
    
    isManualControl = false;
    
    armHasBeenReset = false;
    
    System.out.println("[WiredCats] Initialized System Arm.");
}
 
開發者ID:wiredcats,項目名稱:EventBasedWiredCats,代碼行數:24,代碼來源:SystemArm.java

示例10: RightTankDrivePIDSubsystem

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public RightTankDrivePIDSubsystem() {
    super("LeftTankDrivePIDSubsystem", Kp, Ki, Kd);

    // Use these to get going:
    // setSetpoint() -  Sets where the PID controller should move the system
    //                  to
    // enable() - Enables the PID controller.
    frontRightMotor = new Victor(RobotMap.FRONT_RIGHT_DRIVE_MOTOR);
    backRightMotor = new Victor(RobotMap.BACK_RIGHT_DRIVE_MOTOR);
    
    rightEncoder = new Encoder(RobotMap.FRONT_RIGHT_ENCODER_A, RobotMap.FRONT_RIGHT_ENCODER_B);
    rightEncoder.start();
    rightEncoder.setDistancePerPulse(1.0);
    
    rampTimer = new Timer();
    rampTimer.start();
}
 
開發者ID:frc1675,項目名稱:frc1675-2013,代碼行數:18,代碼來源:RightTankDrivePIDSubsystem.java

示例11: LeftTankDrivePIDSubsystem

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public LeftTankDrivePIDSubsystem() {
    super("LeftTankDrivePIDSubsystem", Kp, Ki, Kd);

    // Use these to get going:
    // setSetpoint() -  Sets where the PID controller should move the system
    //                  to
    // enable() - Enables the PID controller.
    frontLeftMotor = new Victor(RobotMap.FRONT_LEFT_DRIVE_MOTOR);
    backLeftMotor = new Victor(RobotMap.BACK_LEFT_DRIVE_MOTOR);
    
    leftEncoder = new Encoder(RobotMap.FRONT_LEFT_ENCODER_A, RobotMap.FRONT_LEFT_ENCODER_B);
    leftEncoder.start();
    leftEncoder.setDistancePerPulse(1.0);
    
    rampTimer = new Timer();
    rampTimer.start();
}
 
開發者ID:frc1675,項目名稱:frc1675-2013,代碼行數:18,代碼來源:LeftTankDrivePIDSubsystem.java

示例12: init

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveTrainLeftFront = new Victor(0);
    LiveWindow.addActuator("DriveTrain", "LeftFront", (Victor) driveTrainLeftFront);
    
    driveTrainLeftRear = new Victor(1);
    LiveWindow.addActuator("DriveTrain", "LeftRear", (Victor) driveTrainLeftRear);
    
    driveTrainRightFront = new Victor(2);
    LiveWindow.addActuator("DriveTrain", "RightFront", (Victor) driveTrainRightFront);
    
    driveTrainRightRear = new Victor(3);
    LiveWindow.addActuator("DriveTrain", "RightRear", (Victor) driveTrainRightRear);
    
    driveTrainRobotDrive = new RobotDrive(driveTrainLeftFront, driveTrainLeftRear,
          driveTrainRightFront, driveTrainRightRear);
    
    driveTrainRobotDrive.setSafetyEnabled(false);
    driveTrainRobotDrive.setExpiration(0.1);
    driveTrainRobotDrive.setSensitivity(1.0);
    driveTrainRobotDrive.setMaxOutput(1.0);

    shootershooterTalon = new CANTalon(0);
    LiveWindow.addActuator("Shooter", "shooterTalon", shootershooterTalon);
    

// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    // set this up
    gyro = new ADXRS450_Gyro();
}
 
開發者ID:Team2667,項目名稱:SteamWorks,代碼行數:31,代碼來源:RobotMap.java

示例13: Intake

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public Intake() {
	Actuator = new DoubleSolenoid(RobotMap.Solenoid.IntakeSolenoidForwards,
			RobotMap.Solenoid.IntakeSolenoidBackwards);
	IntakeCIM = new Victor(RobotMap.Pwm.MainIntakeVictor);
	IntakeCIM2 = new Victor(RobotMap.Pwm.CrossIntakeVictor);

}
 
開發者ID:chopshop-166,項目名稱:frc-2016,代碼行數:8,代碼來源:Intake.java

示例14: AimShooter

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public AimShooter() {

		pot = new AnalogInput(RobotMap.Analog.ShooterPotAngle);
		pot.setPIDSourceType(PIDSourceType.kDisplacement);
		motor = new Victor(RobotMap.Pwm.ShooterAngleMotor);

		anglePID = new PIDSpeedController(pot, motor, "anglePID", "AimShooter");

		updatePIDConstants();
		anglePID.set(0);
	}
 
開發者ID:chopshop-166,項目名稱:frc-2016,代碼行數:12,代碼來源:AimShooter.java

示例15: reset

import edu.wpi.first.wpilibj.Victor; //導入依賴的package包/類
public void reset() {
	for (int i = 0; i < motors.length; i++) {
		if (motors[i] == null) {
			continue;
		}
		if (motors[i] instanceof CANTalon) {
			((CANTalon) motors[i]).delete();
		} else if (motors[i] instanceof Victor) {
			((Victor) motors[i]).free();
		}
	}
	motors = new SpeedController[64];
	
	for (int i = 0; i < solenoids.length; i++) {
		if (solenoids[i] == null) {
			continue;
		}
		solenoids[i].free();
	}
	solenoids = new Solenoid[64];

	for (int i = 0; i < relays.length; i++) {
		if (relays[i] == null) {
			continue;
		}
		relays[i].free();
	}
	relays = new Relay[64];

	for (int i = 0; i < analogInputs.length; i++) {
		if (analogInputs[i] == null) {
			continue;
		}
		analogInputs[i].free();
	}
	analogInputs = new AnalogInput[64];
	
	if (compressor != null)
	compressor.free();
}
 
開發者ID:Wazzaps,項目名稱:PCRobotClient,代碼行數:41,代碼來源:Robot.java


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