Package swervelib.simulation.ctre
Class TalonFXSimProfile
java.lang.Object
swervelib.simulation.ctre.PhysicsSim.SimProfile
swervelib.simulation.ctre.TalonFXSimProfile
Holds information about a simulated TalonFX.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate final com.ctre.phoenix.motorcontrol.can.TalonFXprivate final doubleprivate final booleanprivate doubleThe current velocity -
Constructor Summary
ConstructorsConstructorDescriptionTalonFXSimProfile(com.ctre.phoenix.motorcontrol.can.TalonFX falcon, double accelToFullTime, double fullVel, boolean sensorPhase) Creates a new simulation profile for a TalonFX device. -
Method Summary
Methods inherited from class swervelib.simulation.ctre.PhysicsSim.SimProfile
getPeriod
-
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 _velThe 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 deviceaccelToFullTime- The time the motor takes to accelerate from 0 to full, in secondsfullVel- The maximum motor velocity, in ticks per 100mssensorPhase- 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:
runin classPhysicsSim.SimProfile
-