6391-Ursuline-Bearbotics / BearSwerve

Swerve control, simulation, and trajectory generation / following. Everything you need for swerve.
Other
13 stars 4 forks source link

SetReferenceAngle #5

Open mjbergman92 opened 1 year ago

mjbergman92 commented 1 year ago

Falcon500SteerControllerFactoryBuilder.java > setReferenceAngle

There is a problem here.... the seeding for the steering Falcon500 has been removed. It is there for the NEO builder, why did it get removed here?Should look something like this:

// YES THE COMMENT IS FOR NEOS. THAT IS HOW SDS HAD IT, NOT MY FAULT. IT APPLIES
// TO FALCONS
// Reset the NEO's encoder periodically when the module is not rotating.
// Sometimes (~5% of the time) when we initialize, the absolute encoder isn't
// fully set up, and we don't
// end up getting a good reading. If we reset periodically this won't matter
// anymore.
if (motor.getSelectedSensorVelocity() * motorEncoderVelocityCoefficient < ENCODER_RESET_MAX_ANGULAR_VELOCITY) {
    if (++resetIteration >= ENCODER_RESET_ITERATIONS) {
        resetIteration = 0;
        double absoluteAngle = absoluteEncoder.getAbsoluteAngle().getRadians();
        motor.setSelectedSensorPosition(absoluteAngle / motorEncoderPositionCoefficient);
        currentAngleRadians = absoluteAngle;
    }
} else {
    resetIteration = 0;
}

Again, I have made my own fork and I hope maybe you could take a look at mine for reference.

I believe there is a way for me to submit a pull request, but i dont know how to only request one particular change, thats my weakness. The fork is under team 3534 organization, HOC-Team-3534.