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

项目:Steamwork_2017    文件:Robot.java   
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);
}
项目:2014-Aerial-Assist    文件:RobotTemplate.java   
/**
 * 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();
}
项目:aeronautical-facilitation    文件:DriveTrain.java   
/**
 *
 */
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();
}
项目: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();
}
项目:Nashoba-Robotics2014    文件:Loader.java   
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;
    }
}
项目:649code2014    文件:DriveTrainSubsystem.java   
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);
}
项目:2012    文件:Loader.java   
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);
}
项目:bainbridgefirst    文件:RobotTemplate.java   
/**
 * 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();
}
项目:EventBasedWiredCats    文件:SystemShooter.java   
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");
}
项目:EventBasedWiredCats    文件:SystemArm.java   
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.");
}
项目:frc1675-2013    文件:RightTankDrivePIDSubsystem.java   
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();
}
项目:frc1675-2013    文件:LeftTankDrivePIDSubsystem.java   
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();
}
项目:SteamWorks    文件:RobotMap.java   
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();
}
项目:frc-2016    文件:Intake.java   
public Intake() {
    Actuator = new DoubleSolenoid(RobotMap.Solenoid.IntakeSolenoidForwards,
            RobotMap.Solenoid.IntakeSolenoidBackwards);
    IntakeCIM = new Victor(RobotMap.Pwm.MainIntakeVictor);
    IntakeCIM2 = new Victor(RobotMap.Pwm.CrossIntakeVictor);

}
项目:frc-2016    文件:AimShooter.java   
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);
    }
项目:PCRobotClient    文件:Robot.java   
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();
}
项目:turtleshell    文件:Robot.java   
public Robot() {
    stick = new Joystick(0);
    try {
        /* Construct Digital I/O Objects */
        pwm_out_9 = new Victor(        getChannelFromPin( PinType.PWM,       9 ));
        pwm_out_8 = new Jaguar(        getChannelFromPin( PinType.PWM,       8 ));
        dig_in_7  = new DigitalInput(  getChannelFromPin( PinType.DigitalIO, 7 ));
        dig_in_6  = new DigitalInput(  getChannelFromPin( PinType.DigitalIO, 6 ));
        dig_out_5 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO, 5 ));
        dig_out_4 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO, 4 ));
        enc_3and2 = new Encoder(       getChannelFromPin( PinType.DigitalIO, 3 ),
                                       getChannelFromPin( PinType.DigitalIO, 2 ));
        enc_1and0 = new Encoder(       getChannelFromPin( PinType.DigitalIO, 1 ),
                                       getChannelFromPin( PinType.DigitalIO, 0 ));

        /* Construct Analog I/O Objects */
        /* NOTE:  Due to a board layout issue on the navX MXP board revision */
        /* 3.3, there is noticeable crosstalk between AN IN pins 3, 2 and 1. */
        /* For that reason, use of pin 3 and pin 2 is NOT RECOMMENDED.       */
        an_in_1   = new AnalogInput(   getChannelFromPin( PinType.AnalogIn,  1 ));
        an_trig_0 = new AnalogTrigger( getChannelFromPin( PinType.AnalogIn,  0 ));
        an_trig_0_counter = new Counter( an_trig_0 );

        an_out_1  = new AnalogOutput(  getChannelFromPin( PinType.AnalogOut, 1 ));
        an_out_0  = new AnalogOutput(  getChannelFromPin( PinType.AnalogOut, 0 ));

        /* Configure I/O Objects */
        pwm_out_9.setSafetyEnabled(false); /* Disable Motor Safety for Demo */
        pwm_out_8.setSafetyEnabled(false); /* Disable Motor Safety for Demo */

        /* Configure Analog Trigger */
        an_trig_0.setAveraged(true);
        an_trig_0.setLimitsVoltage(MIN_AN_TRIGGER_VOLTAGE, MAX_AN_TRIGGER_VOLTAGE);
    } catch (RuntimeException ex ) {
        DriverStation.reportError( "Error instantiating MXP pin on navX MXP:  " 
                                    + ex.getMessage(), true);
    }
}
项目:turtleshell    文件:Claw.java   
public Claw() {
      super();
      motor = new Victor(7);
      contact = new DigitalInput(5);

// Let's show everything on the LiveWindow
      LiveWindow.addActuator("Claw", "Motor", (Victor) motor);
      LiveWindow.addActuator("Claw", "Limit Switch", contact);
  }
项目:turtleshell    文件:Robot.java   
public Robot() {
    stick = new Joystick(0);
    try {
        /* Construct Digital I/O Objects */
        pwm_out_9 = new Victor(        getChannelFromPin( PinType.PWM,       9 ));
        pwm_out_8 = new Jaguar(        getChannelFromPin( PinType.PWM,       8 ));
        dig_in_7  = new DigitalInput(  getChannelFromPin( PinType.DigitalIO, 7 ));
        dig_in_6  = new DigitalInput(  getChannelFromPin( PinType.DigitalIO, 6 ));
        dig_out_5 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO, 5 ));
        dig_out_4 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO, 4 ));
        enc_3and2 = new Encoder(       getChannelFromPin( PinType.DigitalIO, 3 ),
                                       getChannelFromPin( PinType.DigitalIO, 2 ));
        enc_1and0 = new Encoder(       getChannelFromPin( PinType.DigitalIO, 1 ),
                                       getChannelFromPin( PinType.DigitalIO, 0 ));

        /* Construct Analog I/O Objects */
        /* NOTE:  Due to a board layout issue on the navX MXP board revision */
        /* 3.3, there is noticeable crosstalk between AN IN pins 3, 2 and 1. */
        /* For that reason, use of pin 3 and pin 2 is NOT RECOMMENDED.       */
        an_in_1   = new AnalogInput(   getChannelFromPin( PinType.AnalogIn,  1 ));
        an_trig_0 = new AnalogTrigger( getChannelFromPin( PinType.AnalogIn,  0 ));
        an_trig_0_counter = new Counter( an_trig_0 );

        an_out_1  = new AnalogOutput(  getChannelFromPin( PinType.AnalogOut, 1 ));
        an_out_0  = new AnalogOutput(  getChannelFromPin( PinType.AnalogOut, 0 ));

        /* Configure I/O Objects */
        pwm_out_9.setSafetyEnabled(false); /* Disable Motor Safety for Demo */
        pwm_out_8.setSafetyEnabled(false); /* Disable Motor Safety for Demo */

        /* Configure Analog Trigger */
        an_trig_0.setAveraged(true);
        an_trig_0.setLimitsVoltage(MIN_AN_TRIGGER_VOLTAGE, MAX_AN_TRIGGER_VOLTAGE);
    } catch (RuntimeException ex ) {
        DriverStation.reportError( "Error instantiating MXP pin on navX MXP:  " 
                                    + ex.getMessage(), true);
    }
}
项目:2015RobotCode    文件:ArmElevator.java   
@Override
public void initialize() {

    m_victor = new Victor(RobotMap.LIFT_MOTOR);
    m_victor.enableDeadbandElimination(true);
    m_victor.setExpiration(Victor.DEFAULT_SAFETY_EXPIRATION);

    m_encoder = new Encoder(RobotMap.ENCODER_DIO_PORTA,
            RobotMap.ENCODER_DIO_PORTB, true);
    m_encoder.setSamplesToAverage(10);

    m_maxLimit = new DigitalInput(RobotMap.LIMIT_DIO_PORT1);
    max_counter = new Counter(m_maxLimit);

}
项目:4500-2014    文件:Winch.java   
Winch(JoyStickCustom inStick){
    winchRelease=new Pneumatics(1,2);
    winch= new Victor(5);

    states[0]="WINDING";
    states[1]="RELEASING";
    states[2]="HOLDING";
    setState(HOLDING1);//same as holding used to be

    limitSwitch= new DigitalInput(4);

    secondStick = inStick;
    winchE= new Encoder(3,2);
    winchE.start();
}
项目: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);

}
项目:Team3310FRC2014    文件:EncoderPIDSubsystem.java   
public EncoderPIDSubsystem(String name, double kP, double kI, double kD, int motorChannel, int encoderAChannel, int encoderBChannel, boolean reverseEncoder, double gearRatioEncoderToOutput) {
    super(name, kP, kI, kD);
    try {
        m_motorController = new Victor(motorChannel);
        m_encoder = new Encoder(1, encoderAChannel, 1, encoderBChannel, reverseEncoder, CounterBase.EncodingType.k4X);
        double degPerPulse = 360.0 / gearRatioEncoderToOutput / DEFAULT_PULSES_PER_ROTATION;
        m_encoder.setDistancePerPulse(degPerPulse);
        resetZeroPosition();
    } catch (Exception e) {
        System.out.println("Unknown error initializing " + getName() + "-EncoderPIDSubsystem.  Message = " + e.getMessage());
    }
}
项目:Team3310FRC2014    文件:EncoderPIDSubsystem.java   
public EncoderPIDSubsystem(String name, double kP, double kI, double kD, int motorChannel, int encoderAChannel, int encoderBChannel, boolean reverseEncoder, double wheelDiameter, double gearRatioEncoderToWheel) {
    super(name, kP, kI, kD);
    try {
        m_motorController = new Victor(motorChannel);
        m_encoder = new Encoder(1, encoderAChannel, 1, encoderBChannel, reverseEncoder, CounterBase.EncodingType.k4X);
        double distancePerPulse = Math.PI * wheelDiameter / gearRatioEncoderToWheel / DEFAULT_PULSES_PER_ROTATION;
        m_encoder.setDistancePerPulse(distancePerPulse);
        resetZeroPosition();
    } catch (Exception e) {
        System.out.println("Unknown error initializing " + getName() + "-EncoderPIDSubsystem.  Message = " + e.getMessage());
    }
}
项目:Team3310FRC2014    文件:Intake.java   
public Intake() {
    super("Intake", RobotMap.INTAKE_EXTEND_PNEUMATIC_MODULE_ID, RobotMap.INTAKE_EXTEND_PNEUMATIC_RELAY_ID,
          RobotMap.INTAKE_RETRACT_PNEUMATIC_MODULE_ID, RobotMap.INTAKE_RETRACT_PNEUMATIC_RELAY_ID);
    try {
        m_ballDetectSwitch1 = new DigitalInput(RobotMap.BALL_INTAKE_1_DSC_DIO_ID);
        m_motorControllerTop = new Victor(RobotMap.INTAKE_TOP_DSC_PWM_ID);
        m_motorControllerBottom = new Victor(RobotMap.INTAKE_BOTTOM_DSC_PWM_ID);             
    } catch (Exception e) {
        System.out.println("Unknown error initializing " + getName() + ".  Message = " + e.getMessage());
    }
}
项目:Team3310FRC2014    文件:MotorTest.java   
public MotorTest(int numMotors) {
    super("MotorTestSubsystem");

    try {
        m_motorController = new Victor[numMotors];

        for (int motorId = 0; motorId < numMotors; motorId++) {
            m_motorController[motorId] = new Victor(motorId+1);
        }
    } catch (Exception e) {
        System.out.println("Unknown error initializing " + getName() + ".  Message = " + e.getMessage());
    }
}
项目:2013_drivebase_proto    文件:WsDriveSpeed.java   
public WsDriveSpeed(String name, int channel1, int channel2) {
    this.motorSpeed = new DoubleSubject(name);
    this.victor1 = new Victor(channel1);
    this.victor2 = new Victor(channel2);

    motorSpeed.setValue(0.0);
}
项目:Robot2014    文件:Winch.java   
/**
 * the winch of the shooter device
 */
public Winch() {
    rightMotor = new Victor(RobotMap.rightShooterMotor);
    leftMotor = new Victor(RobotMap.leftShooterMotor);
    limitSwitch = new DigitalInput(RobotMap.shooterLimitSwitch);
    winch = new Piston(RobotMap.shooterExtended, RobotMap.shooterRetracted);
}
项目:Robot2014    文件:Drivetrain.java   
/**
 * controls the drive train motors of the robot
 */
public Drivetrain() {
    left = new Victor(RobotMap.leftMotors);
    leftTwo = new Victor(RobotMap.leftTwoMotors);
    right = new Victor(RobotMap.rightMotors);
    rightTwo = new Victor(RobotMap.rightTwoMotors);
}
项目:PainTrain    文件:Shooter.java   
public Shooter(int encoderA, int encoderB, int victor1, int victor2, int victor3) {
    m_encode = new Encoder(encoderA, encoderB);
    m_encode.start();
    m_encode.reset();
    m_motor1 = new Victor(victor1);
    m_motor2 = new Victor(victor2);
    m_motor3 = new Victor(victor3);
    m_shootTimer = new Timer();
    m_retractTimer = new Timer();

}
项目:PainTrain    文件:Intake.java   
Intake(int solenoid1Port1, int solenoid2Port1, int victorNumber){
    m_leftSolenoid  = new DoubleSolenoid(solenoid1Port1, solenoid1Port1 +1);
    m_rightSolenoid = new DoubleSolenoid(solenoid2Port1, solenoid2Port1 +1);
    m_intakeMotor   = new Victor(victorNumber);
    m_solenoidTime  = new NerdyTimer(.05);
    m_solenoidTime.start();
}
项目:TitanRobot2014    文件:SpeedControllerFactory.java   
public TitanSpeedController create(int pChannel, Class<?> pClass, Switch pForwardLimitSwitch,
        Switch pReverseLimitSwitch, boolean pInvertDirection) {
    TitanSpeedController controller;
    if (pClass.equals(Talon.class)) {
        controller = new TitanSpeedController(new Talon(pChannel), pForwardLimitSwitch, pReverseLimitSwitch, pInvertDirection);
    }
    else if (pClass.equals(Victor.class)) {
        controller = new TitanSpeedController(new Victor(pChannel), pForwardLimitSwitch, pReverseLimitSwitch, pInvertDirection);
    }
    else {
        controller = new TitanSpeedController(new Jaguar(pChannel), pForwardLimitSwitch, pReverseLimitSwitch, pInvertDirection);
    }

    return controller;
}
项目:TitanRobot2014    文件:SpeedControllerFactory.java   
public TitanSpeedController create(int pChannel, Class pClass, Switch pForwardLimitSwitch,
        Switch pReverseLimitSwitch, boolean pInvertDirection) {
    TitanSpeedController controller;
    if (pClass.equals(Talon.class)) {
        controller = new TitanSpeedController(new Talon(pChannel), pForwardLimitSwitch, pReverseLimitSwitch, pInvertDirection);
    }
    else if (pClass.equals(Victor.class)) {
        controller = new TitanSpeedController(new Victor(pChannel), pForwardLimitSwitch, pReverseLimitSwitch, pInvertDirection);
    }
    else {
        controller = new TitanSpeedController(new Jaguar(pChannel), pForwardLimitSwitch, pReverseLimitSwitch, pInvertDirection);
    }

    return controller;
}
项目:Veer    文件:O_SwerveModule.java   
public O_SwerveModule(O_Point center, int CimPort, int turnPort, int turnEncoderA, int turnEncoderB, int zeroPort, double zeroOffset, boolean reverseEncoder){
    location = center;
    cim = new Victor(RobotMap.driveModule, CimPort);
    cim.setExpiration(0.5);
    turnMotor = new Talon(RobotMap.turnModule, turnPort);
    turnMotor.setExpiration(0.5);
    turnEncoder = new O_TurnEncoder(turnEncoderA, turnEncoderB, zeroPort, zeroOffset, reverseEncoder);
    turn = new PIDController(1.0, 0.1, 0.1, turnEncoder, turnMotor, .0010) {{
        setInputRange(-180, 180);
        setOutputRange(-.85, .85);
        setContinuous();
        enable();
    }};
}
项目:FRC-2015    文件:MotorClass.java   
public void ControlToggleRunMotor(Victor vMotor, int speed) {
    if (!toggleMotor) {
        vMotor.set(speed);
        toggleMotor = true;
    }else if (toggleMotor) {
        vMotor.set(0.0);
        toggleMotor = false;
    }
}
项目:FRC-2015    文件:MotorClass.java   
public void ControlHoldRunMotor(Victor vMotor, int speed, boolean holdingButton) {
    if (holdingButton) {
        vMotor.set(speed);
    }else{
        vMotor.set(0.0);
    }
}
项目:FRC-2015    文件:MotorClass.java   
public void AutoRunMotor(Victor vMotor, int speed, int seconds) {
    queueThread(new Runnable() {
        public void run() {
            R.autonomousCounter = 0;
            while ((Math.floor(R.autonomousCounter / loopsPerSecond)) <= seconds) {
                vMotor.set(speed);
                Timer.delay(timerDelay);    
            }
            vMotor.set(0.0);
        }
    });
}
项目:FRC-2015-Robot-Java    文件:RobotHardwareCompbot.java   
@Override
public void initialize()

{
    //PWM
    liftMotor = new Victor(0); //2);
    leftMotors = new Victor(1);
    rightMotors = new Victor(2); //0);
    armMotors = new Victor(3);
    transmission = new Servo(7);

    //CAN
    armSolenoid = new DoubleSolenoid(4,5);

    //DIO
    liftEncoder = new Encoder(0, 1, false, EncodingType.k4X);
    liftBottomLimit = new DigitalInput(2);
    liftTopLimit = new DigitalInput(3);
    backupLiftBottomLimit = new DigitalInput(5);

    switch1 = new DigitalInput(9);
    switch2 = new DigitalInput(8);

    //ANALOG
    gyro = new Gyro(0);

    //roboRio
    accelerometer = new BuiltInAccelerometer();

    //Stuff
    drivetrain = new RobotDrive(leftMotors, rightMotors);

    liftSpeedRatio = 1; //Half power default
    liftGear = 1;
    driverSpeedRatio = 1;
    debounceComp = 0;

    drivetrain.setInvertedMotor(MotorType.kRearLeft, true);
    drivetrain.setInvertedMotor(MotorType.kRearRight, true);
}
项目:649code2014    文件:ClawPivotSubsystem.java   
public ClawPivotSubsystem() {
    super("ClawSubsystem");
    motor = new Victor(RobotMap.CLAW_PIVOT.MOTOR);
    potentiometer = new AnalogPotentiometer(RobotMap.CLAW_PIVOT.POTENTIOMETER);
    clawPID = new PIDController649(kP, kI, kD, potentiometer, this);
    clawPID.setAbsoluteTolerance(0.01);
    clawPID.setOutputRange(MAX_FORWARD_SPEED, MAX_BACKWARD_SPEED);
}
项目:2014-robot    文件:Pickup.java   
/**
     * Creates a pickup object using the controlPack and sensorPack
     */
    public Pickup(){
        //motors
        rightPickupUpDown = new Victor(Channels.PICKUP_RAISE_LOWER_RIGHT_CHANNEL);
        leftPickupUpDown = new Victor(Channels.PICKUP_RAISE_LOWER_LEFT_CHANNEL);//was (1, CONSTANT)
        pickupRoller = new Victor(Channels.PICKUP_ROLLER_CHANNEL);

//        pickupEncoder = new Encoder(Channels.PICKUP_ENCODER_A_CHANNEL, Channels.PICKUP_ENCODER_B_CHANNEL);
//        sensors
//        pickupLoweredSwitch = new DigitalInput(Channels.PICKUP_LOWERED_CHANNEL);
//        pickupLiftedSwitch = new DigitalInput(Channels.PICKUP_RAISED_CHANNEL);

        controls = ControlPack.getInstance();
        System.out.println("Pickup online");
    }