Conversation
SCool62
left a comment
There was a problem hiding this comment.
Looks very good, but you still need to write a TurretIOSim.
| public static double HOOD_GEAR_RATIO = 24.230769; | ||
| public static Rotation2d HOOD_MAX_ROTATION = Rotation2d.fromDegrees(40); | ||
| public static Rotation2d HOOD_MIN_ROTATION = Rotation2d.fromDegrees(2); | ||
| public static double TURRET_GEAR_RATIO = (12.0 / 42.0) * (16.0 / 32.0) * (10.0 / 85.0); |
There was a problem hiding this comment.
I assume you've checked this with cad?
| /** Add your docs here. */ | ||
| public class TurretIO { | ||
| @AutoLog | ||
| public static class TurretIOInputs { |
| public double turretSupplyCurrentAmps = 0.0; | ||
| public double turretVoltage = 0.0; | ||
| public double turretTempC = 0.0; | ||
| // _TODO: Input reall values |
| private VelocityVoltage velocityVoltage = new VelocityVoltage(0.0).withEnableFOC(true); | ||
|
|
||
| public TurretIO(TalonFXConfiguration talonFXConfiguration, CANBus canbus) { | ||
| turretMotor = new TalonFX(11, canbus); |
There was a problem hiding this comment.
The shooter hood is already ID 11. Comp CAN ids haven't been decided yet so for now give it a large random number (like 40 or smth) for now
There was a problem hiding this comment.
Btw this is so that the ids don't clash during sim
There was a problem hiding this comment.
Ig its not on this branch so maybe it doesn't matter but better avoid the problem now then fix it later
spellingcat
left a comment
There was a problem hiding this comment.
overall looks really great! just a few things and then it will be there :)
| inputs.turretStatorCurrentAmps = turretStatorCurrent.getValueAsDouble(); | ||
| inputs.turretSupplyCurrentAmps = turretSupplyCurrent.getValueAsDouble(); | ||
| inputs.turretTempC = turretTemp.getValueAsDouble(); | ||
| } |
There was a problem hiding this comment.
make sure you also refersh the velocity status signal and update its value here
| public TurretIO turretIO; | ||
| public TurretIOInputsAutoLogged turretIOInputs = new TurretIOInputsAutoLogged(); |
There was a problem hiding this comment.
make these private instead of public
| turretphysicssSim.setInputVoltage(motorSim.getMotorVoltage()); | ||
| turretphysicssSim.update(deltaTime); | ||
| motorSim.setRawRotorPosition(turretphysicssSim.getAngularPositionRotations() * turretphysicssSim.getGearing()); | ||
| motorSim.setRotorVelocity(turretphysicssSim.getAngularVelocityRPM()/60 * turretphysicssSim.getGearing()); |
There was a problem hiding this comment.
| motorSim.setRotorVelocity(turretphysicssSim.getAngularVelocityRPM()/60 * turretphysicssSim.getGearing()); | |
| DCMotorSim turretPhysicsSim = |
No description provided.