Addressing issue #7 by reading CANCoder values until successful with 10ms delay between readings. Fall back to reading relative encoder.

This commit is contained in:
thenetworkgrinch
2023-02-20 20:59:31 -06:00
parent 8f9ffdf031
commit dd28a657b2
43 changed files with 570 additions and 363 deletions

View File

@@ -31,8 +31,11 @@ class TalonFXSimProfile extends SimProfile
* @param fullVel The maximum motor velocity, in ticks per 100ms
* @param sensorPhase The phase of the TalonFX sensors
*/
public TalonFXSimProfile(final TalonFX falcon, final double accelToFullTime, final double fullVel,
final boolean sensorPhase)
public TalonFXSimProfile(
final TalonFX falcon,
final double accelToFullTime,
final double fullVel,
final boolean sensorPhase)
{
this._falcon = falcon;
this._accelToFullTime = accelToFullTime;
@@ -42,9 +45,10 @@ class TalonFXSimProfile extends SimProfile
/**
* Runs the simulation profile.
* <p>
* 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.
*
* <p>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.
*/
public void run()
{
@@ -85,4 +89,4 @@ class TalonFXSimProfile extends SimProfile
_falcon.getSimCollection().setBusVoltage(12 - outPerc * outPerc * 3 / 4 * random(0.95, 1.05));
}
}
}