Class SwerveJNI

java.lang.Object
com.ctre.phoenix6.jni.CtreJniWrapper
com.ctre.phoenix6.swerve.jni.SwerveJNI
All Implemented Interfaces:
Cloneable

public class SwerveJNI extends CtreJniWrapper implements Cloneable
  • Field Details

  • Constructor Details

  • Method Details

    • clone

      public SwerveJNI clone()
      Overrides:
      clone in class Object
    • JNI_CreateDrivetrain

      public static int JNI_CreateDrivetrain(long drivetrainConstants, long moduleConstants, int numModules)
    • JNI_CreateDrivetrainWithFreq

      public static int JNI_CreateDrivetrainWithFreq(long drivetrainConstants, double odometryUpdateFreqHz, long moduleConstants, int numModules)
    • JNI_CreateDrivetrainWithStddev

      public static int JNI_CreateDrivetrainWithStddev(long drivetrainConstants, double odometryUpdateFreqHz, double[] odometryStandardDeviation, double[] visionStandardDeviation, long moduleConstants, int numModules)
    • JNI_DestroyDrivetrain

      public static void JNI_DestroyDrivetrain(int id)
    • JNI_IsOnCANFD

      public static boolean JNI_IsOnCANFD(int id)
    • JNI_GetOdometryFrequency

      public static double JNI_GetOdometryFrequency(int id)
    • JNI_IsOdometryValid

      public static boolean JNI_IsOdometryValid(int id)
    • JNI_SetControl

      public long JNI_SetControl(int id, IntSupplier request)
    • JNI_DestroyControl

      public static void JNI_DestroyControl(long handle)
    • JNI_GetState

      public void JNI_GetState(int id)
    • JNI_RegisterTelemetry

      public long JNI_RegisterTelemetry(int id, Runnable telemetryFunc)
    • JNI_DestroyTelemetry

      public static void JNI_DestroyTelemetry(long handle)
    • JNI_ConfigNeutralMode

      public static int JNI_ConfigNeutralMode(int id, int neutralMode)
    • JNI_TareEverything

      public static void JNI_TareEverything(int id)
    • JNI_SeedFieldCentric

      public static void JNI_SeedFieldCentric(int id)
    • JNI_ResetPose

      public static void JNI_ResetPose(int id, double xMeters, double yMeters, double rotationRad)
    • JNI_ResetTranslation

      public static void JNI_ResetTranslation(int id, double xMeters, double yMeters)
    • JNI_ResetRotation

      public static void JNI_ResetRotation(int id, double rotationRad)
    • JNI_SetOperatorPerspectiveForward

      public static void JNI_SetOperatorPerspectiveForward(int id, double rotationRad)
    • JNI_GetOperatorForwardDirection

      public static double JNI_GetOperatorForwardDirection(int id)
    • JNI_AddVisionMeasurement

      public static void JNI_AddVisionMeasurement(int id, double xMeters, double yMeters, double rotationRad, double timestampSeconds)
    • JNI_AddVisionMeasurementWithStdDev

      public static void JNI_AddVisionMeasurementWithStdDev(int id, double xMeters, double yMeters, double rotationRad, double timestampSeconds, double[] visionMeasurementStdDevs)
    • JNI_SetVisionMeasurementStdDevs

      public static void JNI_SetVisionMeasurementStdDevs(int id, double[] visionMeasurementStdDevs)
    • JNI_SetStateStdDevs

      public static void JNI_SetStateStdDevs(int id, double[] stateStdDevs)
    • JNI_SamplePoseAt

      public static double[] JNI_SamplePoseAt(int id, double timestampSeconds)
    • JNI_Odom_Start

      public static void JNI_Odom_Start(int id)
    • JNI_Odom_Stop

      public static void JNI_Odom_Stop(int id)
    • JNI_Odom_SetThreadPriority

      public static void JNI_Odom_SetThreadPriority(int id, int priority)
    • JNI_Module_Apply

      public void JNI_Module_Apply(int id, int idx)
    • JNI_Module_GetPosition

      public void JNI_Module_GetPosition(int id, int idx, boolean refresh)
    • JNI_Module_GetCachedPosition

      public void JNI_Module_GetCachedPosition(int id, int idx)
    • JNI_Module_GetCurrentState

      public void JNI_Module_GetCurrentState(int id, int idx)
    • JNI_Module_GetTargetState

      public void JNI_Module_GetTargetState(int id, int idx)
    • JNI_Module_ResetPosition

      public static void JNI_Module_ResetPosition(int id, int idx)
    • JNI_CreateDrivetrainConstants

      public static long JNI_CreateDrivetrainConstants(String canbusName, int pigeon2Id)
    • JNI_CreateModuleConstantsArr

      public static long JNI_CreateModuleConstantsArr(long numModules)
    • JNI_SetModuleConstants

      public static void JNI_SetModuleConstants(long constantsArr, long moduleIdx, int steerMotorId, int driveMotorId, int encoderId, double encoderOffset_tr, double locationX_m, double locationY_m, boolean driveMotorInverted, boolean steerMotorInverted, boolean encoderInverted, double driveMotorGearRatio, double steerMotorGearRatio, double couplingGearRatio, double wheelRadius_m, int steerMotorClosedLoopOutput, int driveMotorClosedLoopOutput, double slipCurrent_A, double speedAt12Volts_mps, int driveMotorType, int steerMotorType, int feedbackSource, double steerInertia_kg_sq_m, double driveInertia_kg_sq_m, double steerFrictionVoltage_V, double driveFrictionVoltage_V)
    • JNI_DestroyConstants

      public static void JNI_DestroyConstants(long constants)
    • JNI_SetControl_Idle

      public static void JNI_SetControl_Idle(int id)
    • JNI_Request_Apply_Idle

      public static int JNI_Request_Apply_Idle(int id)
    • JNI_SetControl_SwerveDriveBrake

      public static void JNI_SetControl_SwerveDriveBrake(int id, int driveRequestType, int steerRequestType)
    • JNI_Request_Apply_SwerveDriveBrake

      public static int JNI_Request_Apply_SwerveDriveBrake(int id, int driveRequestType, int steerRequestType)
    • JNI_SetControl_FieldCentric

      public static void JNI_SetControl_FieldCentric(int id, double velocityX_mps, double velocityY_mps, double rotationalRate_rad_per_s, double deadband_mps, double rotationalDeadband_rad_per_s, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds, int forwardPerspective)
    • JNI_Request_Apply_FieldCentric

      public static int JNI_Request_Apply_FieldCentric(int id, double velocityX_mps, double velocityY_mps, double rotationalRate_rad_per_s, double deadband_mps, double rotationalDeadband_rad_per_s, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds, int forwardPerspective)
    • JNI_SetControl_RobotCentric

      public static void JNI_SetControl_RobotCentric(int id, double velocityX_mps, double velocityY_mps, double rotationalRate_rad_per_s, double deadband_mps, double rotationalDeadband_rad_per_s, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds)
    • JNI_Request_Apply_RobotCentric

      public static int JNI_Request_Apply_RobotCentric(int id, double velocityX_mps, double velocityY_mps, double rotationalRate_rad_per_s, double deadband_mps, double rotationalDeadband_rad_per_s, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds)
    • JNI_SetControl_PointWheelsAt

      public static void JNI_SetControl_PointWheelsAt(int id, double moduleDirection, int driveRequestType, int steerRequestType)
    • JNI_Request_Apply_PointWheelsAt

      public static int JNI_Request_Apply_PointWheelsAt(int id, double moduleDirection, int driveRequestType, int steerRequestType)
    • JNI_SetControl_ApplyRobotSpeeds

      public static void JNI_SetControl_ApplyRobotSpeeds(int id, double speedsVx, double speedsVy, double speedsOmega, double[] wheelForceFeedforwardsX_N, double[] wheelForceFeedforwardsY_N, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds)
    • JNI_Request_Apply_ApplyRobotSpeeds

      public static int JNI_Request_Apply_ApplyRobotSpeeds(int id, double speedsVx, double speedsVy, double speedsOmega, double[] wheelForceFeedforwardsX_N, double[] wheelForceFeedforwardsY_N, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds)
    • JNI_SetControl_ApplyFieldSpeeds

      public static void JNI_SetControl_ApplyFieldSpeeds(int id, double speedsVx, double speedsVy, double speedsOmega, double[] wheelForceFeedforwardsX_N, double[] wheelForceFeedforwardsY_N, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds, int forwardPerspective)
    • JNI_Request_Apply_ApplyFieldSpeeds

      public static int JNI_Request_Apply_ApplyFieldSpeeds(int id, double speedsVx, double speedsVy, double speedsOmega, double[] wheelForceFeedforwardsX_N, double[] wheelForceFeedforwardsY_N, double centerOfRotationX, double centerOfRotationY, int driveRequestType, int steerRequestType, boolean desaturateWheelSpeeds, int forwardPerspective)