Class TelemetryGamepad

java.lang.Object
edu.wpi.first.wpilibj2.command.button.CommandGenericHID
edu.wpi.first.wpilibj2.command.button.CommandXboxController
com.marslib.hmi.TelemetryGamepad

public class TelemetryGamepad extends edu.wpi.first.wpilibj2.command.button.CommandXboxController
A wrapper for CommandXboxController that dynamically logs string descriptors indicating what macro is mapped to what button securely to AdvantageKit and NetworkTables. This inherently allows Dashboards to visually represent controller bindings safely.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TelemetryGamepad(int port, String gamepadIdentity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    edu.wpi.first.wpilibj2.command.button.Trigger
    bindOnFalse(edu.wpi.first.wpilibj2.command.button.Trigger trigger, String buttonName, String actionName, edu.wpi.first.wpilibj2.command.Command cmd)
    Binds a command to a Trigger's `.onFalse()` scheduling method while automatically publishing the mapped action name to NetworkTables/AdvantageKit.
    edu.wpi.first.wpilibj2.command.button.Trigger
    bindOnTrue(edu.wpi.first.wpilibj2.command.button.Trigger trigger, String buttonName, String actionName, edu.wpi.first.wpilibj2.command.Command cmd)
    Binds a command to a Trigger's `.onTrue()` scheduling method while automatically publishing the mapped action name to NetworkTables/AdvantageKit.
    edu.wpi.first.wpilibj2.command.button.Trigger
    bindWhileTrue(edu.wpi.first.wpilibj2.command.button.Trigger trigger, String buttonName, String actionName, edu.wpi.first.wpilibj2.command.Command cmd)
    Binds a command to a Trigger's `.whileTrue()` scheduling method while automatically publishing the mapped action name to NetworkTables/AdvantageKit.
     

    Methods inherited from class edu.wpi.first.wpilibj2.command.button.CommandXboxController

    a, a, b, b, back, back, getHID, getLeftTriggerAxis, getLeftX, getLeftY, getRightTriggerAxis, getRightX, getRightY, leftBumper, leftBumper, leftStick, leftStick, leftTrigger, leftTrigger, leftTrigger, rightBumper, rightBumper, rightStick, rightStick, rightTrigger, rightTrigger, rightTrigger, start, start, x, x, y, y

    Methods inherited from class edu.wpi.first.wpilibj2.command.button.CommandGenericHID

    axisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, button, button, getRawAxis, isConnected, pov, pov, povCenter, povDown, povDownLeft, povDownRight, povLeft, povRight, povUp, povUpLeft, povUpRight, setRumble

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TelemetryGamepad

      public TelemetryGamepad(int port, String gamepadIdentity)
  • Method Details

    • bindOnTrue

      public edu.wpi.first.wpilibj2.command.button.Trigger bindOnTrue(edu.wpi.first.wpilibj2.command.button.Trigger trigger, String buttonName, String actionName, edu.wpi.first.wpilibj2.command.Command cmd)
      Binds a command to a Trigger's `.onTrue()` scheduling method while automatically publishing the mapped action name to NetworkTables/AdvantageKit.
      Parameters:
      trigger - The Trigger instance (e.g. this.a())
      buttonName - The human-readable physical button name (e.g. "A_Button")
      actionName - The macro the button runs (e.g. "Score Gamepiece")
      cmd - The Command to schedule
      Returns:
      The Trigger to allow method chaining
    • bindWhileTrue

      public edu.wpi.first.wpilibj2.command.button.Trigger bindWhileTrue(edu.wpi.first.wpilibj2.command.button.Trigger trigger, String buttonName, String actionName, edu.wpi.first.wpilibj2.command.Command cmd)
      Binds a command to a Trigger's `.whileTrue()` scheduling method while automatically publishing the mapped action name to NetworkTables/AdvantageKit.
      Parameters:
      trigger - The Trigger instance (e.g. this.a())
      buttonName - The human-readable physical button name (e.g. "RightTrigger")
      actionName - The macro the button runs (e.g. "Shoot On Move")
      cmd - The Command to schedule
      Returns:
      The Trigger to allow method chaining
    • bindOnFalse

      public edu.wpi.first.wpilibj2.command.button.Trigger bindOnFalse(edu.wpi.first.wpilibj2.command.button.Trigger trigger, String buttonName, String actionName, edu.wpi.first.wpilibj2.command.Command cmd)
      Binds a command to a Trigger's `.onFalse()` scheduling method while automatically publishing the mapped action name to NetworkTables/AdvantageKit.
      Parameters:
      trigger - The Trigger instance (e.g. this.a())
      buttonName - The human-readable physical button name (e.g. "A_Button")
      actionName - The macro the button runs (e.g. "Retract System")
      cmd - The Command to schedule
      Returns:
      The Trigger to allow method chaining
    • getBindingsMap

      public Map<String,String> getBindingsMap()