TalonFX sim

Hey guys, I was working on my swerve sim and accidentally messed up a constant essentially having me run drive as a “real robot”. In sim, I was pleasantly surprised to see a bunch of talonFX’s show up. Weirdly none of my code really worked.

looking at the CTRE documentation for sim, which seems outdated, it shows barely any methods supported. Is this expected? Should I expect that a control command like

            m_driveMotor.setControl(
                    new VelocityVoltage(velocityRotationsPerSec)
                    .withEnableFOC(true).withUpdateFreqHz(0).withSlot(0));

should do nothing at all or is this code not going to work in real life either?

Is there a reason you’re using 0 for your update frequency?

yes, I would prefer if all of my commands to motors got set as one shot requests. I have tried deleting that part and running without it, no dice.

We’ve got simulation with VelocityVoltage control requests working just fine in sim.

We’d need to see the rest of your simulation periodic things your’e doing to diagnose why it’s not working.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.