示例#1
0
  public Intake() {
    preferences = Preferences.getInstance();

    leftGate =
        new DoubleSolenoid(
            ElectricalConstants.rightGateForward, ElectricalConstants.rightGateReverse);

    rightGate = new Solenoid(ElectricalConstants.leftGate);
    try {
      arm = new CANJaguar(ElectricalConstants.armJag);
      arm.changeControlMode(CANJaguar.ControlMode.kPercentVbus);
      arm.configNeutralMode(CANJaguar.NeutralMode.kBrake);

      arm.configFaultTime(0.5);
      arm.configPotentiometerTurns(1);

      arm.setPositionReference(CANJaguar.PositionReference.kPotentiometer);
      arm.setPID(0, 0, 0);

      arm.enableControl(0);

    } catch (CANTimeoutException ex) {
      ex.printStackTrace();
    }
    rollers = new Victor(ElectricalConstants.rollerVic);
  }
示例#2
0
 public void reInit() {
   try {
     jagFlip = new CANJaguar(ElectricalConstants.JagFlipper);
     jagFlip.changeControlMode(CANJaguar.ControlMode.kPosition);
     jagFlip.configFaultTime(0.5);
     jagFlip.configNeutralMode(CANJaguar.NeutralMode.kBrake);
     jagFlip.configPotentiometerTurns(10);
     jagFlip.setPositionReference(CANJaguar.PositionReference.kPotentiometer);
     jagFlip.setPID(p, i, d);
     jagFlip.enableControl(0);
   } catch (CANTimeoutException ex) {
     ex.printStackTrace();
   }
 }
示例#3
0
 private Flipper() {
   p = PIDConstants.flipperP;
   i = PIDConstants.flipperI;
   d = PIDConstants.flipperD;
   try {
     jagFlip = new CANJaguar(ElectricalConstants.JagFlipper);
     jagFlip.changeControlMode(CANJaguar.ControlMode.kPosition);
     jagFlip.configFaultTime(0.5);
     jagFlip.configNeutralMode(CANJaguar.NeutralMode.kBrake);
     jagFlip.configPotentiometerTurns(10);
     jagFlip.setPositionReference(CANJaguar.PositionReference.kPotentiometer);
     jagFlip.setPID(p, i, d);
     jagFlip.enableControl(0);
   } catch (CANTimeoutException ex) {
     ex.printStackTrace();
   }
   gotoPosition();
 }