use ctre sim for elevator - #32
Conversation
| * (ElevatorSubsystem.SPROCKET_DIAMETER_METERS / 2)) | ||
| / ElevatorSubsystem.GEAR_RATIO); | ||
|
|
||
| // automatically calls the superclass constructor |
There was a problem hiding this comment.
It looks like in the docs there's a couple of config lines that are supposed to happen in simulationInit() (like setting the motor type etc.). Maybe those should go in the constructor?
| leaderSim.setSupplyVoltage(RobotController.getBatteryVoltage()); | ||
|
|
||
| // calculate pid for the physics sim | ||
| volts = |
There was a problem hiding this comment.
I had thought that a main advantage of this is instead of using the wpilib controllers, the controls use the talonfx config as they would on robot, and the physics sim gets the voltage from the motor sim state. lmk if i'm mistaken tho
| // it just updates the value the ctre sim has stored | ||
|
|
||
| // convert back to rotor position because it doesn't let you set linear position directly | ||
| leaderSim.setRawRotorPosition( |
There was a problem hiding this comment.
So strange they don't let you set actual mech position. CTRE is stupid sometimes ig.
There was a problem hiding this comment.
i suspect it's because it reconverts it back with the sensor to mech ratio lol
|
moved to ctre-sim-rabbit-hole |
this doesn't actually need to be merged but i'm tagging y'all for review