Class CommunicationManager

java.lang.Object
frc.team_8840_lib.input.communication.CommunicationManager

public class CommunicationManager extends Object
  • Field Details

  • Method Details

    • getInstance

      public static CommunicationManager getInstance()
      Get the instance of the CommunicationManager. This is the same as i().
      Returns:
      The instance of the CommunicationManager.
    • i

      public static CommunicationManager i()
      Get the instance of the CommunicationManager. Shorter name for convenience.
      Returns:
      The instance of the CommunicationManager.
    • init

      public static void init()
      Start the communication manager. This method is used internally and should not be called.
    • base

      public static String base()
      Returns the base path of the network table for 8840-utils
      Returns:
      The base path of the network table for 8840-utils.
    • legacyWaitForAutonomousPath

      @Deprecated(since="2023.2.1") public CommunicationManager legacyWaitForAutonomousPath(PathCallback callback)
      Deprecated.
      This method is the legacy version of waitForAutonomousPath. It is only used for backwards compatibility.
      Parameters:
      callback - The callback to be called when a new autonomous path is received.
      Returns:
      The CommunicationManager instance.
    • waitForAutonomousPath

      public CommunicationManager waitForAutonomousPath(Callback callback)
      This method is the new version of waitForAutonomousPath. It is used for the new autonomous pathing system.
      Parameters:
      callback - The callback to be called when a new autonomous path is received.
      Returns:
      The CommunicationManager instance.
    • readAndParsePath

      public TimePoint[] readAndParsePath(org.json.JSONObject json, boolean toLastMovementPoint)
      This method is used to read a json file and parse it into a TimePoint array.
      Parameters:
      json - The json object to read.
      toLastMovementPoint - Whether or not to only parse up to the last movement point, or the full timeline.
      Returns:
      The parsed TimePoint array.
    • updateStatus

      public CommunicationManager updateStatus(String service, String status)
      Update the status of a service.
      Parameters:
      service - The service to update.
      status - The new status of the service.
      Returns:
      The CommunicationManager instance.
    • updateSwerveInfo

      public CommunicationManager updateSwerveInfo(SwerveDrive swerveGroup)
    • updateSpeedControllerInfo

      public CommunicationManager updateSpeedControllerInfo(ControllerGroup group)
    • updateMotorControllerInfo

      public CommunicationManager updateMotorControllerInfo(edu.wpi.first.wpilibj.motorcontrol.MotorController controller, String name)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, String value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, String[] list)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, double value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, int value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, boolean value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, byte[] value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, double[] value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, long[] value)
    • updateInfo

      public CommunicationManager updateInfo(String tab, String key, boolean[] value)
    • fieldExists

      public boolean fieldExists()
    • createField

      public void createField()
    • updateRobotPose

      public void updateRobotPose(edu.wpi.first.math.geometry.Pose2d pose)
    • updateFieldObjectPose

      public void updateFieldObjectPose(String name, edu.wpi.first.math.geometry.Pose2d pose)
    • get

      public edu.wpi.first.networktables.NetworkTableEntry get(String tab, String key)
      Returns the NetworkTableEntry for a given tab and key.
      Parameters:
      tab - The tab to get the entry from.
      key - The key to get the entry from.
      Returns:
      The NetworkTableEntry for the given tab and key.
    • closeComms

      public void closeComms()
      Closes all network communications.
    • setServerNotifications

      public static void setServerNotifications(boolean enabled)
      Sets the API server notifications to be enabled or disabled.
      Parameters:
      enabled -