コード例 #1
0
ファイル: Actuators.java プロジェクト: rdoty1902/DoNotExplode
  /** Initializes all actuators */
  public static void init() {
    // TODO: Change ID's
    // Motors
    rightDriveMotor = new CANTalon(3);
    rightDriveMotor =
        initCANTalon(
            rightDriveMotor,
            FeedbackDevice.QuadEncoder,
            RIGHT_DIVE_REVERSE_SENSOR,
            CODES_PER_REV,
            DRIVE_MOTOR_ACCEPTABLE_ERROR,
            RIGHT_DRIVE_KP,
            RIGHT_DRIVE_KI,
            RIGHT_DRIVE_KD);
    rightDriveMotor2 = new CANTalon(0);
    rightDriveMotor2.changeControlMode(CANTalon.TalonControlMode.Follower);
    rightDriveMotor2.setInverted(true);
    rightDriveMotor2.set(rightDriveMotor.getDeviceID());

    leftDriveMotor = new CANTalon(2);
    leftDriveMotor =
        initCANTalon(
            leftDriveMotor,
            FeedbackDevice.QuadEncoder,
            LEFT_DIVE_REVERSE_SENSOR,
            CODES_PER_REV,
            DRIVE_MOTOR_ACCEPTABLE_ERROR,
            LEFT_DRIVE_KP,
            LEFT_DRIVE_KI,
            LEFT_DRIVE_KD);
    leftDriveMotor.setInverted(true);
    leftDriveMotor2 = new CANTalon(1);
    leftDriveMotor2.changeControlMode(CANTalon.TalonControlMode.Follower);
    leftDriveMotor2.setInverted(true);
    leftDriveMotor2.set(leftDriveMotor.getDeviceID());

    armWinchMotor1 = new VictorSP(4);
    armWinchMotor2 = new VictorSP(5);
    armWinchMotor2.setInverted(true);

    armAngleMotor = new CANTalon(6);
    armAngleMotor =
        initCANTalon(
            armAngleMotor,
            FeedbackDevice.AnalogPot,
            ARM_REVERSE_SENSOR,
            ARM_POT_TURNS_PER_REV,
            ARM_ACCEPTABLE_EROR,
            ARM_ANGLE_KP,
            ARM_ANGLE_KI,
            ARM_ANGLE_KD);
    // TODO: Use string pot with CANTalon

    boulderIntakeMotor = new VictorSP(7);

    catapultMotor = new VictorSP(8);

    // Solenoids
    driveShiftPneumatic = new Solenoid(2);
    winchRatchetPneumatic = new Solenoid(1);
  }
コード例 #2
0
ファイル: Arm.java プロジェクト: thomasburke1/Success
 public void driveWithXbox(Joystick joystick1) {
   pivot1.set(joystick1.getY(Hand.kLeft) / 10);
   pivot2.set(joystick1.getY(Hand.kRight) / 10);
 }