Class TuningMenu

java.lang.Object
com.crossbotics.ftchelper.tuning.TuningMenu

public class TuningMenu extends Object
A menu on the Driver Station to change Tunable numbers with a gamepad, while the robot runs. Only works in the PRACTICE profile, so it can never be opened by accident at an event.

 TuningMenu menu = new TuningMenu(gamepad1);
 controls.bindPress(Pad.G1, Btn.GUIDE, menu::toggle);   // open/close (any button you like)
 // every loop:
 menu.update();
 if (menu.isOpen()) { menu.addTelemetry(t); }            // the menu takes over the screen
 else { ...normal driving with gamepad1... }
 

While open: D-pad up/down = choose, D-pad right/left = change by one step, right/left bumper = step x10, A = save on the hub, X = put the chosen one back to the code value, Y = put ALL back to the code values (and delete the saved values).

menu::toggle hands over the menu's toggle method itself (a "method reference"), so the button can run it later. Profiles: docs/guides/profiles.md. Docs: docs/guides/tuning.md

  • Constructor Details

    • TuningMenu

      public TuningMenu(com.qualcomm.robotcore.hardware.Gamepad gamepad)
      Makes a menu.
      Parameters:
      gamepad - the gamepad that runs the menu
  • Method Details

    • toggle

      public void toggle()
      Opens or closes the menu. In the COMPETITION profile it stays closed.
    • isOpen

      public boolean isOpen()
      True while the menu is open. Do not drive with the same gamepad while it is open.
    • update

      public void update()
      Reads the gamepad. Call every loop (it does nothing while closed).
    • addTelemetry

      public void addTelemetry(RobotTelemetry t)
      Shows the menu (only when open).
      Parameters:
      t - the telemetry to add the menu lines to