Class SwerveDriveTelemetry

java.lang.Object
swervelib.telemetry.SwerveDriveTelemetry

public class SwerveDriveTelemetry extends Object
Telemetry to describe the SwerveDrive following frc-web-components. (Which follows AdvantageKit)
  • Field Details

    • canIdWarning

      public static final Alert canIdWarning
      An Alert for if the CAN ID is greater than 40.
    • i2cLockupWarning

      public static final Alert i2cLockupWarning
      An Alert for if there is an I2C lockup issue on the roboRIO.
    • serialCommsIssueWarning

      public static final Alert serialCommsIssueWarning
      NavX serial comm issue.
    • measuredStatesObj

      public static SwerveModuleState[] measuredStatesObj
      Measured swerve module states object.
    • desiredStatesObj

      public static SwerveModuleState[] desiredStatesObj
      Desired swerve module states object
    • measuredChassisSpeedsObj

      public static ChassisSpeeds measuredChassisSpeedsObj
      The maximum achievable angular velocity of the robot. This is used to visualize the angular velocity from the chassis speeds properties.
    • desiredChassisSpeedsObj

      public static ChassisSpeeds desiredChassisSpeedsObj
      Describes the desired forward, sideways and angular velocity of the robot.
    • robotRotationObj

      public static Rotation2d robotRotationObj
      The robot's current rotation based on odometry or gyro readings
    • verbosity

      public static SwerveDriveTelemetry.TelemetryVerbosity verbosity
      The current telemetry verbosity level.
    • isSimulation

      public static boolean isSimulation
      State of simulation of the Robot, used to optimize retrieval.
    • moduleCount

      public static int moduleCount
      The number of swerve modules
    • wheelLocations

      public static double[] wheelLocations
      The Locations of the swerve drive wheels.
    • measuredStates

      public static double[] measuredStates
      An array of rotation and velocity values describing the measured state of each swerve module
    • desiredStates

      public static double[] desiredStates
      An array of rotation and velocity values describing the desired state of each swerve module
    • robotRotation

      public static double robotRotation
      The robot's current rotation based on odometry or gyro readings
    • maxSpeed

      public static double maxSpeed
      The maximum achievable speed of the modules, used to adjust the size of the vectors.
    • rotationUnit

      public static String rotationUnit
      The units of the module rotations and robot rotation
    • sizeLeftRight

      public static double sizeLeftRight
      The distance between the left and right modules.
    • sizeFrontBack

      public static double sizeFrontBack
      The distance between the front and back modules.
    • forwardDirection

      public static String forwardDirection
      The direction the robot should be facing when the "Robot Rotation" is zero or blank. This option is often useful to align with odometry data or match videos. 'up', 'right', 'down' or 'left'
    • maxAngularVelocity

      public static double maxAngularVelocity
      The maximum achievable angular velocity of the robot. This is used to visualize the angular velocity from the chassis speeds properties.
    • measuredChassisSpeeds

      public static double[] measuredChassisSpeeds
      The maximum achievable angular velocity of the robot. This is used to visualize the angular velocity from the chassis speeds properties.
    • desiredChassisSpeeds

      public static double[] desiredChassisSpeeds
      Describes the desired forward, sideways and angular velocity of the robot.
    • updateSettings

      public static boolean updateSettings
      Update the telemetry settings that infrequently change.
  • Constructor Details

    • SwerveDriveTelemetry

      public SwerveDriveTelemetry()
  • Method Details

    • startCtrlCycle

      public static void startCtrlCycle()
      Start the ctrl timer to measure cycle time, independent of periodic loops.
    • endCtrlCycle

      public static void endCtrlCycle()
      Update the Control cycle time.
    • startOdomCycle

      public static void startOdomCycle()
      Start the odom cycle timer to calculate how long each odom took. Independent of periodic loops.
    • endOdomCycle

      public static void endOdomCycle()
      Update the odom cycle time.
    • updateSwerveTelemetrySettings

      public static void updateSwerveTelemetrySettings()
      Update only the settings that infrequently or never change.
    • updateData

      public static void updateData()
      Upload data to smartdashboard