Class TalonSRXSimProfile

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

class TalonSRXSimProfile extends PhysicsSim.SimProfile
Holds information about a simulated TalonSRX.
  • Field Summary

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

    Constructors
    Constructor
    Description
    TalonSRXSimProfile(com.ctre.phoenix.motorcontrol.can.TalonSRX talon, double accelToFullTime, double fullVel, boolean sensorPhase)
    Creates a new simulation profile for a TalonSRX 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

    • _talon

      private final com.ctre.phoenix.motorcontrol.can.TalonSRX _talon
    • _accelToFullTime

      private final double _accelToFullTime
    • _fullVel

      private final double _fullVel
    • _sensorPhase

      private final boolean _sensorPhase
    • _vel

      private double _vel
      The current velocity
  • Constructor Details

    • TalonSRXSimProfile

      public TalonSRXSimProfile(com.ctre.phoenix.motorcontrol.can.TalonSRX talon, double accelToFullTime, double fullVel, boolean sensorPhase)
      Creates a new simulation profile for a TalonSRX device.
      Parameters:
      talon - The TalonSRX 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 TalonSRX 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