Class SwerveDriveTelemetry

java.lang.Object
swervelib.core.telemetry.SwerveDriveTelemetry

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

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Verbosity of telemetry data sent back.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.wpilib.util.Alert
    An Alert for if the CAN ID is greater than 40.
    static double[]
    Describes the desired forward, sideways and angular velocity of the robot.
    static org.wpilib.math.kinematics.ChassisVelocities
    Describes the desired forward, sideways and angular velocity of the robot.
    static double[]
    An array of rotation and velocity values describing the desired state of each swerve module
    static org.wpilib.math.kinematics.SwerveModuleVelocity[]
    Desired swerve module states object
    static String
    The direction the robot should be facing when the "Robot Rotation" is zero or blank.
    static final org.wpilib.util.Alert
    An Alert for if there is an I2C lockup issue on the roboRIO.
    static boolean
    State of simulation of the Robot, used to optimize retrieval.
    static double
    The maximum achievable angular velocity of the robot.
    static double
    The maximum achievable speed of the modules, used to adjust the size of the vectors.
    static double[]
    The maximum achievable angular velocity of the robot.
    static org.wpilib.math.kinematics.ChassisVelocities
    The maximum achievable angular velocity of the robot.
    static double[]
    An array of rotation and velocity values describing the measured state of each swerve module
    static org.wpilib.math.kinematics.SwerveModuleVelocity[]
    Measured swerve module states object.
    static int
    The number of swerve modules
    static double
    The robot's current rotation based on odometry or gyro readings
    static org.wpilib.math.geometry.Rotation2d
    The robot's current rotation based on odometry or gyro readings
    static String
    The units of the module rotations and robot rotation
    static final org.wpilib.util.Alert
    NavX serial comm issue.
    static double
    The distance between the front and back modules.
    static double
    The distance between the left and right modules.
    static boolean
    Update the telemetry settings that infrequently change.
    The current telemetry verbosity level.
    static double[]
    The Locations of the swerve drive wheels.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Update the Control cycle time.
    static void
    Update the odom cycle time.
    static void
    Start the ctrl timer to measure cycle time, independent of periodic loops.
    static void
    Start the odom cycle timer to calculate how long each odom took.
    static void
    Upload data to smartdashboard
    static void
    Update only the settings that infrequently or never change.

    Methods inherited from class Object

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

    • canIdWarning

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

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

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

      public static org.wpilib.math.kinematics.SwerveModuleVelocity[] measuredStatesObj
      Measured swerve module states object.
    • desiredStatesObj

      public static org.wpilib.math.kinematics.SwerveModuleVelocity[] desiredStatesObj
      Desired swerve module states object
    • measuredChassisSpeedsObj

      public static org.wpilib.math.kinematics.ChassisVelocities 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 org.wpilib.math.kinematics.ChassisVelocities desiredChassisSpeedsObj
      Describes the desired forward, sideways and angular velocity of the robot.
    • robotRotationObj

      public static org.wpilib.math.geometry.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