Class TalonFXSimProfile

java.lang.Object
swervelib.simulation.ctre.PhysicsSim.SimProfile
swervelib.simulation.ctre.TalonFXSimProfile

class TalonFXSimProfile extends PhysicsSim.SimProfile
Holds information about a simulated TalonFX.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
     
    private final com.ctre.phoenix.motorcontrol.can.TalonFX
     
    private final double
     
    private final boolean
     
    private double
    The current velocity
  • Constructor Summary

    Constructors
    Constructor
    Description
    TalonFXSimProfile(com.ctre.phoenix.motorcontrol.can.TalonFX falcon, double accelToFullTime, double fullVel, boolean sensorPhase)
    Creates a new simulation profile for a TalonFX device.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run()
    Runs the simulation profile.

    Methods inherited from class swervelib.simulation.ctre.PhysicsSim.SimProfile

    getPeriod

    Methods inherited from class java.lang.Object

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

    • _falcon

      private final com.ctre.phoenix.motorcontrol.can.TalonFX _falcon
    • _accelToFullTime

      private final double _accelToFullTime
    • _fullVel

      private final double _fullVel
    • _sensorPhase

      private final boolean _sensorPhase
    • _vel

      private double _vel
      The current velocity
  • Constructor Details

    • TalonFXSimProfile

      public TalonFXSimProfile(com.ctre.phoenix.motorcontrol.can.TalonFX falcon, double accelToFullTime, double fullVel, boolean sensorPhase)
      Creates a new simulation profile for a TalonFX device.
      Parameters:
      falcon - The TalonFX device
      accelToFullTime - The time the motor takes to accelerate from 0 to full, in seconds
      fullVel - The maximum motor velocity, in ticks per 100ms
      sensorPhase - The phase of the TalonFX sensors
  • Method Details

    • run

      public void run()
      Runs the simulation profile.

      This uses very rudimentary physics simulation and exists to allow users to test features of our products in simulation using our examples out of the box. Users may modify this to utilize more accurate physics simulation.

      Overrides:
      run in class PhysicsSim.SimProfile