Class SwerveDrivetrain.SwerveControlParameters

java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrain.SwerveControlParameters
Enclosing class:
SwerveDrivetrain<DriveMotorT extends CommonTalon, SteerMotorT extends CommonTalon, EncoderT extends ParentDevice>

public static class SwerveDrivetrain.SwerveControlParameters extends Object
Contains everything the control requests need to calculate the module state.
  • Field Details

    • drivetrainId

      public int drivetrainId
      ID of the native drivetrain instance, used for JNI calls
    • kinematics

      public SwerveDriveKinematics kinematics
      The kinematics object used for control
    • moduleLocations

      public Translation2d[] moduleLocations
      The locations of the swerve modules
    • kMaxSpeedMps

      public double kMaxSpeedMps
      The max speed of the robot at 12 V output, in m/s
    • operatorForwardDirection

      public Rotation2d operatorForwardDirection
      The forward direction from the operator perspective
    • currentChassisVelocity

      public ChassisVelocities currentChassisVelocity
      The current robot-centric chassis velocity
    • currentPose

      public Pose2d currentPose
      The current pose of the robot
    • timestamp

      public double timestamp
      The timestamp of the current control apply, in the timebase of Utils.getCurrentTimeSeconds()
    • updatePeriod

      public double updatePeriod
      The update period of control apply
  • Constructor Details

    • SwerveControlParameters

      public SwerveControlParameters()
  • Method Details

    • updateFromNative

      protected void updateFromNative(MemorySegment controlParams)
      Parameters:
      controlParams - SwerveNative.swerve_control_params_t