Is your feature request related to a problem? Please describe.
Current and torque control are becoming popular in CTRE's ecosystem, and our physics sim classes that use a voltage input aren't compatible with it.
Describe the solution you'd like
The current class is hardcoded to use a voltage input, so it's cleanest to have separate classes for each model type. Of the two choices, current or torque, the latter is more generalizable to all kinds of mechanisms.
The torque input should be the direct actuator output, not what the mechanism experiences directly. Thus, the model should include a gear ratio.
Describe alternatives you've considered
We could make all physics sim classes take a torque input, with add-ons for the motor dynamics to adapt voltage inputs to torque inputs (torque = −kₜ/(Rkᵥ) ω + kₜ/R V) or current inputs to torque inputs (torque = kₜ * current). Being able to isolate the actuator dynamics in this way is desirable.
I have a PR for DCMotorSim waiting to be merged. My next logical steps were Elevator and Arm cleanup, but I can roll that into this as well, unless you would like separate PR's
Is your feature request related to a problem? Please describe. Current and torque control are becoming popular in CTRE's ecosystem, and our physics sim classes that use a voltage input aren't compatible with it.
Describe the solution you'd like The current class is hardcoded to use a voltage input, so it's cleanest to have separate classes for each model type. Of the two choices, current or torque, the latter is more generalizable to all kinds of mechanisms.
The torque input should be the direct actuator output, not what the mechanism experiences directly. Thus, the model should include a gear ratio.
Describe alternatives you've considered We could make all physics sim classes take a torque input, with add-ons for the motor dynamics to adapt voltage inputs to torque inputs (
torque = −kₜ/(Rkᵥ) ω + kₜ/R V
) or current inputs to torque inputs (torque = kₜ * current
). Being able to isolate the actuator dynamics in this way is desirable.