コード例 #1
0
  private void setUp_Controler_Xbox_1() {
    xbox_1 = new Joystick(0);

    x_1 = new JoystickButton(xbox_1, 3);
    x_1.whileHeld(new Claw_To_Position(20));
    b_1 = new JoystickButton(xbox_1, 2);
    b_1.whileHeld(new Claw_To_Position(13.5));

    a_1 = new JoystickButton(xbox_1, 1);
    // a_1.whenPressed(new Drive_Spin_In_Place_PID_TrackTarget());
    a_1.whenPressed(new Drive_Spin_In_Place_PID_TrackTarget());
    a_1.whenReleased(new Drive_Robot_Robot_Oriented_Mecanum());
    // a_1.whileHeld(new Drive_Spin_In_Place_PID_TrackTarget());
    rB_1 = new JoystickButton(xbox_1, 8);
    rB_1.whenPressed(new Auto_Ready_Climb());
    lB_1 = new JoystickButton(xbox_1, 5);
    lB_1.whileHeld(new Scissor_To_Position(RobotMap.SCISSOR_STOW_POS));
    y_1 = new JoystickButton(xbox_1, 4);
    // y_1.whileHeld(new Auto_Track_Target_Center());
    // y_1.whileHeld(new Auto_Track_Target_X_Center_PID());
    // y_1.whileHeld(new Auto_Track_Target_Y_Center_PID());
    y_1.whileHeld(new Auto_Track_Target_XY());
    turboStick_1 = new JoystickButton(xbox_1, 9);
    turboStick_1.whileHeld(new Drive_Turbo_NoTimeOut());
    snailStick_1 = new JoystickButton(xbox_1, 10);
    snailStick_1.whileHeld(new Drive_Snail_NoTimeOut());
    reset_1 = new JoystickButton(xbox_1, 7);
    reset_1.whileHeld(new SeaLegs_Return_To_TDC());
  }
コード例 #2
0
  private void setUp_Controler_LaunchPad() {
    launchPad = new Joystick(2);

    toggleSwitch = new JoystickButton(launchPad, 7);
    toggleSwitch.whileHeld(new Drive_Robot_Field_Oriented_Mecanum());
    referenceLeftSeaLeg = new JoystickButton(launchPad, 8);
    referenceLeftSeaLeg.whenReleased(new SeaLegs_Left_Reference_Cycle());

    referenceRightSeaLeg = new JoystickButton(launchPad, 9);
    referenceRightSeaLeg.whenReleased(new SeaLegs_Right_Reference_Cycle());

    returnSeaLeg_to_TDC = new JoystickButton(launchPad, 10);
    returnSeaLeg_to_TDC.whileHeld(new SeaLegs_Return_To_TDC());

    // returnSeaLeg_to_Deploy = new JoystickButton(launchPad, 11);
    // returnSeaLeg_to_Deploy.whileHeld(new SeaLegs_Deploy());

    Secure_Ball = new JoystickButton(launchPad, 1);
    Secure_Ball.whenPressed(new Auto_Cycle_Secure_Ball());

    Soft_Release = new JoystickButton(launchPad, 2);
    Soft_Release.whenPressed(new PinBall_Cycle_SOFT());

    ScissorToClimb = new JoystickButton(launchPad, 3);
    // ScissorToClimb.whileHeld(new Scissor_To_Position(RobotMap.SCISSOR_CLIMB_REACH_BAR));
    ScissorToClimb.whenPressed(new Auto_Ready_Climb());

    ScissorStartClimb = new JoystickButton(launchPad, 4);
    /*
     * whats best when Pressed or while held
     */
    // ScissorStartClimb.whileHeld(new Scissor_To_Position(RobotMap.SCISSOR_CLIMB_LIFT_BOT));
    ScissorStartClimb.whenPressed(new Scissor_To_Position(RobotMap.SCISSOR_CLIMB_LIFT_BOT));

    ScissorToDefence = new JoystickButton(launchPad, 5);
    ScissorToDefence.whenPressed(new Scissor_to_Defence_Command_Group());
    // ScissorToDefence.whenPressed(new Scissor_To_Position(RobotMap.SCISSOR_DEFENCE_POS));

    ScissorToStow = new JoystickButton(launchPad, 6);
    ScissorToStow.whileHeld(new Scissor_To_Position(RobotMap.SCISSOR_STOW_POS));

    // DemoToggle = new JoystickButton(launchPad,11);
    // DemoToggle.whileHeld(new DemoToggle_Command());

  }
コード例 #3
0
 private void setUp_Controler_Xbox_2() {
   xbox_2 = new Joystick(1);
   x_2 = new JoystickButton(xbox_2, 3);
   x_2.whileHeld(new Claw_To_Position(20));
   b_2 = new JoystickButton(xbox_2, 2);
   b_2.whileHeld(new Claw_To_Position(13.5));
   rB_2 = new JoystickButton(xbox_2, 6);
   rB_2.whileHeld(new Scissor_To_Position(RobotMap.SCISSOR_DEFENCE_POS + 2));
   lB_2 = new JoystickButton(xbox_2, 5);
   lB_2.whileHeld(new Scissor_To_Position(RobotMap.SCISSOR_STOW_POS));
   reset_2 = new JoystickButton(xbox_2, 7);
   reset_2.whenPressed(new PinBall_Reset());
   start_2 = new JoystickButton(xbox_2, 8);
   start_2.whileHeld(new PinBall_Cycle());
   start_2.whenReleased(new PinBall_Reset());
   a_2 = new JoystickButton(xbox_2, 1);
   a_2.whileHeld(new Wrist_Jog_Down());
   y_2 = new JoystickButton(xbox_2, 4);
   y_2.whileHeld(new Wrist_Jog_Up());
 }